xref: /minix3/tests/lib/libcurses/t_curses.sh (revision 11be35a165022172ed3cea20f2b5df0307540b0e)
1*11be35a1SLionel Sambuc
2*11be35a1SLionel Sambuch_run()
3*11be35a1SLionel Sambuc{
4*11be35a1SLionel Sambuc	file="$(atf_get_srcdir)/tests/${1}"
5*11be35a1SLionel Sambuc
6*11be35a1SLionel Sambuc	export COLUMNS=80
7*11be35a1SLionel Sambuc	export LINES=24
8*11be35a1SLionel Sambuc	$(atf_get_srcdir)/director \
9*11be35a1SLionel Sambuc	    -T $(atf_get_srcdir) \
10*11be35a1SLionel Sambuc	    -t atf \
11*11be35a1SLionel Sambuc	    -I $(atf_get_srcdir)/tests \
12*11be35a1SLionel Sambuc	    -C $(atf_get_srcdir)/check_files \
13*11be35a1SLionel Sambuc	    -s $(atf_get_srcdir)/slave $file || atf_fail "test ${file} failed"
14*11be35a1SLionel Sambuc}
15*11be35a1SLionel Sambuc
16*11be35a1SLionel Sambucatf_test_case startup
17*11be35a1SLionel Sambucstartup_head()
18*11be35a1SLionel Sambuc{
19*11be35a1SLionel Sambuc	atf_set "descr" "Checks curses initialisation sequence"
20*11be35a1SLionel Sambuc}
21*11be35a1SLionel Sambucstartup_body()
22*11be35a1SLionel Sambuc{
23*11be35a1SLionel Sambuc	h_run start
24*11be35a1SLionel Sambuc}
25*11be35a1SLionel Sambuc
26*11be35a1SLionel Sambucatf_test_case addch
27*11be35a1SLionel Sambucaddch_head()
28*11be35a1SLionel Sambuc{
29*11be35a1SLionel Sambuc	atf_set "descr" "Tests adding a chtype to stdscr"
30*11be35a1SLionel Sambuc}
31*11be35a1SLionel Sambucaddch_body()
32*11be35a1SLionel Sambuc{
33*11be35a1SLionel Sambuc	h_run addch
34*11be35a1SLionel Sambuc}
35*11be35a1SLionel Sambuc
36*11be35a1SLionel Sambucatf_test_case addchstr
37*11be35a1SLionel Sambucaddchstr_head()
38*11be35a1SLionel Sambuc{
39*11be35a1SLionel Sambuc	atf_set "descr" "Tests adding a chtype string to stdscr"
40*11be35a1SLionel Sambuc}
41*11be35a1SLionel Sambucaddchstr_body()
42*11be35a1SLionel Sambuc{
43*11be35a1SLionel Sambuc	h_run addchstr
44*11be35a1SLionel Sambuc}
45*11be35a1SLionel Sambuc
46*11be35a1SLionel Sambucatf_test_case addchnstr
47*11be35a1SLionel Sambucaddchnstr_head()
48*11be35a1SLionel Sambuc{
49*11be35a1SLionel Sambuc	atf_set "descr" "Tests adding bytes from a chtype string to stdscr"
50*11be35a1SLionel Sambuc}
51*11be35a1SLionel Sambucaddchnstr_body()
52*11be35a1SLionel Sambuc{
53*11be35a1SLionel Sambuc	h_run addchnstr
54*11be35a1SLionel Sambuc}
55*11be35a1SLionel Sambuc
56*11be35a1SLionel Sambucatf_test_case addstr
57*11be35a1SLionel Sambucaddstr_head()
58*11be35a1SLionel Sambuc{
59*11be35a1SLionel Sambuc	atf_set "descr" "Tests adding bytes from a string to stdscr"
60*11be35a1SLionel Sambuc}
61*11be35a1SLionel Sambucaddstr_body()
62*11be35a1SLionel Sambuc{
63*11be35a1SLionel Sambuc	h_run addstr
64*11be35a1SLionel Sambuc}
65*11be35a1SLionel Sambuc
66*11be35a1SLionel Sambucatf_test_case addnstr
67*11be35a1SLionel Sambucaddnstr_head()
68*11be35a1SLionel Sambuc{
69*11be35a1SLionel Sambuc	atf_set "descr" "Tests adding bytes from a string to stdscr"
70*11be35a1SLionel Sambuc}
71*11be35a1SLionel Sambucaddnstr_body()
72*11be35a1SLionel Sambuc{
73*11be35a1SLionel Sambuc	h_run addnstr
74*11be35a1SLionel Sambuc}
75*11be35a1SLionel Sambuc
76*11be35a1SLionel Sambucatf_test_case getch
77*11be35a1SLionel Sambucgetch_head()
78*11be35a1SLionel Sambuc{
79*11be35a1SLionel Sambuc	atf_set "descr" "Checks reading a character input"
80*11be35a1SLionel Sambuc}
81*11be35a1SLionel Sambucgetch_body()
82*11be35a1SLionel Sambuc{
83*11be35a1SLionel Sambuc	h_run getch
84*11be35a1SLionel Sambuc}
85*11be35a1SLionel Sambuc
86*11be35a1SLionel Sambucatf_test_case timeout
87*11be35a1SLionel Sambuctimeout_head()
88*11be35a1SLionel Sambuc{
89*11be35a1SLionel Sambuc	atf_set "descr" "Checks timeout when reading a character"
90*11be35a1SLionel Sambuc}
91*11be35a1SLionel Sambuctimeout_body()
92*11be35a1SLionel Sambuc{
93*11be35a1SLionel Sambuc	h_run timeout
94*11be35a1SLionel Sambuc}
95*11be35a1SLionel Sambuc
96*11be35a1SLionel Sambucatf_test_case window
97*11be35a1SLionel Sambucwindow_head()
98*11be35a1SLionel Sambuc{
99*11be35a1SLionel Sambuc	atf_set "descr" "Checks window creation"
100*11be35a1SLionel Sambuc}
101*11be35a1SLionel Sambucwindow_body()
102*11be35a1SLionel Sambuc{
103*11be35a1SLionel Sambuc	h_run window
104*11be35a1SLionel Sambuc}
105*11be35a1SLionel Sambuc
106*11be35a1SLionel Sambucatf_test_case wborder
107*11be35a1SLionel Sambucwborder_head()
108*11be35a1SLionel Sambuc{
109*11be35a1SLionel Sambuc	atf_set "descr" "Checks drawing a border around a window"
110*11be35a1SLionel Sambuc}
111*11be35a1SLionel Sambucwborder_body()
112*11be35a1SLionel Sambuc{
113*11be35a1SLionel Sambuc	h_run wborder
114*11be35a1SLionel Sambuc}
115*11be35a1SLionel Sambuc
116*11be35a1SLionel Sambucatf_test_case box
117*11be35a1SLionel Sambucbox_head()
118*11be35a1SLionel Sambuc{
119*11be35a1SLionel Sambuc	atf_set "descr" "Checks drawing a box around a window"
120*11be35a1SLionel Sambuc}
121*11be35a1SLionel Sambucbox_body()
122*11be35a1SLionel Sambuc{
123*11be35a1SLionel Sambuc	h_run box
124*11be35a1SLionel Sambuc}
125*11be35a1SLionel Sambuc
126*11be35a1SLionel Sambucatf_test_case wprintw
127*11be35a1SLionel Sambucwprintw_head()
128*11be35a1SLionel Sambuc{
129*11be35a1SLionel Sambuc	atf_set "descr" "Checks printing to a window"
130*11be35a1SLionel Sambuc}
131*11be35a1SLionel Sambucwprintw_body()
132*11be35a1SLionel Sambuc{
133*11be35a1SLionel Sambuc	h_run wprintw
134*11be35a1SLionel Sambuc}
135*11be35a1SLionel Sambuc
136*11be35a1SLionel Sambucatf_test_case wscrl
137*11be35a1SLionel Sambucwscrl_head()
138*11be35a1SLionel Sambuc{
139*11be35a1SLionel Sambuc	atf_set "descr" "Check window scrolling"
140*11be35a1SLionel Sambuc}
141*11be35a1SLionel Sambucwscrl_body()
142*11be35a1SLionel Sambuc{
143*11be35a1SLionel Sambuc	h_run wscrl
144*11be35a1SLionel Sambuc}
145*11be35a1SLionel Sambuc
146*11be35a1SLionel Sambucatf_test_case mvwin
147*11be35a1SLionel Sambucmvwin_head()
148*11be35a1SLionel Sambuc{
149*11be35a1SLionel Sambuc	atf_set "descr" "Check moving a window"
150*11be35a1SLionel Sambuc}
151*11be35a1SLionel Sambucmvwin_body()
152*11be35a1SLionel Sambuc{
153*11be35a1SLionel Sambuc	h_run mvwin
154*11be35a1SLionel Sambuc}
155*11be35a1SLionel Sambuc
156*11be35a1SLionel Sambucatf_test_case getstr
157*11be35a1SLionel Sambucgetstr_head()
158*11be35a1SLionel Sambuc{
159*11be35a1SLionel Sambuc	atf_set "descr" "Check getting a string from input"
160*11be35a1SLionel Sambuc}
161*11be35a1SLionel Sambucgetstr_body()
162*11be35a1SLionel Sambuc{
163*11be35a1SLionel Sambuc	h_run getstr
164*11be35a1SLionel Sambuc}
165*11be35a1SLionel Sambuc
166*11be35a1SLionel Sambucatf_test_case termattrs
167*11be35a1SLionel Sambuctermattrs_head()
168*11be35a1SLionel Sambuc{
169*11be35a1SLionel Sambuc	atf_set "descr" "Check the terminal attributes"
170*11be35a1SLionel Sambuc}
171*11be35a1SLionel Sambuctermattrs_body()
172*11be35a1SLionel Sambuc{
173*11be35a1SLionel Sambuc	h_run termattrs
174*11be35a1SLionel Sambuc}
175*11be35a1SLionel Sambuc
176*11be35a1SLionel Sambucatf_test_case assume_default_colors
177*11be35a1SLionel Sambucassume_default_colors_head()
178*11be35a1SLionel Sambuc{
179*11be35a1SLionel Sambuc	atf_set "descr" "Check setting the default color pair"
180*11be35a1SLionel Sambuc}
181*11be35a1SLionel Sambucassume_default_colors_body()
182*11be35a1SLionel Sambuc{
183*11be35a1SLionel Sambuc	h_run assume_default_colors
184*11be35a1SLionel Sambuc}
185*11be35a1SLionel Sambuc
186*11be35a1SLionel Sambucatf_test_case attributes
187*11be35a1SLionel Sambucattributes_head()
188*11be35a1SLionel Sambuc{
189*11be35a1SLionel Sambuc	atf_set "descr" "Check setting, clearing and getting of attributes"
190*11be35a1SLionel Sambuc}
191*11be35a1SLionel Sambucattributes_body()
192*11be35a1SLionel Sambuc{
193*11be35a1SLionel Sambuc	h_run attributes
194*11be35a1SLionel Sambuc}
195*11be35a1SLionel Sambuc
196*11be35a1SLionel Sambucatf_test_case beep
197*11be35a1SLionel Sambucbeep_head()
198*11be35a1SLionel Sambuc{
199*11be35a1SLionel Sambuc	atf_set "descr" "Check sending a beep"
200*11be35a1SLionel Sambuc}
201*11be35a1SLionel Sambucbeep_body()
202*11be35a1SLionel Sambuc{
203*11be35a1SLionel Sambuc	h_run beep
204*11be35a1SLionel Sambuc}
205*11be35a1SLionel Sambuc
206*11be35a1SLionel Sambucatf_test_case background
207*11be35a1SLionel Sambucbackground_head()
208*11be35a1SLionel Sambuc{
209*11be35a1SLionel Sambuc	atf_set "descr" "Check setting background character and attributes for both stdscr and a window."
210*11be35a1SLionel Sambuc}
211*11be35a1SLionel Sambucbackground_body()
212*11be35a1SLionel Sambuc{
213*11be35a1SLionel Sambuc	h_run background
214*11be35a1SLionel Sambuc}
215*11be35a1SLionel Sambuc
216*11be35a1SLionel Sambucatf_test_case can_change_color
217*11be35a1SLionel Sambuccan_change_color_head()
218*11be35a1SLionel Sambuc{
219*11be35a1SLionel Sambuc	atf_set "descr" "Check if the terminal can change colours"
220*11be35a1SLionel Sambuc}
221*11be35a1SLionel Sambuccan_change_color_body()
222*11be35a1SLionel Sambuc{
223*11be35a1SLionel Sambuc	h_run can_change_color
224*11be35a1SLionel Sambuc}
225*11be35a1SLionel Sambuc
226*11be35a1SLionel Sambucatf_test_case cbreak
227*11be35a1SLionel Sambuccbreak_head()
228*11be35a1SLionel Sambuc{
229*11be35a1SLionel Sambuc	atf_set "descr" "Check cbreak mode works"
230*11be35a1SLionel Sambuc}
231*11be35a1SLionel Sambuccbreak_body()
232*11be35a1SLionel Sambuc{
233*11be35a1SLionel Sambuc	h_run cbreak
234*11be35a1SLionel Sambuc}
235*11be35a1SLionel Sambuc
236*11be35a1SLionel Sambucatf_test_case clear
237*11be35a1SLionel Sambucclear_head()
238*11be35a1SLionel Sambuc{
239*11be35a1SLionel Sambuc	atf_set "descr" "Check clear and erase work"
240*11be35a1SLionel Sambuc}
241*11be35a1SLionel Sambucclear_body()
242*11be35a1SLionel Sambuc{
243*11be35a1SLionel Sambuc	h_run clear
244*11be35a1SLionel Sambuc}
245*11be35a1SLionel Sambuc
246*11be35a1SLionel Sambucatf_test_case copywin
247*11be35a1SLionel Sambuccopywin_head()
248*11be35a1SLionel Sambuc{
249*11be35a1SLionel Sambuc	atf_set "descr" "Check all the modes of copying a window work"
250*11be35a1SLionel Sambuc}
251*11be35a1SLionel Sambuccopywin_body()
252*11be35a1SLionel Sambuc{
253*11be35a1SLionel Sambuc	h_run copywin
254*11be35a1SLionel Sambuc}
255*11be35a1SLionel Sambuc
256*11be35a1SLionel Sambucatf_test_case curs_set
257*11be35a1SLionel Sambuccurs_set_head()
258*11be35a1SLionel Sambuc{
259*11be35a1SLionel Sambuc	atf_set "descr" "Check setting the cursor visibility works"
260*11be35a1SLionel Sambuc}
261*11be35a1SLionel Sambuccurs_set_body()
262*11be35a1SLionel Sambuc{
263*11be35a1SLionel Sambuc	h_run curs_set
264*11be35a1SLionel Sambuc}
265*11be35a1SLionel Sambuc
266*11be35a1SLionel Sambucatf_init_test_cases()
267*11be35a1SLionel Sambuc{
268*11be35a1SLionel Sambuc	atf_add_test_case startup
269*11be35a1SLionel Sambuc	atf_add_test_case addch
270*11be35a1SLionel Sambuc	atf_add_test_case addchstr
271*11be35a1SLionel Sambuc	atf_add_test_case addchnstr
272*11be35a1SLionel Sambuc	atf_add_test_case addstr
273*11be35a1SLionel Sambuc	atf_add_test_case addnstr
274*11be35a1SLionel Sambuc	atf_add_test_case getch
275*11be35a1SLionel Sambuc	atf_add_test_case timeout
276*11be35a1SLionel Sambuc	atf_add_test_case window
277*11be35a1SLionel Sambuc	atf_add_test_case wborder
278*11be35a1SLionel Sambuc	atf_add_test_case box
279*11be35a1SLionel Sambuc	atf_add_test_case wprintw
280*11be35a1SLionel Sambuc	atf_add_test_case wscrl
281*11be35a1SLionel Sambuc	atf_add_test_case mvwin
282*11be35a1SLionel Sambuc	atf_add_test_case getstr
283*11be35a1SLionel Sambuc	atf_add_test_case termattrs
284*11be35a1SLionel Sambuc	atf_add_test_case can_change_color
285*11be35a1SLionel Sambuc	atf_add_test_case assume_default_colors
286*11be35a1SLionel Sambuc	atf_add_test_case attributes
287*11be35a1SLionel Sambuc#	atf_add_test_case beep  # comment out for now - return is wrong
288*11be35a1SLionel Sambuc	atf_add_test_case background
289*11be35a1SLionel Sambuc	atf_add_test_case cbreak
290*11be35a1SLionel Sambuc	atf_add_test_case clear
291*11be35a1SLionel Sambuc	atf_add_test_case copywin
292*11be35a1SLionel Sambuc	atf_add_test_case curs_set
293*11be35a1SLionel Sambuc}
294*11be35a1SLionel Sambuc
295