+++ /dev/null
-#! /bin/sh
-# Copyright (C) 2011-2012 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
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-# Check that we can use indirections when overriding TESTS from
-# the command line.
-
-am_parallel_tests=yes
-. ./defs || Exit 1
-
-cat >> configure.ac << 'END'
-AC_OUTPUT
-END
-
-cat > Makefile.am << 'END'
-TEST_EXTENSIONS = .test .t
-TEST_LOG_COMPILER = cat
-T_LOG_COMPILER = cat
-TESTS = bad.test
-var1 = b.test $(var2)
-var2 = c.test
-var3 = d.d
-var4 = e
-END
-
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE -a
-
-./configure
-rm -f config.log # Do not create false positives below.
-
-cat > exp-log <<'END'
-a.log
-b.log
-c.log
-d.log
-e.log
-test-suite.log
-END
-
-cat > exp-out <<'END'
-PASS: a.t
-PASS: b.test
-PASS: c.test
-PASS: d.t
-PASS: e.test
-END
-
-do_check ()
-{
- $MAKE "$@" check >stdout || { cat stdout; Exit 1; }
- cat stdout
- grep '^PASS:' stdout | LC_ALL=C sort > got-out
- cat got-out
- ls . | grep '\.log$' | LC_ALL=C sort > got-log
- cat got-log
- st=0
- diff exp-out got-out || st=1
- diff exp-log got-log || st=1
- return $st
-}
-
-tests1='a.t $(var1) $(var3:.d=.t) $(var4:=.test)'
-tests2='a $(var1:.test=) $(var3:.d=) $(var4)'
-
-touch a.t b.test c.test d.t e.test
-
-do_check TESTS="$tests1"
-do_check TESTS="$tests2"
-
-:
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Check that dynamic content for $(TESTS) is supported.
+# Check that dynamic content for $(TESTS) is supported, both when set from
+# inside the Makefile.am and when overriddend from the command line.
am_parallel_tests=yes
. ./defs || Exit 1
$MAKE check \
foo='E9E9E' \
- TESTS='t$(subst E,,$(foo)) $(call my_add_dirprefix,t,nosuffix)' \
+ a='t00.err' \
+ b='${a:.err=-foo}' \
+ TESTS='$(b) t$(subst E,,$(foo)) $(call my_add_dirprefix,t,nosuffix)' \
> stdout || { cat stdout; Exit 1; }
cat stdout
-count_test_results total=2 pass=1 fail=0 xpass=0 xfail=1 skip=0 error=0
+count_test_results total=3 pass=2 fail=0 xpass=0 xfail=1 skip=0 error=0
grep '^PASS: t/nosuffix' stdout
+grep '^PASS: t00-foo\.sh' stdout
grep '^XFAIL: t99\.sh' stdout
:
END
# 4. A program that is also a test, but whose source files
-# do not exit and are not buildable by make.
+# do not exist and are not buildable by make.
cat >> Makefile.am <<'END'
EXTRA_PROGRAMS += none.bin
+++ /dev/null
-#! /bin/sh
-# Copyright (C) 2011-2012 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
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-# parallel-tests: runtime redefinition of $(TEST_SUITE_LOG) and $(TESTS)
-
-am_parallel_tests=yes
-. ./defs || Exit 1
-
-cat >> configure.ac <<'END'
-AC_OUTPUT
-END
-
-cat > Makefile.am <<'END'
-TESTS = pass.test pass2.test skip.test skip2.test fail.test
-END
-
-cat > pass.test <<'END'
-#! /bin/sh
-exit 0
-END
-
-cp pass.test pass2.test
-
-cat > skip.test <<'END'
-#! /bin/sh
-echo "% skipped test %"
-exit 77
-END
-
-cp skip.test skip2.test
-
-cat > fail.test <<'END'
-#! /bin/sh
-exit 1
-END
-
-chmod a+x *.test
-
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE -a
-
-./configure
-
-# Extra quoting for the sake of Solaris sh bugs.
-for test_list_override in \
- 'TESTS=pass.test skip.test' \
- 'TESTS=pass skip' \
-; do
- eval "\$MAKE TEST_SUITE_LOG=partial.log '$test_list_override'" \
- check >stdout || { cat stdout; Exit 1; }
- cat stdout
- ls -l
- count_test_results total=2 pass=1 fail=0 skip=1 xfail=0 xpass=0 error=0
- cat pass.log
- cat skip.log
- cat partial.log
- test ! -f test-suite.log
- test ! -f pass2.log
- test ! -f skip2.log
- test ! -f fail.log
- grep '^PASS: pass\.test$' stdout
- grep '^SKIP: skip\.test$' stdout
- $FGREP 'SKIP: skip' partial.log
- $FGREP '% skipped test %' partial.log
- $EGREP '(pass2|skip2|fail)\.test' stdout && Exit 1
- $EGREP '(pass2|skip2|fail)' partial.log && Exit 1
- rm -f *.log
-done
-
-:
+++ /dev/null
-#! /bin/sh
-# Copyright (C) 2011-2012 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
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-# Check parallel-tests features: runtime redefinition of $(TEST_SUITE_LOG)
-# for the recheck target.
-
-am_parallel_tests=yes
-. ./defs || Exit 1
-
-cat >> configure.ac <<'END'
-AC_OUTPUT
-END
-
-cat > Makefile.am <<'END'
-TESTS = foofoo.test barbar.test bazbaz.test
-END
-
-cat > foofoo.test <<'END'
-#! /bin/sh
-echo "this is $0"
-exit 0
-END
-
-cat > barbar.test <<'END'
-#! /bin/sh
-echo "this is $0"
-exit 99
-END
-
-cat > bazbaz.test <<'END'
-#! /bin/sh
-echo "this is $0"
-exit ${BAZ_EXIT_STATUS-1}
-END
-
-chmod a+x *.test
-
-unset BAZ_EXIT_STATUS || :
-
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE -a
-
-# Filter make output before grepping it, for make implementations that,
-# like Solaris' one, print the whole of the failed recipe on failure.
-filter_stdout ()
-{
- grep -v 'bases=.*;' stdout > t && mv -f t stdout
-}
-
-./configure
-$MAKE check >stdout && { cat stdout; Exit 1; }
-cat stdout
-
-chmod a-rw test-suite.log
-$MAKE TEST_SUITE_LOG=my.log recheck >stdout \
- && { cat stdout; Exit 1; }
-cat stdout
-ls -l
-filter_stdout
-count_test_results total=2 pass=0 fail=1 skip=0 xfail=0 xpass=0 error=1
-for x in stdout my.log; do
- $FGREP foofoo $x && Exit 1
- $FGREP barbar $x
- $FGREP bazbaz $x
-done
-
-chmod a-rw my.log
-$MAKE BAZ_EXIT_STATUS=0 TEST_SUITE_LOG=my2.log recheck >stdout \
- && { cat stdout; Exit 1; }
-cat stdout
-ls -l
-count_test_results total=2 pass=1 fail=0 skip=0 xfail=0 xpass=0 error=1
-filter_stdout
-$FGREP foofoo stdout && Exit 1
-$FGREP barbar stdout
-$FGREP bazbaz stdout
-$FGREP foofoo my2.log && Exit 1
-$FGREP barbar my2.log
-$FGREP bazbaz my2.log && Exit 1
-
-chmod u+r test-suite.log my.log
-$FGREP bazbaz test-suite.log
-$FGREP bazbaz my.log
-
-:
cp foo.test install.test
cp foo.test bad-target.test
-
cat > Makefile.am << 'END'
bad-target:
@echo $@ has been run >&2; exit 1
+++ /dev/null
-#! /bin/sh
-# Copyright (C) 2009-2012 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
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-# Check that ':test-results:' directives in test scripts' output doesn't
-# originate spurious results in the testsuite summary.
-
-am_parallel_tests=yes
-. ./defs || Exit 1
-
-cat >> configure.ac << 'END'
-AC_OUTPUT
-END
-
-cat > Makefile.am << 'END'
-TESTS = foo.test bar.test
-END
-
-cat > foo.test <<'END'
-#! /bin/sh
-echo :test-result:XFAIL
-echo :test-result: SKIP
-echo :test-result:ERROR
-exit 0
-END
-cat > bar.test <<'END'
-#! /bin/sh
-echo :test-result: ERROR
-echo :test-result:FAIL
-echo :test-result: XPASS
-exit 0
-END
-chmod a+x foo.test bar.test
-
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE -a
-
-./configure
-
-st=0
-$MAKE check >stdout || st=$?
-cat stdout
-cat test-suite.log
-cat foo.log
-cat bar.log
-test $st -eq 0 || Exit $st
-
-grep '^:test-result:XFAIL$' foo.log
-grep '^:test-result: SKIP$' foo.log
-grep '^:test-result:FAIL$' bar.log
-grep '^:test-result: XPASS$' bar.log
-
-count_test_results total=2 pass=2 fail=0 skip=0 xfail=0 xpass=0 error=0
-
-:
am_parallel_tests=yes
. ./defs || Exit 1
+
cat >> configure.ac << 'END'
AC_OUTPUT
END
. ./defs || Exit 1
cat > Makefile.am << 'END'
-# The tests are *deliberately* listed in inversed order here.
+# The tests are *deliberately* listed in inverted order here.
TESTS = c.test b.test a.test
b.log: a.log
c.log: b.log
+++ /dev/null
-#! /bin/sh
-# Copyright (C) 2011-2012 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
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-# TAP support:
-# - ':test-results:' directives in test scripts' output doesn't
-# originate spurious results in the testsuite summary
-
-am_parallel_tests=yes
-. ./defs || Exit 1
-
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
-
-cat > all.test <<'END'
-1..1
-:test-result: PASS
-:test-result: FAIL
-:test-result: XPASS
-:test-result: XFAIL
-:test-result: SKIP
-:test-result: ERROR
-:test-result: UNKNOWN
-ok 1
-END
-
-$MAKE check >stdout || { cat stdout; Exit 1; }
-cat stdout
-
-count_test_results total=1 pass=1 fail=0 xpass=0 xfail=0 skip=0 error=0
-
-for result in PASS FAIL XPASS XFAIL SKIP ERROR UNKNOWN; do
- grep "^ *:test-result: $result$" all.log
-done
-
-:
count_test_results total=256 pass=0 fail=0 xpass=0 xfail=128 skip=128 error=0
# -------------------------------------------------------- #
-# TODO ans SKIP directives aren't recognized spuriously. #
+# TODO and SKIP directives aren't recognized spuriously. #
# -------------------------------------------------------- #
cat > all.test <<'END'
# Custom test drivers: try the "recheck" functionality with test protocols
# that allow multiple testcases in a single test script. In particular,
# check that this still works when we override $(TESTS) at make runtime.
-# See also related tests 'test-driver-custom-multitest-recheck.test' and
-# 'parallel-tests-recheck-override.test'.
+# See also related tests 'test-driver-custom-multitest-recheck.test'.
am_parallel_tests=yes
. ./defs || Exit 1