From: Stefano Lattarini Date: Mon, 21 May 2012 20:40:34 +0000 (+0200) Subject: [ng] tests: get rid of an almost-obsolete test case (parallel-tests related) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c868a21c22ae33e037c6dcb0ec42d758d8be9d12;p=thirdparty%2Fautomake.git [ng] tests: get rid of an almost-obsolete test case (parallel-tests related) * t/posixsubst-tests.sh: Remove this test, merging the still-relevant parts of it ... * t/parallel-tests-dynamic.sh: ... in here. Since we are at it, make existing grepping checks on "make check" output slightly stricter. Signed-off-by: Stefano Lattarini --- diff --git a/t/parallel-tests-dynamic.sh b/t/parallel-tests-dynamic.sh index c8b3b8f8d..625b5f6f1 100755 --- a/t/parallel-tests-dynamic.sh +++ b/t/parallel-tests-dynamic.sh @@ -15,7 +15,7 @@ # along with this program. If not, see . # Check that dynamic content for $(TESTS) is supported, both when set from -# inside the Makefile.am and when overriddend from the command line. +# inside the Makefile.am and when overridden from the command line. . ./defs || Exit 1 @@ -31,13 +31,18 @@ cat > ko <<'END' exit 1 END +cat > sk <<'END' +#!/bin/sh +exit 77 +END + cat > er << 'END' #!/bin/sh echo $0 should not be run >&2 exit 99 END -chmod a+x ko ok +chmod a+x ko ok sk mkdir t cp ok t/nosuffix @@ -58,6 +63,9 @@ cp er t1.sh cp er t9.sh cp er tx98.sh +cp sk fu.sh +cp sk mu + cat > get-tests-list < Makefile.am << 'END' my_add_dirprefix = $(strip $(1))/$(strip $(2)) EXTRA_DIST = $(TESTS) get-tests-list TEST_EXTENSIONS = .sh -TESTS = $(wildcard $(srcdir)/t[0-9][0-9]*.sh) + +t1 = fu +t2 = mux + +# Also try an empty match suffix, to ensure that the ':=' in there is +# not confused by the parser with an immediate assignment operator. +TESTS = $(t1:=.sh) $(t2:x=) +TESTS += $(wildcard $(srcdir)/t[0-9][0-9]*.sh) TESTS += $(shell $(srcdir)/get-tests-list) TESTS += $(call my_add_dirprefix, t, nosuffix) XFAIL_TESTS = $(wildcard $(srcdir)/t9[0-9]*.sh) @@ -86,26 +101,28 @@ $AUTOMAKE -a $MAKE check > stdout || { cat stdout; Exit 1; } cat stdout -count_test_results total=11 pass=9 fail=0 xpass=0 xfail=2 skip=0 error=0 - -grep '^PASS: t/nosuffix$' stdout -grep '^PASS: g1\.sh$' stdout -grep '^PASS: g2\.sh$' stdout -grep '^PASS: g3\.sh$' stdout -grep '^PASS: g4\.sh$' stdout -grep '^PASS: t00-foo\.sh' stdout -grep '^PASS: t02\.sh' stdout -grep '^PASS: t57_mu\.sh' stdout -grep '^PASS: t7311\.sh' stdout -grep '^XFAIL: t98S\.sh' stdout -grep '^XFAIL: t99\.sh' stdout +count_test_results total=13 pass=9 fail=0 xpass=0 xfail=2 skip=2 error=0 + +grep '^PASS: t/nosuffix$' stdout +grep '^PASS: g1\.sh$' stdout +grep '^PASS: g2\.sh$' stdout +grep '^PASS: g3\.sh$' stdout +grep '^PASS: g4\.sh$' stdout +grep '^PASS: t00-foo\.sh$' stdout +grep '^PASS: t02\.sh$' stdout +grep '^PASS: t57_mu\.sh$' stdout +grep '^PASS: t7311\.sh$' stdout +grep '^XFAIL: t98S\.sh$' stdout +grep '^XFAIL: t99\.sh$' stdout +grep '^SKIP: fu\.sh$' stdout +grep '^SKIP: mu$' stdout $MAKE mostlyclean test "`find . -name *.log`" = ./config.log $MAKE distcheck > stdout || { cat stdout; Exit 1; } cat stdout -count_test_results total=11 pass=9 fail=0 xpass=0 xfail=2 skip=0 error=0 +count_test_results total=13 pass=9 fail=0 xpass=0 xfail=2 skip=2 error=0 $MAKE check tests1='$(wildcard t00*.sh t98?.sh)' \ tests2='$(shell ./get-tests-list | sed 1d)' \ diff --git a/t/posixsubst-tests.sh b/t/posixsubst-tests.sh deleted file mode 100755 index 30d283a43..000000000 --- a/t/posixsubst-tests.sh +++ /dev/null @@ -1,68 +0,0 @@ -#! /bin/sh -# Copyright (C) 2010-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 . - -# Test that POSIX variable expansion '$(var:str=rpl)' works when used -# with the TESTS special variable. - -# For gen-testsuite-part: ==> try-with-serial-tests <== -. ./defs || Exit 1 - -cat >> configure.ac << 'END' -AC_OUTPUT -END - -cat > Makefile.am << 'END' -t1 = foo1 foo2 -t2 = barx -t3 = bar2 - -foo2.test barz: - (echo '#!/bin/sh' && echo 'exit 0') > $@ && chmod a+x $@ - -# Also try an empty match suffix, to ensure that the ':=' in there is -# not confused by the parser with an unportable assignment operator. -TESTS = $(t1:=.test) $(t2:x=y) $(t3:2=z) - -EXTRA_DIST = $(TESTS) -MOSTLYCLEANFILES = *.out -END - -cat > foo1.test <<'END' -#!/bin/sh -touch foo1.out -test x"${TESTSUITE_OK-no}" = x"yes" -END -sed 's/foo1/bary/g' foo1.test > bary -chmod +x foo1.test bary - -$ACLOCAL -$AUTOCONF -$AUTOMAKE -a - -./configure -$MAKE check >out 2>&1 && { cat out; Exit 1; } -cat out -ls -l -grep '^FAIL: foo1\.test *$' out -grep '^PASS: foo2\.test *$' out -grep '^FAIL: bary *$' out -grep '^PASS: barz *$' out -test -f foo1.out -test -f bary.out - -TESTSUITE_OK=yes $MAKE distcheck - -: