automake-ng
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Automake-NG] [PATCH 09/11] [ng] tests: remove overly picky test cases (


From: Stefano Lattarini
Subject: [Automake-NG] [PATCH 09/11] [ng] tests: remove overly picky test cases (and fix few typos)
Date: Wed, 9 May 2012 11:30:14 +0200

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 <address@hidden>
---
 t/parallel-tests-cmdline-override.sh               |   84 -----------------
 t/parallel-tests-dynamic.sh                        |   10 +-
 t/parallel-tests-extra-programs.sh                 |    2 +-
 t/parallel-tests-log-override-2.sh                 |   84 -----------------
 t/parallel-tests-log-override-recheck.sh           |   99 --------------------
 ...verride-1.sh => parallel-tests-log-override.sh} |    0
 t/parallel-tests-longest-stem.sh                   |    1 -
 t/parallel-tests-no-spurious-summary.sh            |   68 --------------
 t/parallel-tests6.sh                               |    1 +
 t/tap-deps.sh                                      |    2 +-
 t/tap-no-spurious-summary.sh                       |   47 ----------
 t/tap-todo-skip.sh                                 |    2 +-
 t/test-driver-custom-multitest-recheck2.sh         |    3 +-
 13 files changed, 12 insertions(+), 391 deletions(-)
 delete mode 100755 t/parallel-tests-cmdline-override.sh
 delete mode 100755 t/parallel-tests-log-override-2.sh
 delete mode 100755 t/parallel-tests-log-override-recheck.sh
 rename t/{parallel-tests-log-override-1.sh => parallel-tests-log-override.sh} 
(100%)
 delete mode 100755 t/parallel-tests-no-spurious-summary.sh
 delete mode 100755 t/tap-no-spurious-summary.sh

diff --git a/t/parallel-tests-cmdline-override.sh 
b/t/parallel-tests-cmdline-override.sh
deleted file mode 100755
index 5dcd93a..0000000
--- 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 <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"
-
-:
diff --git a/t/parallel-tests-dynamic.sh b/t/parallel-tests-dynamic.sh
index 68a0984..b94fd16 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 <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
@@ -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 8cc2df7..4137998 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 ab83943..0000000
--- 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 <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
-
-:
diff --git a/t/parallel-tests-log-override-recheck.sh 
b/t/parallel-tests-log-override-recheck.sh
deleted file mode 100755
index 04e3768..0000000
--- 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 <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
-
-:
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 242d78f..d93685d 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 62b4ef6..0000000
--- 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 <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
-
-:
diff --git a/t/parallel-tests6.sh b/t/parallel-tests6.sh
index 6003295..76ba596 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 5049171..9295257 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 8da15e8..0000000
--- 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 <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
-
-:
diff --git a/t/tap-todo-skip.sh b/t/tap-todo-skip.sh
index e261d57..87bf12b 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 1387f12..9eb8f8d 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
-- 
1.7.9.5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]