#! /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
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# TAP support: more unusual forms for valid TAP input.
-# See also related test 'tap-fancy.test'.
+# See also related test 'tap-fancy.sh'.
-. ./defs || Exit 1
+. test-init.sh
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
#
# From manpage Test::Harness::TAP(3):
#
-# ``Lines written to standard output matching /^(not )?ok\b/ must be
+# Lines written to standard output matching /^(not )?ok\b/ must be
# interpreted as test lines. All other lines must not be considered
-# test output.''
+# test output.
#
# Unfortunately, the exact format of TODO and SKIP directives is not as
# clearly described in that manpage; but a simple reverse-engineering of
xpass=130 # = 4 * 34 - 6
skip=130 # = 4 * 34 - 6
error=0
-total=`expr $pass + $fail + $xfail + $xpass + $skip`
+total=$(($pass + $fail + $xfail + $xpass + $skip))
# Even nastier! But accordingly to the specifics, it should still work.
for result in 'ok' 'not ok'; do
echo "ok{[(<#${tab}SKIP>)]}" >> all.test
# We have to update some test counts.
-xfail=`expr $xfail + 1`
-xpass=`expr $xpass + 1`
-skip=`expr $skip + 1`
-total=`expr $total + 3`
+xfail=$(($xfail + 1))
+xpass=$(($xpass + 1))
+skip=$(($skip + 1))
+total=$(($total + 3))
# And add the test plan!
echo 1..$total >> all.test
-$MAKE check >stdout && { cat stdout; Exit 1; }
-cat stdout
+run_make -O -e FAIL check
-$EGREP '^(PASS|FAIL|SKIP).*#.*TODO' stdout && Exit 1
-$EGREP '^X?(PASS|FAIL).*#.*SKIP' stdout && Exit 1
+$EGREP '^(PASS|FAIL|SKIP).*#.*TODO' stdout && exit 1
+$EGREP '^X?(PASS|FAIL).*#.*SKIP' stdout && exit 1
count_test_results total=$total pass=$pass fail=$fail skip=$skip \
xpass=$xpass xfail=$xfail error=$error