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.
23 cat >> configure.ac << 'END'
27 # $failure_statuses should be defined to the list of all integers between
28 # 1 and 255 (inclusive), excluded 77 and 99.
29 failure_statuses=`seq_ 1 255 | $EGREP -v '^(77|99)$' | tr "$nl" ' '`
31 echo "failure_statuses: $failure_statuses"
33 test `for st in $failure_statuses; do echo $st; done | wc -l` -eq 253 \
34 || fatal_ "initializing list of exit statuses for simple failures"
36 cat > Makefile.am <<END
37 LOG_COMPILER = ./do-exit
38 fail_tests = $failure_statuses
39 TESTS = 0 77 99 $failure_statuses
47 [0-9]|[0-9][0-9]|[0-9][0-9][0-9]) st=$1;;
48 */[0-9]|*/[0-9][0-9]|*/[0-9][0-9][0-9]) st=`echo x"$1" | sed 's|.*/||'`;;
63 for st in $failure_statuses; do
66 } | LC_ALL=C sort > exp-fail
68 sed 's/^FAIL:/XFAIL:/' exp-fail | LC_ALL=C sort > exp-xfail-1
69 sed '/^ERROR:/d' exp-xfail-1 > exp-xfail-2
78 $MAKE check >stdout && st=0
81 test $st -gt 0 || Exit 1
82 LC_ALL=C grep '^[A-Z][A-Z]*:' stdout | LC_ALL=C sort > got-fail
83 diff exp-fail got-fail
86 XFAIL_TESTS="$failure_statuses 99" $MAKE -e check >stdout && st=0
89 test $st -gt 0 || Exit 1
90 LC_ALL=C grep '^[A-Z][A-Z]*:' stdout | LC_ALL=C sort > got-xfail-1
91 diff exp-xfail-1 got-xfail-1
94 XFAIL_TESTS="$failure_statuses" TESTS="0 77 $failure_statuses" \
95 $MAKE -e check >stdout || st=$?
98 test $st -eq 0 || Exit 1
99 LC_ALL=C grep '^[A-Z][A-Z]*:' stdout | LC_ALL=C sort > got-xfail-2
100 diff exp-xfail-2 got-xfail-2