From: Stefano Lattarini Date: Wed, 9 May 2012 07:13:51 +0000 (+0200) Subject: [ng] tests: remove overly picky test cases (and fix few typos) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c71a0053fe5d73777f47d8682411f844afe33973;p=thirdparty%2Fautomake.git [ng] tests: remove overly picky test cases (and fix few typos) Given the new shape of the parallel testsuite support implementation as derived from Automake 1.12 and further enhanced in recent Automake-NG commits, few tests for it have become overly picky, basically impossible to fail unless many others do as well, or the implementation is altered radically (basically being rewritten). So, to avoid having out already too slow test suite bogged down even further, we remove them. * t/parallel-tests-cmdline-override.sh: Removed, the still-relevant part of its checks moved ... * t/parallel-tests-dynamic.sh: ... in here. * t/parallel-tests-log-override-2.sh: Removed. * t/parallel-tests-log-override-recheck.sh: Likewise. * t/parallel-tests-no-spurious-summary.sh: Likewise. * t/tap-no-spurious-summary.sh: Likewise. * t/parallel-tests-log-override-1.sh: Renamed ... * t/parallel-tests-log-override.sh: ... like this, to avoid confusion. * t/parallel-tests-extra-program.sh: Fix a typo. * t/tap-todo-skip.sh: Likewise. * t/tap-deps.sh: Likewise. * t/parallel-tests-longest-stem.sh: Remove an extra empty line. * t/parallel-tests6.sh: Add a proper empty line, for better readability. Signed-off-by: Stefano Lattarini --- diff --git a/t/parallel-tests-cmdline-override.sh b/t/parallel-tests-cmdline-override.sh deleted file mode 100755 index 5dcd93ad0..000000000 --- a/t/parallel-tests-cmdline-override.sh +++ /dev/null @@ -1,84 +0,0 @@ -#! /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 . - -# 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" - -: diff --git a/t/parallel-tests-dynamic.sh b/t/parallel-tests-dynamic.sh index 68a09841f..b94fd1669 100755 --- a/t/parallel-tests-dynamic.sh +++ b/t/parallel-tests-dynamic.sh @@ -14,7 +14,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# 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 @@ -129,12 +130,15 @@ test -f t99.log $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 : diff --git a/t/parallel-tests-extra-programs.sh b/t/parallel-tests-extra-programs.sh index 8cc2df7d2..413799851 100755 --- a/t/parallel-tests-extra-programs.sh +++ b/t/parallel-tests-extra-programs.sh @@ -90,7 +90,7 @@ int main (void) 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 diff --git a/t/parallel-tests-log-override-2.sh b/t/parallel-tests-log-override-2.sh deleted file mode 100755 index ab839439f..000000000 --- a/t/parallel-tests-log-override-2.sh +++ /dev/null @@ -1,84 +0,0 @@ -#! /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 . - -# 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 - -: diff --git a/t/parallel-tests-log-override-recheck.sh b/t/parallel-tests-log-override-recheck.sh deleted file mode 100755 index 04e376877..000000000 --- a/t/parallel-tests-log-override-recheck.sh +++ /dev/null @@ -1,99 +0,0 @@ -#! /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 . - -# 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 - -: diff --git a/t/parallel-tests-log-override-1.sh b/t/parallel-tests-log-override.sh similarity index 100% rename from t/parallel-tests-log-override-1.sh rename to t/parallel-tests-log-override.sh diff --git a/t/parallel-tests-longest-stem.sh b/t/parallel-tests-longest-stem.sh index 242d78fd6..d93685d54 100755 --- a/t/parallel-tests-longest-stem.sh +++ b/t/parallel-tests-longest-stem.sh @@ -40,7 +40,6 @@ cp foo.test dist.test cp foo.test install.test cp foo.test bad-target.test - cat > Makefile.am << 'END' bad-target: @echo $@ has been run >&2; exit 1 diff --git a/t/parallel-tests-no-spurious-summary.sh b/t/parallel-tests-no-spurious-summary.sh deleted file mode 100755 index 62b4ef64c..000000000 --- a/t/parallel-tests-no-spurious-summary.sh +++ /dev/null @@ -1,68 +0,0 @@ -#! /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 . - -# 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 - -: diff --git a/t/parallel-tests6.sh b/t/parallel-tests6.sh index 60032952f..76ba5962e 100755 --- a/t/parallel-tests6.sh +++ b/t/parallel-tests6.sh @@ -20,6 +20,7 @@ am_parallel_tests=yes . ./defs || Exit 1 + cat >> configure.ac << 'END' AC_OUTPUT END diff --git a/t/tap-deps.sh b/t/tap-deps.sh index 5049171d5..9295257e4 100755 --- a/t/tap-deps.sh +++ b/t/tap-deps.sh @@ -21,7 +21,7 @@ am_parallel_tests=yes . ./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 diff --git a/t/tap-no-spurious-summary.sh b/t/tap-no-spurious-summary.sh deleted file mode 100755 index 8da15e8c3..000000000 --- a/t/tap-no-spurious-summary.sh +++ /dev/null @@ -1,47 +0,0 @@ -#! /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 . - -# 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 - -: diff --git a/t/tap-todo-skip.sh b/t/tap-todo-skip.sh index e261d5790..87bf12b39 100755 --- a/t/tap-todo-skip.sh +++ b/t/tap-todo-skip.sh @@ -67,7 +67,7 @@ cat stdout 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' diff --git a/t/test-driver-custom-multitest-recheck2.sh b/t/test-driver-custom-multitest-recheck2.sh index 1387f129e..9eb8f8d37 100755 --- a/t/test-driver-custom-multitest-recheck2.sh +++ b/t/test-driver-custom-multitest-recheck2.sh @@ -17,8 +17,7 @@ # 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