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