# along with this program. If not, see <http://www.gnu.org/licenses/>.
# 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
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
cp er t9.sh
cp er tx98.sh
+cp sk fu.sh
+cp sk mu
+
cat > get-tests-list <<END
#!/bin/sh
echo "g1.sh ${tab}g2.sh "
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)
$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)' \
+++ /dev/null
-#! /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 <http://www.gnu.org/licenses/>.
-
-# 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
-
-: