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