2 # Copyright (C) 2011-2013 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)
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 test counts in the testsuite summary, with test drivers allowing
18 # multiple test results per test script, and for a huge number of tests.
19 # Incidentally, this test also checks that the testsuite summary doesn't
20 # give any bug-report address if it's not defined.
24 for s in trivial-test-driver extract-testsuite-summary.pl; do
25 cp "$am_testaux_srcdir/$s" . || fatal_ "failed to fetch auxiliary script $s"
28 br='============================================================================'
32 Testsuite summary for $me 1.0
40 echo AC_OUTPUT >> configure.ac
42 cat > Makefile.am << 'END'
43 TEST_LOG_DRIVER = $(SHELL) $(srcdir)/trivial-test-driver
45 # Without this, the test driver will be horrendously slow.
48 cat > all.test <<'END'
50 cat results.txt || { echo ERROR: weird; exit 99; }
55 use warnings FATAL => "all";
60 TOTAL => $base * 1000,
68 my @results = qw/PASS SKIP XFAIL FAIL XPASS ERROR/;
70 open (RES, ">results.txt") or die "opening results.txt: $!\n";
71 open (CNT, ">count.txt") or die "opening count.txt: $!\n";
73 printf CNT "# %-6s %d\n", "TOTAL:", $count{TOTAL};
74 for my $res (@results)
77 print STDERR "Generating list of $res ...\n";
80 print RES "$uc_res: $_\n";
82 printf CNT "# %-6s %d\n", $res . ":", $count{$res};
86 (echo "$header" && cat count.txt && echo "$footer") > summary.exp
94 ($MAKE check || : > make.fail) | tee stdout
97 $PERL extract-testsuite-summary.pl stdout > summary.got
100 diff summary.exp summary.got || exit 1