#! /bin/sh
-# Copyright (C) 2011-2012 Free Software Foundation, Inc.
+# Copyright (C) 2011-2013 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# Check parallel-tests features: normal and special exit statuses
# in the test scripts.
-. ./defs || Exit 1
+. test-init.sh
cat >> configure.ac << 'END'
AC_OUTPUT
for st in $failure_statuses; do
echo "FAIL: $st"
done
-} | LC_ALL=C sort > exp-fail
+} | LC_ALL=C sort > exp-0
-sed 's/^FAIL:/XFAIL:/' exp-fail | LC_ALL=C sort > exp-xfail-1
-sed '/^ERROR:/d' exp-xfail-1 > exp-xfail-2
-
-sort exp-fail
-sort exp-xfail-1
-sort exp-xfail-2
+sed 's/^FAIL:/XFAIL:/' exp-0 | LC_ALL=C sort > exp-1
+sed '/^ERROR:/d' exp-1 > exp-2
./configure
-st=1
-$MAKE check >stdout && st=0
-cat stdout
-cat test-suite.log
-test $st -gt 0 || Exit 1
-LC_ALL=C grep '^[A-Z][A-Z]*:' stdout | LC_ALL=C sort > got-fail
-diff exp-fail got-fail
-
-st=1
-XFAIL_TESTS="$failure_statuses 99" $MAKE -e check >stdout && st=0
-cat stdout
-cat test-suite.log
-test $st -gt 0 || Exit 1
-LC_ALL=C grep '^[A-Z][A-Z]*:' stdout | LC_ALL=C sort > got-xfail-1
-diff exp-xfail-1 got-xfail-1
+mk_ ()
+{
+ n=$1; shift
+ unset am_make_rc
+ run_make -e IGNORE -O -- ${1+"$@"} check
+ cat test-suite.log
+ LC_ALL=C grep '^[A-Z][A-Z]*:' stdout | LC_ALL=C sort > got-$n
+ cat exp-$n
+ cat got-$n
+ diff exp-$n got-$n
+}
-st=0
-XFAIL_TESTS="$failure_statuses" TESTS="0 77 $failure_statuses" \
- $MAKE -e check >stdout || st=$?
-cat stdout
-cat test-suite.log
-test $st -eq 0 || Exit 1
-LC_ALL=C grep '^[A-Z][A-Z]*:' stdout | LC_ALL=C sort > got-xfail-2
-diff exp-xfail-2 got-xfail-2
+mk_ 0
+test $am_make_rc -gt 0
+mk_ 1 XFAIL_TESTS="$failure_statuses 99"
+test $am_make_rc -gt 0
+mk_ 2 XFAIL_TESTS="$failure_statuses" TESTS="0 77 $failure_statuses"
+test $am_make_rc -eq 0
: