"Fossies" - the Fresh Open Source Software Archive 
Member "automake-1.16.3/t/ax/testsuite-summary-checks.sh" (19 Nov 2020, 2848 Bytes) of package /linux/misc/automake-1.16.3.tar.xz:
As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style:
standard) with prefixed line numbers and
code folding option.
Alternatively you can here
view or
download the uninterpreted source code file.
See also the latest
Fossies "Diffs" side-by-side code changes report for "testsuite-summary-checks.sh":
1.16.2_vs_1.16.3.
1 #! /bin/sh
2 # Copyright (C) 2011-2020 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 the testsuite summary with the parallel test harness. This
18 # script is meant to be sourced by other test scripts, so that it can
19 # be used to check different scenarios (colorized and non-colorized
20 # testsuite output, packages with and without bug-report addresses,
21 # testsuites in subdirectories, ...)
22
23 . test-init.sh
24
25 case $use_colors in
26 yes)
27 AM_COLOR_TESTS=always; export AM_COLOR_TESTS
28 # Forced colorization should take place also with non-ANSI
29 # terminals; hence this setting.
30 TERM=dumb; export TERM
31 ;;
32 no)
33 ;;
34 *)
35 fatal_ "invalid use_colors='$use_colors'";;
36 esac
37
38 cat > configure.ac <<END
39 AC_INIT([GNU AutoFoo], [7.1], [bug-automake@gnu.org])
40 AM_INIT_AUTOMAKE
41 AC_CONFIG_FILES([Makefile])
42 AC_OUTPUT
43 END
44
45 cat > Makefile.am <<'END'
46 TEST_EXTENSIONS = .t
47 T_LOG_COMPILER = $(SHELL) $(srcdir)/log-compiler
48 ## Will be defined at runtime.
49 TESTS =
50 $(TESTS):
51 END
52
53 cat > log-compiler <<'END'
54 #!/bin/sh
55 case "$1" in
56 pass*|*/pass*|xpass*|*/xpass*) exit 0;;
57 fail*|*/fail*|xfail*|*/xfail*) exit 1;;
58 skip*|*/skip*) exit 77;;
59 error*|/error*) exit 99;;
60 copy*|*/copy*) cat "$1";;
61 *) exit 99;;
62 esac
63 END
64
65 # Quite complexish, but allow the tests in client scripts to be written
66 # in a "data-driven fashion".
67 do_check ()
68 {
69 cat > summary.exp
70 expect_failure=false
71 xfail_tests=''
72 tests="$*"
73 for t in $*; do
74 case $t in fail*|xpass*|error*) expect_failure=:;; esac
75 case $t in xfail*|xpass*) xfail_tests="$xfail_tests $t";; esac
76 done
77 run_make -O -e IGNORE check TESTS="$tests" XFAIL_TESTS="$xfail_tests"
78 if $expect_failure; then
79 test $am_make_rc -gt 0 || exit 1
80 else
81 test $am_make_rc -eq 0 || exit 1
82 fi
83 $PERL "$am_testaux_srcdir"/extract-testsuite-summary.pl stdout >summary.got \
84 || fatal_ "cannot extract testsuite summary"
85 cat summary.exp
86 cat summary.got
87 if test $use_colors = yes; then
88 # Use cmp, not diff, because the files might contain binary data.
89 compare=cmp
90 else
91 compare=diff
92 fi
93 $compare summary.exp summary.got || exit 1
94 }
95
96 br='============================================================================'
97
98 $ACLOCAL
99 $AUTOCONF
100 $AUTOMAKE --add-missing
101
102 :