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