doc: typos in test file.
[automake.git] / t / testsuite-summary-header.sh
blob7a50b63285bb8ed32ee7b76f0b41fba260ff2e6a
1 #! /bin/sh
2 # Copyright (C) 2011-2024 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 <https://www.gnu.org/licenses/>.
17 # Check that we can override the "Testsuite summary" header line,
18 # per bug#11745.
20 . test-lib.sh
22 use_colors=no; use_vpath=no
23 . testsuite-summary-checks.sh
25 ./configure
27 # Cut down from do_check in ax/testsuite-summary-checks.sh
28 # so that we can pass a make variable setting in $1.
30 do_header_check ()
32 cat > summary.exp
33 run_make -O -e IGNORE check "$1"
34 test $am_make_rc -eq 0 || exit 1
35 $PERL "$am_testaux_srcdir"/extract-testsuite-summary.pl stdout >summary.got \
36 || fatal_ "cannot extract testsuite summary"
37 cat summary.exp
38 cat summary.got
39 compare=diff
40 $compare summary.exp summary.got || exit 1
43 # We don't actually run any tests, only interested in the header line.
44 results="\
45 # TOTAL: 0
46 # PASS: 0
47 # SKIP: 0
48 # XFAIL: 0
49 # FAIL: 0
50 # XPASS: 0
51 # ERROR: 0"
53 success_footer=${br}
55 # Check the default.
56 header="\
57 ${br}
58 Testsuite summary for GNU AutoFoo 7.1
59 ${br}"
61 do_header_check 'junkvar=junkval' <<END
62 $header
63 $results
64 $success_footer
65 END
67 # Elide the "for $(PACKAGE_STRING)".
68 header_min="\
69 ${br}
70 Testsuite summary
71 ${br}"
73 do_header_check 'AM_TESTSUITE_SUMMARY_HEADER=""' <<END
74 $header_min
75 $results
76 $success_footer
77 END
79 # Add a suffix.
80 header_more="\
81 ${br}
82 Testsuite summary for GNU AutoFoo 7.1 (hi)
83 ${br}"
85 do_header_check 'AM_TESTSUITE_SUMMARY_HEADER=" for $(PACKAGE_STRING) (hi)"' <<END
86 $header_more
87 $results
88 $success_footer
89 END