1#! /bin/sh
2# Copyright (C) 2011-2021 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 <https://www.gnu.org/licenses/>.
16
17# Check test counts in the testsuite summary.
18
19. test-lib.sh
20
21use_colors=no; use_vpath=no
22. testsuite-summary-checks.sh
23
24./configure
25
26header="\
27${br}
28Testsuite summary for GNU AutoFoo 7.1
29${br}"
30
31success_footer=${br}
32
33failure_footer="\
34${br}
35See ./test-suite.log
36Please report to bug-automake@gnu.org
37${br}"
38
39# Corner cases.
40
41do_check '' <<END
42$header
43# TOTAL: 0
44# PASS:  0
45# SKIP:  0
46# XFAIL: 0
47# FAIL:  0
48# XPASS: 0
49# ERROR: 0
50$success_footer
51END
52
53do_check pass.t <<END
54$header
55# TOTAL: 1
56# PASS:  1
57# SKIP:  0
58# XFAIL: 0
59# FAIL:  0
60# XPASS: 0
61# ERROR: 0
62$success_footer
63END
64
65do_check fail.t <<END
66$header
67# TOTAL: 1
68# PASS:  0
69# SKIP:  0
70# XFAIL: 0
71# FAIL:  1
72# XPASS: 0
73# ERROR: 0
74$failure_footer
75END
76
77# Some simpler checks, with low or moderate number of tests.
78
79do_check skip.t skip2.t skip3.t xfail.t xfail2.t <<END
80$header
81# TOTAL: 5
82# PASS:  0
83# SKIP:  3
84# XFAIL: 2
85# FAIL:  0
86# XPASS: 0
87# ERROR: 0
88$success_footer
89END
90
91do_check pass.t pass2.t xfail.t xpass.t error.t error2.t <<END
92$header
93# TOTAL: 6
94# PASS:  2
95# SKIP:  0
96# XFAIL: 1
97# FAIL:  0
98# XPASS: 1
99# ERROR: 2
100$failure_footer
101END
102
103pass_count=22
104skip_count=19
105xfail_count=21
106fail_count=18
107xpass_count=23
108error_count=17
109tests_count=120
110
111 pass=$(seq_ 1 $pass_count  | sed 's/.*/pass-&.t/')
112 skip=$(seq_ 1 $skip_count  | sed 's/.*/skip-&.t/')
113xfail=$(seq_ 1 $xfail_count | sed 's/.*/xfail-&.t/')
114 fail=$(seq_ 1 $fail_count  | sed 's/.*/fail-&.t/')
115xpass=$(seq_ 1 $xpass_count | sed 's/.*/xpass-&.t/')
116error=$(seq_ 1 $error_count | sed 's/.*/error-&.t/')
117
118do_check $pass $skip $xfail $fail $xpass $error <<END
119$header
120# TOTAL: $tests_count
121# PASS:  $pass_count
122# SKIP:  $skip_count
123# XFAIL: $xfail_count
124# FAIL:  $fail_count
125# XPASS: $xpass_count
126# ERROR: $error_count
127$failure_footer
128END
129
130# Mild stress test with a lot of test scripts.
131
132tests_count=1888
133pass_count=1403
134skip_count=292
135xfail_count=41
136fail_count=126
137xpass_count=17
138error_count=9
139
140 pass=$(seq_ 1 $pass_count  | sed 's/.*/pass-&.t/')
141 skip=$(seq_ 1 $skip_count  | sed 's/.*/skip-&.t/')
142xfail=$(seq_ 1 $xfail_count | sed 's/.*/xfail-&.t/')
143 fail=$(seq_ 1 $fail_count  | sed 's/.*/fail-&.t/')
144xpass=$(seq_ 1 $xpass_count | sed 's/.*/xpass-&.t/')
145error=$(seq_ 1 $error_count | sed 's/.*/error-&.t/')
146
147do_check $pass $skip $xfail $fail $xpass $error <<END
148$header
149# TOTAL: $tests_count
150# PASS:  $pass_count
151# SKIP:  $skip_count
152# XFAIL: $xfail_count
153# FAIL:  $fail_count
154# XPASS: $xpass_count
155# ERROR: $error_count
156$failure_footer
157END
158
159:
160