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)
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.
25 for s in trivial-test-driver extract-testsuite-summary.pl; do
26 cp "$am_testauxdir/$s" . || fatal_ "failed to fetch auxiliary script $s"
29 br='============================================================================'
33 Testsuite summary for $me 1.0
41 echo AC_OUTPUT >> configure.ac
43 cat > Makefile.am << 'END'
44 TEST_LOG_DRIVER = $(SHELL) $(srcdir)/trivial-test-driver
46 # Without this, the test driver will be horrendously slow.
49 cat > all.test <<'END'
51 cat results.txt || { echo ERROR: weird; exit 99; }
56 use warnings FATAL => "all";
59 # FIXME: we would like this to be 1000 or even 10000, but the current
60 # implementation is too slow to handle that :-(
63 TOTAL => $base * 1000,
71 my @results = qw/PASS SKIP XFAIL FAIL XPASS ERROR/;
73 open (RES, ">results.txt") or die "opening results.txt: $!\n";
74 open (CNT, ">count.txt") or die "opening count.txt: $!\n";
76 printf CNT "# %-6s %d\n", "TOTAL:", $count{TOTAL};
77 for my $res (@results)
80 print STDERR "Generating list of $res ...\n";
83 print RES "$uc_res: $_\n";
85 printf CNT "# %-6s %d\n", $res . ":", $count{$res};
89 (echo "$header" && cat count.txt && echo "$footer") > summary.exp
97 ($MAKE check || : > make.fail) | tee stdout
100 $PERL extract-testsuite-summary.pl stdout > summary.got
103 diff summary.exp summary.got || Exit 1