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