test defs: move in 't/ax/test-defs.sh'
[platform/upstream/automake.git] / t / testsuite-summary-color.sh
1 #! /bin/sh
2 # Copyright (C) 2011-2012 Free Software Foundation, Inc.
3 #
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.
8 #
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.
13 #
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/>.
16
17 # Check coloring of the testsuite summary.
18
19 . test-defs.sh
20
21 use_colors=yes
22 use_vpath=no
23
24 . "$am_testauxdir"/testsuite-summary-checks.sh || exit 99
25
26 ./configure
27
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';
36
37 success_header="\
38 ${grn}${br}${std}
39 ${grn}Testsuite summary for GNU AutoFoo 7.1${std}
40 ${grn}${br}${std}"
41
42 success_footer=${grn}${br}${std}
43
44 failure_header="\
45 ${red}${br}${std}
46 ${red}Testsuite summary for GNU AutoFoo 7.1${std}
47 ${red}${br}${std}"
48
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}"
54
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
66
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
78
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
90
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
101 END
102
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
113 END
114
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
125 END
126
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
137 END
138
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
149 END
150
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
161 END
162
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
173 END
174
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
185 END
186
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
197 END
198
199 :