test init: refactor: new function 'am_setup_testdir'
[automake.git] / t / testsuite-summary-color.sh
bloba0effd6893f9759b8fbb19bbdf83b4beea58ea88
1 #! /bin/sh
2 # Copyright (C) 2011-2012 Free Software Foundation, Inc.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2, or (at your option)
7 # any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
17 # Check coloring of the testsuite summary.
19 . test-defs.sh
21 use_colors=yes
22 use_vpath=no
24 . testsuite-summary-checks.sh
26 ./configure
28 # ANSI colors.
29 red='\e[0;31m'
30 grn='\e[0;32m'
31 lgn='\e[1;32m'
32 blu='\e[1;34m'
33 mgn='\e[0;35m'
34 brg='\e[1m';
35 std='\e[m';
37 success_header="\
38 ${grn}${br}${std}
39 ${grn}Testsuite summary for GNU AutoFoo 7.1${std}
40 ${grn}${br}${std}"
42 success_footer=${grn}${br}${std}
44 failure_header="\
45 ${red}${br}${std}
46 ${red}Testsuite summary for GNU AutoFoo 7.1${std}
47 ${red}${br}${std}"
49 failure_footer="\
50 ${red}${br}${std}
51 ${red}See ./test-suite.log${std}
52 ${red}Please report to bug-automake@gnu.org${std}
53 ${red}${br}${std}"
55 do_check '' <<END
56 $success_header
57 # TOTAL: 0
58 # PASS: 0
59 # SKIP: 0
60 # XFAIL: 0
61 # FAIL: 0
62 # XPASS: 0
63 # ERROR: 0
64 $success_footer
65 END
67 do_check pass.t <<END
68 $success_header
69 ${brg}# TOTAL: 1${std}
70 ${grn}# PASS: 1${std}
71 # SKIP: 0
72 # XFAIL: 0
73 # FAIL: 0
74 # XPASS: 0
75 # ERROR: 0
76 $success_footer
77 END
79 do_check skip.t <<END
80 $success_header
81 ${brg}# TOTAL: 1${std}
82 # PASS: 0
83 ${blu}# SKIP: 1${std}
84 # XFAIL: 0
85 # FAIL: 0
86 # XPASS: 0
87 # ERROR: 0
88 $success_footer
89 END
91 do_check xfail.t <<END
92 $success_header
93 ${brg}# TOTAL: 1${std}
94 # PASS: 0
95 # SKIP: 0
96 ${lgn}# XFAIL: 1${std}
97 # FAIL: 0
98 # XPASS: 0
99 # ERROR: 0
100 $success_footer
103 do_check fail.t <<END
104 $failure_header
105 ${brg}# TOTAL: 1${std}
106 # PASS: 0
107 # SKIP: 0
108 # XFAIL: 0
109 ${red}# FAIL: 1${std}
110 # XPASS: 0
111 # ERROR: 0
112 $failure_footer
115 do_check xpass.t <<END
116 $failure_header
117 ${brg}# TOTAL: 1${std}
118 # PASS: 0
119 # SKIP: 0
120 # XFAIL: 0
121 # FAIL: 0
122 ${red}# XPASS: 1${std}
123 # ERROR: 0
124 $failure_footer
127 do_check error.t <<END
128 $failure_header
129 ${brg}# TOTAL: 1${std}
130 # PASS: 0
131 # SKIP: 0
132 # XFAIL: 0
133 # FAIL: 0
134 # XPASS: 0
135 ${mgn}# ERROR: 1${std}
136 $failure_footer
139 do_check pass.t xfail.t skip.t <<END
140 $success_header
141 ${brg}# TOTAL: 3${std}
142 ${grn}# PASS: 1${std}
143 ${blu}# SKIP: 1${std}
144 ${lgn}# XFAIL: 1${std}
145 # FAIL: 0
146 # XPASS: 0
147 # ERROR: 0
148 $success_footer
151 do_check pass.t fail.t skip.t <<END
152 $failure_header
153 ${brg}# TOTAL: 3${std}
154 ${grn}# PASS: 1${std}
155 ${blu}# SKIP: 1${std}
156 # XFAIL: 0
157 ${red}# FAIL: 1${std}
158 # XPASS: 0
159 # ERROR: 0
160 $failure_footer
163 do_check pass.t xfail.t xpass.t <<END
164 $failure_header
165 ${brg}# TOTAL: 3${std}
166 ${grn}# PASS: 1${std}
167 # SKIP: 0
168 ${lgn}# XFAIL: 1${std}
169 # FAIL: 0
170 ${red}# XPASS: 1${std}
171 # ERROR: 0
172 $failure_footer
175 do_check skip.t xfail.t error.t <<END
176 $failure_header
177 ${brg}# TOTAL: 3${std}
178 # PASS: 0
179 ${blu}# SKIP: 1${std}
180 ${lgn}# XFAIL: 1${std}
181 # FAIL: 0
182 # XPASS: 0
183 ${mgn}# ERROR: 1${std}
184 $failure_footer
187 do_check pass.t skip.t xfail.t fail.t xpass.t error.t <<END
188 $failure_header
189 ${brg}# TOTAL: 6${std}
190 ${grn}# PASS: 1${std}
191 ${blu}# SKIP: 1${std}
192 ${lgn}# XFAIL: 1${std}
193 ${red}# FAIL: 1${std}
194 ${red}# XPASS: 1${std}
195 ${mgn}# ERROR: 1${std}
196 $failure_footer