xref: /netbsd-src/tests/lib/libcurses/t_curses.sh (revision 46f5119e40af2e51998f686b2fdcc76b5488f7f3)
1
2h_run()
3{
4	file="$(atf_get_srcdir)/tests/${1}"
5
6	HOME=$(atf_get_srcdir)
7	CHECK_PATH=$(atf_get_srcdir)/check_files
8	INCLUDE_PATH=$(atf_get_srcdir)/tests
9	export CHECK_PATH INCLUDE_PATH HOME
10
11	$(atf_get_srcdir)/director -s $(atf_get_srcdir)/slave $file || atf_fail "test ${file} failed"
12}
13
14atf_test_case startup
15startup_head()
16{
17	atf_set "descr" "Checks curses initialisation sequence"
18}
19startup_body()
20{
21	h_run start
22}
23
24atf_test_case addch
25addch_head()
26{
27	atf_set "descr" "Tests adding a chtype to stdscr"
28}
29addch_body()
30{
31	h_run addch
32}
33
34atf_test_case addchstr
35addchstr_head()
36{
37	atf_set "descr" "Tests adding a chtype string to stdscr"
38}
39addchstr_body()
40{
41	h_run addchstr
42}
43
44atf_test_case addchnstr
45addchnstr_head()
46{
47	atf_set "descr" "Tests adding bytes from a chtype string to stdscr"
48}
49addchnstr_body()
50{
51	h_run addchnstr
52}
53
54atf_test_case addstr
55addstr_head()
56{
57	atf_set "descr" "Tests adding bytes from a string to stdscr"
58}
59addstr_body()
60{
61	h_run addstr
62}
63
64atf_test_case addnstr
65addnstr_head()
66{
67	atf_set "descr" "Tests adding bytes from a string to stdscr"
68}
69addnstr_body()
70{
71	h_run addnstr
72}
73
74atf_test_case getch
75getch_head()
76{
77	atf_set "descr" "Checks reading a character input"
78}
79getch_body()
80{
81	h_run getch
82}
83
84atf_test_case timeout
85timeout_head()
86{
87	atf_set "descr" "Checks timeout when reading a character"
88}
89timeout_body()
90{
91	h_run timeout
92}
93
94atf_test_case window
95window_head()
96{
97	atf_set "descr" "Checks window creation"
98}
99window_body()
100{
101	h_run window
102}
103
104atf_test_case wborder
105wborder_head()
106{
107	atf_set "descr" "Checks drawing a border around a window"
108}
109wborder_body()
110{
111	h_run wborder
112}
113
114atf_test_case box
115box_head()
116{
117	atf_set "descr" "Checks drawing a box around a window"
118}
119box_body()
120{
121	h_run box
122}
123
124atf_test_case wprintw
125wprintw_head()
126{
127	atf_set "descr" "Checks printing to a window"
128}
129wprintw_body()
130{
131	h_run wprintw
132}
133
134atf_test_case wscrl
135wscrl_head()
136{
137	atf_set "descr" "Check window scrolling"
138}
139wscrl_body()
140{
141	h_run wscrl
142}
143
144atf_test_case mvwin
145mvwin_head()
146{
147	atf_set "descr" "Check moving a window"
148}
149mvwin_body()
150{
151	h_run mvwin
152}
153
154atf_test_case getstr
155getstr_head()
156{
157	atf_set "descr" "Check getting a string from input"
158}
159getstr_body()
160{
161	h_run getstr
162}
163
164atf_test_case termattrs
165termattrs_head()
166{
167	atf_set "descr" "Check the terminal attributes"
168}
169termattrs_body()
170{
171	h_run termattrs
172}
173
174atf_test_case assume_default_colors
175assume_default_colors_head()
176{
177	atf_set "descr" "Check setting the default color pair"
178}
179assume_default_colors_body()
180{
181	h_run assume_default_colors
182}
183
184atf_test_case attributes
185attributes_head()
186{
187	atf_set "descr" "Check setting, clearing and getting of attributes"
188}
189attributes_body()
190{
191	h_run attributes
192}
193
194atf_test_case beep
195beep_head()
196{
197	atf_set "descr" "Check sending a beep"
198}
199beep_body()
200{
201	h_run beep
202}
203
204atf_test_case background
205background_head()
206{
207	atf_set "descr" "Check setting background character and attributes for both stdscr and a window."
208}
209background_body()
210{
211	h_run background
212}
213
214atf_test_case can_change_color
215can_change_color_head()
216{
217	atf_set "descr" "Check if the terminal can change colours"
218}
219can_change_color_body()
220{
221	h_run can_change_color
222}
223
224atf_test_case cbreak
225cbreak_head()
226{
227	atf_set "descr" "Check cbreak mode works"
228}
229cbreak_body()
230{
231	h_run cbreak
232}
233
234atf_test_case clear
235clear_head()
236{
237	atf_set "descr" "Check clear and erase work"
238}
239clear_body()
240{
241	h_run clear
242}
243
244atf_test_case copywin
245copywin_head()
246{
247	atf_set "descr" "Check all the modes of copying a window work"
248}
249copywin_body()
250{
251	h_run copywin
252}
253
254atf_test_case curs_set
255curs_set_head()
256{
257	atf_set "descr" "Check setting the cursor visibility works"
258}
259curs_set_body()
260{
261	h_run curs_set
262}
263
264atf_init_test_cases()
265{
266	atf_add_test_case startup
267	atf_add_test_case addch
268	atf_add_test_case addchstr
269	atf_add_test_case addchnstr
270	atf_add_test_case addstr
271	atf_add_test_case addnstr
272	atf_add_test_case getch
273	atf_add_test_case timeout
274	atf_add_test_case window
275	atf_add_test_case wborder
276	atf_add_test_case box
277	atf_add_test_case wprintw
278	atf_add_test_case wscrl
279	atf_add_test_case mvwin
280	atf_add_test_case getstr
281	atf_add_test_case termattrs
282	atf_add_test_case can_change_color
283	atf_add_test_case assume_default_colors
284	atf_add_test_case attributes
285	atf_add_test_case beep
286	atf_add_test_case background
287	atf_add_test_case cbreak
288	atf_add_test_case clear
289	atf_add_test_case copywin
290	atf_add_test_case curs_set
291}
292
293