Merge branch 'fix-pr13588-pax-hangs' into branch-1.13.2
[automake.git] / t / tap-no-spurious-numbers.sh
blob57c5ddcff3e150baaaab799086017745c999d748
1 #! /bin/sh
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)
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 <http://www.gnu.org/licenses/>.
17 # TAP support:
18 # - we shouldn't spuriously recognize as TAP result numbers what it
19 # not, even if it seems pretty close
21 . test-init.sh
23 . tap-setup.sh
25 cat > prefixes <<'END'
58 END
60 n=$(wc -l <prefixes)
62 # See the loop below to understand this initialization.
63 pass=$(($n * 3))
64 fail=$pass
65 skip=$(($pass - 3))
66 xfail=$skip
67 xpass=$xfail
68 error=0
69 total=$(($pass + $fail + $skip + $xfail + $xpass))
71 echo 1..$total > all.test
73 highno=1000
75 for result in 'ok' 'not ok'; do
76 for spacing in "" " " "$tab"; do
77 subst="$result &$spacing$higno"
78 sed -e "s|.*|$subst|" prefixes
79 for directive in TODO SKIP; do
80 test "$result $directive" != "not ok SKIP" || continue
81 sed -e '/^#$/d' -e "s|.*|$subst # $directive|" prefixes
82 done
83 done
84 done >> all.test
86 cat all.test # For debugging.
88 # Sanity checks.
89 grep '#.*#' all.test \
90 && framework_failure_ "creating all.test"
91 test $(wc -l <all.test) -lt $highno \
92 || framework_failure_ "creating all.test"
94 $MAKE check >stdout || :
95 cat stdout
97 count_test_results total=$total pass=$pass fail=$fail skip=$skip \
98 xpass=$xpass xfail=$xfail error=$error