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 parallel-tests features: normal and special exit statuses
18 # in the test scripts.
22 cat >> configure.ac << 'END'
26 # $failure_statuses should be defined to the list of all integers between
27 # 1 and 255 (inclusive), excluded 77 and 99.
28 failure_statuses=$(seq_ 1 255 | $EGREP -v '^(77|99)$' | tr "$nl" ' ')
30 echo "failure_statuses: $failure_statuses"
32 test $(for st in $failure_statuses; do echo $st; done | wc -l) -eq 253 \
33 || fatal_ "initializing list of exit statuses for simple failures"
35 cat > Makefile.am <<END
36 LOG_COMPILER = $AM_TEST_RUNNER_SHELL ./do-exit
37 fail_tests = $failure_statuses
38 TESTS = 0 77 99 $failure_statuses
46 [0-9]|[0-9][0-9]|[0-9][0-9][0-9]) st=$1;;
47 */[0-9]|*/[0-9][0-9]|*/[0-9][0-9][0-9]) st=${1##*/};;
62 for st in $failure_statuses; do
65 } | LC_ALL=C sort > exp-fail
67 sed 's/^FAIL:/XFAIL:/' exp-fail | LC_ALL=C sort > exp-xfail-1
68 sed '/^ERROR:/d' exp-xfail-1 > exp-xfail-2
77 $MAKE check >stdout && st=0
80 test $st -gt 0 || Exit 1
81 LC_ALL=C grep '^[A-Z][A-Z]*:' stdout | LC_ALL=C sort > got-fail
82 diff exp-fail got-fail
85 XFAIL_TESTS="$failure_statuses 99" $MAKE -e check >stdout && st=0
88 test $st -gt 0 || Exit 1
89 LC_ALL=C grep '^[A-Z][A-Z]*:' stdout | LC_ALL=C sort > got-xfail-1
90 diff exp-xfail-1 got-xfail-1
93 XFAIL_TESTS="$failure_statuses" TESTS="0 77 $failure_statuses" \
94 $MAKE -e check >stdout || st=$?
97 test $st -eq 0 || Exit 1
98 LC_ALL=C grep '^[A-Z][A-Z]*:' stdout | LC_ALL=C sort > got-xfail-2
99 diff exp-xfail-2 got-xfail-2