+2011-05-18 Stefano Lattarini <stefano.lattarini@gmail.com>
+
+ tests: avoid spurious failures in cross-compile mode
+ * tests/depcomp2.test: Ensure verbose printing of captured stderr
+ from configure.
+ * tests/ansi3.test ($required): Add 'non-cross', as the ansi2knr
+ functionality is not meant to work with a cross-compiler.
+ * tests/ansi3b.test: Likewise.
+ * tests/ansi5.test: Likewise.
+ * tests/ansi6.test: Likewise.
+ * tests/ansi7.test: Likewise.
+ * tests/ansi8.test: Likewise.
+ * tests/ansi10.test: Likewise.
+ * tests/subobj3.test: Likewise.
+ * tests/check8.test ($required): Add 'non-cross', as this test
+ is not meant to work with a cross-compiler.
+ * tests/gnits2.test: Likewise.
+ * tests/ltconv.test: Likewise.
+ * tests/ltcond2.test: Likewise.
+ * tests/parallel-tests5.test: Likewise.
+ * tests/specflg7.test: Likewise.
+ * tests/specflg8.test: Likewise.
+ * tests/check5.test: Likewise. Also, ensure verbose printing of
+ captured make output, and thrown in few cosmetic and consistency
+ improvements.
+ * tests/ltinit.test: Be laxer in grepping configure output, to
+ avoid spurious failures on systems which lack POSIX dynamic
+ linking (e.g., MinGW), or when cross-compiling for such systems.
+ * tests/ansi9.test: Skip parts of the test that would require a
+ native compiler.
+ * tests/backcompat6.test: Likewise.
+ * tests/depcomp8a.test: Likewise.
+ * tests/pr401.test: Likewise.
+ * tests/pr401b.test: Likewise.
+ * tests/pr401c.test: Likewise.
+ * tests/target-cflags.test: Likewise.
+ * tests/lex3.test: Likewise.
+ * tests/yacc-basic.test: Likewise.
+ * tests/autohdr4.test: Likewise. Also, extend the test to ensure
+ more coverage in cross-compile mode.
+ * tests/canon7.test: Likewise.
+ * tests/check9.test: Removed, split into two new tests ...
+ * tests/check-subst-prog.test: ... this one, which requires a
+ native C compiler ...
+ * tests/check-subst.test: ... and this one, which doesn't require
+ any compiler.
+ * tests/parallel-tests4.test: Removed, split into two new tests ...
+ * tests/parallel-tests-suffix-prog.test: ... this one, which
+ requires a native C compiler ...
+ * tests/parallel-tests-suffix.test: ... and this one, which
+ doesn't require any compiler.
+ * tests/parallel-tests7.test: Removed, split into two new tests ...
+ * tests/parallel-tests-ext-driver-prog.test: ... this one, which
+ requires a native C compiler ...
+ * tests/parallel-tests-ext-driver.test: ... and this one, which
+ doesn't require any compiler.
+ * tests/Makefile.am (TESTS): Update.
+
2011-05-19 Stefano Lattarini <stefano.lattarini@gmail.com>
test defs: rename requirement 'non-cross' -> 'native'
check6.test \
check7.test \
check8.test \
-check9.test \
check10.test \
check11.test \
check12.test \
+check-subst.test \
+check-subst-prog.test \
check-exported-srcdir.test \
check-tests-in-builddir.test \
check-tests_environment.test \
parallel-tests.test \
parallel-tests2.test \
parallel-tests3.test \
-parallel-tests4.test \
parallel-tests5.test \
parallel-tests6.test \
-parallel-tests7.test \
parallel-tests8.test \
parallel-tests9.test \
parallel-tests10.test \
+parallel-tests-suffix.test \
+parallel-tests-suffix-prog.test \
+parallel-tests-ext-driver.test \
+parallel-tests-ext-driver-prog.test \
parallel-tests-am_tests_environment.test \
parallel-tests-unreadable-log.test \
parallel-tests-subdir.test \
yacc-dist-nobuild-subdir.test txinfo5.test \
$(instspc_xfail_tests)
parallel_tests = backcompat5-p.test check-exported-srcdir-p.test \
+ check-subst-prog-p.test check-subst-p.test \
check-tests-in-builddir-p.test check-tests_environment-p.test \
check-p.test check10-p.test check11-p.test check12-p.test \
check2-p.test check3-p.test check4-p.test check5-p.test \
- check6-p.test check7-p.test check8-p.test check9-p.test \
- color-p.test color2-p.test comment9-p.test dejagnu-p.test \
- exeext4-p.test maken3-p.test maken4-p.test \
- posixsubst-tests-p.test pr401-p.test pr401b-p.test \
- pr401c-p.test
+ check6-p.test check7-p.test check8-p.test color-p.test \
+ color2-p.test comment9-p.test dejagnu-p.test exeext4-p.test \
+ maken3-p.test maken4-p.test posixsubst-tests-p.test \
+ pr401-p.test pr401b-p.test pr401c-p.test
instspc_tests = build-squote.instspc install-squote.instspc \
build-dquote.instspc install-dquote.instspc \
build-bquote.instspc install-bquote.instspc \
check6.test \
check7.test \
check8.test \
-check9.test \
check10.test \
check11.test \
check12.test \
+check-subst.test \
+check-subst-prog.test \
check-exported-srcdir.test \
check-tests-in-builddir.test \
check-tests_environment.test \
parallel-tests.test \
parallel-tests2.test \
parallel-tests3.test \
-parallel-tests4.test \
parallel-tests5.test \
parallel-tests6.test \
-parallel-tests7.test \
parallel-tests8.test \
parallel-tests9.test \
parallel-tests10.test \
+parallel-tests-suffix.test \
+parallel-tests-suffix-prog.test \
+parallel-tests-ext-driver.test \
+parallel-tests-ext-driver-prog.test \
parallel-tests-am_tests_environment.test \
parallel-tests-unreadable-log.test \
parallel-tests-subdir.test \
backcompat5-p.log: backcompat5.test
check-exported-srcdir-p.log: check-exported-srcdir.test
+check-subst-prog-p.log: check-subst-prog.test
+check-subst-p.log: check-subst.test
check-tests-in-builddir-p.log: check-tests-in-builddir.test
check-tests_environment-p.log: check-tests_environment.test
check-p.log: check.test
check6-p.log: check6.test
check7-p.log: check7.test
check8-p.log: check8.test
-check9-p.log: check9.test
color-p.log: color.test
color2-p.log: color2.test
comment9-p.log: comment9.test
# Make sure ansi2knr works with $(LIBOBJS).
+required=native
. ./defs || Exit 1
cat >> configure.in << 'END'
# Actual test of ansi2knr functionality.
+required=native
. ./defs || Exit 1
cat >> configure.in << 'END'
# of working gcc. Same as ansi3.test, but with AUTOMAKE_OPTIONS
# defined in configure.in.
+required=native
. ./defs || Exit 1
cat > configure.in << 'END'
# Test for ansi2knr in another directory.
+required=native
. ./defs || Exit 1
cat > configure.in << 'END'
# Check ansi2knr on a source file in subdirectory.
# From Kevin Ryde.
+required=native
. ./defs || Exit 1
cat > configure.in << 'END'
# ansi6.test is the same test without subdir-objects.
# From Kevin Ryde.
+required=native
. ./defs || Exit 1
cat > configure.in << 'END'
# The following rule should not exist, because the
# default .o.c: inference rule is enough.
$FGREP 'sub/sub$U.o: sub/sub$U.c' Makefile.in && Exit 1
-# Force ansi2knr's use, regardless of the compiler.
-./configure ac_cv_prog_cc_stdc=no
-$MAKE sub/sub_.c
+
+if cross_compiling; then
+ :
+else
+ # Force ansi2knr's use, regardless of the compiler.
+ ./configure ac_cv_prog_cc_stdc=no
+ $MAKE sub/sub_.c
+fi
+
+:
: > sub1/config.top
echo '#define NAME "grepme1"' >sub2/config.bot
-echo SUBDIRS = sub3 >Makefile.am
-echo noinst_PROGRAMS = run >sub3/Makefile.am
+
+cat > Makefile.am <<'END'
+SUBDIRS = sub3
+.PHONY: test-prog-updated
+test-prog-updated:
+ stat older sub3/run$(EXEEXT) || : For debugging.
+ test `ls -t older sub3/run$(EXEEXT) | sed 1q` = sub3/run$(EXEEXT)
+END
+
+cat > sub3/Makefile.am <<'END'
+noinst_PROGRAMS = run
+END
cat >sub3/run.c <<'EOF'
#include <defs.h>
# Do not reject slow dependency extractors: we need dependency tracking.
./configure --enable-dependency-tracking
$MAKE
-sub3/run | grep grepme1
+# Sanity check.
+cross_compiling || { sub3/run | grep grepme1; }
+: > older
$sleep
echo '#define NAME "grepme2"' > sub2/config.bot
$MAKE
-sub3/run | grep grepme2
+cross_compiling || { sub3/run | grep grepme2; }
+$MAKE test-prog-updated
$MAKE distcheck
# Backward-compatibility test: try to build and distribute a package
# using obsoleted forms of AC_INIT, AM_INIT_AUTOMAKE and AC_OUTPUT.
-# This script can also serve as mild stress-testing for Automke.
+# This script can also serve as mild stress-testing for Automake.
# See also the similar test `backcompat5.test'.
. ./defs || Exit 1
AC_SUBST(three)
AC_PROG_CC
AC_CONFIG_HEADERS(config.h:config.hin)
+AM_CONDITIONAL(CROSS_COMPILING, test "$cross_compiling" = yes)
AC_OUTPUT(Makefile foo.got:foo1.in:foo2.in:foo3.in)
END
check-local:
test x'$(PACKAGE)' = x'nonesuch-zardoz'
test x'$(VERSION)' = x'nonesuch-0.1'
+if ! CROSS_COMPILING
./foo
## Do not anchor the regexps w.r.t. the end of line, because on
## MinGW/MSYS, grep may assume LF line endings only, while our
## `foo' program may generate CRLF line endings.
./foo | grep '^PACKAGE = nonesuch-zardoz!'
./foo | echo '^VERSION = nonesuch-0\.1!'
+endif
END
cat > quux.c <<'END'
AC_PROG_CC
AC_PROG_RANLIB dnl: for static libraries
AC_PROG_LIBTOOL dnl: for libtool libraries
+AM_CONDITIONAL([CROSS_COMPILING], [test "$cross_compiling" = yes])
AC_OUTPUT
END
check-local:
ls -l
+if CROSS_COMPILING
+ test -f ./,foo-bar$(EXEEXT)
+ test -f ./dummy_static$(EXEEXT)
+ test -f ./dummy_dynamic$(EXEEXT)
+else !CROSS_COMPILING
./,foo-bar
./dummy_static
./dummy_dynamic
./,foo-bar | grep 'Hello, FooBar!'
./dummy_static | grep 'Hello from Static!'
./dummy_dynamic | grep 'Hello from Dynamic!'
+endif !CROSS_COMPILING
END
cat > foobar.c << 'END'
# 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 @substituted@ TESTS.
-# Note that in this test, we rely on the .test extension for the
-# substituted names: this is necessary for parallel-tests.
+# Check @substituted@ TESTS, some of which are also PROGRAMS.
+# See also sister test `check-subst.test'.
+required=native
. ./defs || Exit 1
cat >> configure.in << 'END'
EXTRA_PROGRAMS = subst-pass-prog.test subst-xfail-prog.test
END
-cat >>pass-script.test <<'END'
+cat > pass-script.test <<'END'
#! /bin/sh
exit 0
END
-cat >>xfail-script.test <<'END'
+cat > xfail-script.test <<'END'
#! /bin/sh
exit 1
END
cp pass-script.test subst-pass-script.test
cp xfail-script.test subst-xfail-script.test
-cat >>pass-prog.c <<'END'
+cat > pass-prog.c <<'END'
int main() { return 0; }
END
-cat >>xfail-prog.c <<'END'
+cat > xfail-prog.c <<'END'
#include <stdlib.h>
int main() { return EXIT_FAILURE; }
END
$MAKE all
$MAKE check
$MAKE distclean
+
:
--- /dev/null
+#! /bin/sh
+# Copyright (C) 2008, 2009, 2010, 2011 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 @substituted@ TESTS.
+# Note that in this test, we rely on the .test extension for the
+# substituted names: this is necessary for parallel-tests.
+# See also sister test `check-subst-prog.test'.
+
+. ./defs || Exit 1
+
+cat >> configure.in << 'END'
+AC_SUBST([script_tests], ['subst-pass-script.sh subst-xfail-script.sh'])
+AC_SUBST([xfail_tests], ['xfail-script.test subst-xfail-script.sh'])
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+TESTS = pass-script.test xfail-script.test @script_tests@
+XFAIL_TESTS = @xfail_tests@
+END
+
+if test "$parallel_tests" = yes; then
+ unindent >> Makefile.am <<'END'
+ TEST_EXTENSIONS = .sh .test
+ SH_LOG_COMPILER = $(SHELL)
+END
+fi
+
+cat > pass-script.test <<'END'
+#! /bin/sh
+exit 0
+END
+cat > xfail-script.test <<'END'
+#! /bin/sh
+exit 1
+END
+cp pass-script.test subst-pass-script.sh
+cp xfail-script.test subst-xfail-script.sh
+chmod a+x pass-script.test xfail-script.test
+
+if test "$parallel_tests" != yes; then
+ chmod a+x subst-pass-script.sh subst-xfail-script.sh
+fi
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+
+for vpath in false : ; do
+
+ if $vpath; then
+ mkdir build
+ cd build
+ srcdir=..
+ else
+ srcdir=.
+ fi
+
+ $srcdir/configure
+ $MAKE all
+ $MAKE check
+ if test "$parallel_tests" = yes; then
+ ls -l
+ test -f pass-script.log
+ test -f xfail-script.log
+ test -f subst-pass-script.log
+ test -f subst-xfail-script.log
+ fi
+ $MAKE distclean
+ cd $srcdir
+
+done
+
+:
# Test TESTS = $(check_PROGRAMS)
+required=native
. ./defs || Exit 1
cat >> configure.in << 'END'
test -f one$(EXEEXT)
test -f two$(EXEEXT)
touch ok
+.PHONY: print-tests
print-tests:
echo BEG: $(TESTS) :END
END
$AUTOCONF
$AUTOMAKE -a
-cat >one.c <<END
-int main() { return 0; }
+cat > one.c << 'END'
+int main (void)
+{
+ return 0;
+}
END
cp one.c two.c
./configure
$MAKE check
test -f ok
-EXEEXT=.bin $MAKE -e print-tests >output
-cat output
+EXEEXT=.bin $MAKE -e print-tests >stdout || { cat stdout; Exit 1; }
+cat stdout
+$FGREP 'BEG: one.bin two.bin :END' stdout
# No am__EXEEXT_* variable is needed.
grep '_EXEEXT_[1-9]' Makefile.in && Exit 1
-grep 'BEG: one.bin two.bin :END' output
$FGREP 'TESTS = $(check_PROGRAMS)' Makefile.in
+
+:
# Check subdir TESTS.
+required=native
. ./defs || Exit 1
cat >> configure.in << 'END'
grep '^[^X]*PASS.*sub/bar' stdout
grep '^[^X]*FAIL.*baz' stdout
grep 'XFAIL.*sub/baz' stdout
+
:
$AUTOMAKE --add-missing
$AUTOCONF
./configure 2>stderr || { cat stderr >&2; Exit 1; }
+cat stderr >&2
test ! -s stderr
:
# Don't reject slower dependency extractors, for better coverage.
./configure --enable-dependency-tracking
$MAKE
-./zardoz
+cross_compiling || ./zardoz
$MAKE DISTCHECK_CONFIGURE_FLAGS='--enable-dependency-tracking' distcheck
# Try again with subdir-objects option.
# Don't reject slower dependency extractors, for better coverage.
./configure --enable-dependency-tracking
$MAKE
-./zardoz
+cross_compiling || ./zardoz
$MAKE DISTCHECK_CONFIGURE_FLAGS='--enable-dependency-tracking' distcheck
:
# Test to ensure std-options checking is correct.
+required=native
. ./defs || Exit 1
cat >> configure.in << 'END'
# Program should build and run.
$MAKE
-echo GOOD | ./foo
-echo BAD | ./foo && Exit 1
+if cross_compiling; then :; else
+ echo GOOD | ./foo
+ echo BAD | ./foo && Exit 1
+fi
# The generated file `foo.c' must be shipped.
$MAKE distdir
# Test for bug in conditionals.
-required=libtoolize
+required='native libtoolize'
. ./defs || Exit 1
cat >> configure.in << 'END'
# Test for libtool convenience libraries.
# This example is taken from the manual.
-required=libtoolize
+required='native libtoolize'
. ./defs || Exit 1
cat >>configure.in <<'END'
cwd=`pwd`
./configure --prefix="$cwd/inst" >stdout || { cat stdout; Exit 1; }
cat stdout
-grep '^checking.*dlopen' stdout
+grep '^checking.*dlfcn\.h.* no$' stdout || grep '^checking.*dlopen' stdout
$MAKE
$MAKE install
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Check parallel-tests features:
-# - per-extension test drivers
+# - per-extension test drivers (xxx_LOG_COMPILER and xxx_LOG_FLAGS),
+# when some tests are PROGRAMS.
+# See also related test 'parallel-tests-ext-driver.test'.
parallel_tests=yes
+required=native
. ./defs || Exit 1
+
cat >> configure.in << 'END'
AC_PROG_CC
AC_OUTPUT
$AUTOMAKE -a
./configure
-$MAKE
-$MAKE check
-grep 'chk-driver *1 *2' foo.log
-grep 'test-driver *3 *4' bar.log
-grep 'noext-driver *5 *6' baz.log
-grep 'test-driver *3 *4' bla.log
-grep 'noext-driver *5 *6' bli.suff.log
-grep 'noext-driver *5 *6' sub/test.log
+$MAKE check || { cat test-suite.log; Exit 1; }
+ls -l . sub
+cat test-suite.log
+grep 'chk-driver *1 *2 ' foo.log
+grep 'test-driver *3 *4 ' bar.log
+grep 'noext-driver *5 *6 ' baz.log
+grep 'test-driver *3 *4 ' bla.log
+grep 'noext-driver *5 *6 ' bli.suff.log
+grep 'noext-driver *5 *6 ' sub/test.log
+
:
--- /dev/null
+#! /bin/sh
+# Copyright (C) 2009, 2010, 2011 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:
+# - per-extension test drivers (xxx_LOG_COMPILER and xxx_LOG_FLAGS),
+# also with AC_SUBST'd stuff.
+# See also related test 'parallel-tests-ext-driver-prog.test'
+
+parallel_tests=yes
+. ./defs || Exit 1
+
+cat >> configure.in << 'END'
+AC_SUBST([acsubst_driver], [t-driver])
+AC_CONFIG_LINKS([chk-driver:chk-driver])
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+# Note that automake should not match the '/test' part of 'sub/test'
+# as '.test' suffix.
+TESTS = foo.chk bar.test baz bla.t bli.suff sub/test
+
+TEST_EXTENSIONS = .chk .test .t
+
+CHK_LOG_COMPILER = CHK=ok; export CHK; ./chk-driver
+TEST_LOG_COMPILER = CHK=ok $(SHELL) $(srcdir)/test-driver
+T_LOG_COMPILER = @acsubst_driver@
+LOG_COMPILER = @SHELL@ -x $(srcdir)/noext-driver
+
+CHK_LOG_FLAGS = --chk
+
+AM_TEST_LOG_FLAGS = --am-test
+
+T_LOG_FLAGS = --t
+AM_T_LOG_FLAGS = --am-t
+
+AM_LOG_FLAGS = -a
+LOG_FLAGS = -b
+
+# t-driver is deliberately not distributed; it should be available
+# in PATH also from "make distcheck".
+EXTRA_DIST = $(TESTS) chk-driver test-driver noext-driver
+END
+
+unset CHK || :
+
+mkdir sub
+
+cat > chk-driver <<'END'
+#! /bin/sh
+test x"$1" = x"--chk" || {
+ echo "$0: invalid command line: $*" >&2
+ exit 1
+}
+test x"$CHK" = x"ok" || {
+ echo "$0: bad \$CHK value '$CHK'" >&2
+ exit 1
+}
+shift
+exec "$@"
+exit 127
+END
+sed 's/--chk/--am-test/' chk-driver > test-driver
+
+mkdir bin
+PATH=`pwd`/bin$PATH_SEPARATOR$PATH; export PATH
+
+cat > bin/t-driver <<'END'
+#! /bin/sh
+if test x"$1,$2" != x"--am-t,--t"; then
+ echo "$0: invalid command line: $*" >&2
+ exit 1
+fi
+if test x${CHK+"set"} = x"set"; then
+ echo "$0: $CHK is set in the environment" >&2
+ exit 1
+fi
+shift; shift
+exec "$@"
+exit 127
+END
+sed 's/--am-t,--t/-a,-b/' bin/t-driver > noext-driver
+
+chmod a+x chk-driver chk-driver test-driver bin/t-driver noext-driver
+
+cat >foo.chk << 'END'
+#! /bin/sh
+exit 0
+END
+chmod a+x foo.chk
+cp foo.chk bar.test
+cp foo.chk baz
+cp foo.chk bla.t
+cp foo.chk bli.suff
+cp foo.chk sub/test
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+
+./configure
+$MAKE check || { cat test-suite.log; Exit 1; }
+ls -l . sub
+cat test-suite.log
+test -f foo.log
+test -f bar.log
+test -f baz.log
+test -f bla.log
+test -f bli.suff.log
+test -f sub/test.log
+
+T_LOG_FLAGS=--bad $MAKE -e check && Exit 1
+cat test-suite.log
+cat bla.log
+# With the above flag overridden, bla.t should fail ...
+$EGREP '(^ *|/)t-driver:.* invalid .*--bad' bla.log
+# ... but no oher test should.
+grep -v '^FAIL: bla\.t ' bla.log | grep 'FAIL:' && Exit 1
+
+# Try also with a VPATH build.
+$MAKE distcheck
+
+:
--- /dev/null
+#! /bin/sh
+# Copyright (C) 2009, 2010, 2011 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:
+# - suffix rules, with PROGRAMS involved
+# See also sister test 'parallel-tests-suffix.test'.
+
+parallel_tests=yes
+required=native
+. ./defs || Exit 1
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+## Note that automake should not match the '/test' part of 'sub/test' as
+## '.test' suffix, nor the '/chk' part of 'sub/chk' as '.chk' suffix.
+TESTS = $(dist_TESTS) $(check_PROGRAMS)
+dist_TESTS = foo.chk bar.test sub/test
+check_PROGRAMS = baz bla.test bli.suff sub/chk
+TEST_EXTENSIONS = .chk .test
+EXTRA_DIST = $(dist_TESTS)
+END
+
+mkdir sub
+
+cat >foo.chk << 'END'
+#! /bin/sh
+exit 0
+END
+chmod a+x foo.chk
+cp foo.chk bar.test
+cp foo.chk sub/test
+
+cat >baz.c << 'END'
+int main (void)
+{
+ return 0;
+}
+END
+cp baz.c bla.c
+cp baz.c bli.c
+cp baz.c sub/chk.c
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+
+./configure
+$MAKE check
+ls -l . sub
+test -f foo.log
+test -f bar.log
+test -f baz.log
+test -f bla.log
+test -f bli.suff.log
+test -f sub/chk.log
+test -f sub/test.log
+
+$MAKE distcheck
+
+:
# Check parallel-tests features:
# - suffix rules
+# See also sister test 'parallel-tests-suffix-prog.test'.
parallel_tests=yes
. ./defs || Exit 1
+
cat >> configure.in << 'END'
-AC_PROG_CC
AC_OUTPUT
END
cat > Makefile.am << 'END'
## Note that automake should not match the '/test' part
## of 'sub/test' as '.test' suffix.
-TESTS = foo.chk bar.test $(check_PROGRAMS) sub/test
-check_PROGRAMS = baz bla.test bli.suff
+TESTS = foo.chk bar.test baz bli.suff sub/test
TEST_EXTENSIONS = .chk .test
+EXTRA_DIST = $(TESTS)
END
mkdir sub
END
chmod a+x foo.chk
cp foo.chk bar.test
+cp foo.chk baz
+cp foo.chk bli.suff
cp foo.chk sub/test
-cat >baz.c << 'END'
-int main (void)
-{
- return 0;
-}
-END
-cp baz.c bla.c
-cp baz.c bli.c
-
$ACLOCAL
$AUTOCONF
$AUTOMAKE -a
./configure
-$MAKE
$MAKE check
+ls -l . sub
test -f foo.log
test -f bar.log
test -f baz.log
-test -f bla.log
test -f bli.suff.log
test -f sub/test.log
+
+$MAKE distcheck
+
:
# It merely serves as demonstration. :-)
parallel_tests=yes
-required=GNUmake
+required='native GNUmake'
. ./defs || Exit 1
cat >> configure.in << 'END'
./configure
$MAKE -j4 check
$MAKE distcheck
+
:
AC_LIBSOURCE([feep.c])
AC_PROG_RANLIB
AC_CONFIG_FILES([lib/Makefile src/Makefile])
+AM_CONDITIONAL([CROSS_COMPILING], [test $cross_compiling = yes])
AC_OUTPUT
EOF
check_PROGRAMS = main
main_LDADD = ../lib/libfeep.a
+if !CROSS_COMPILING
TESTS = main
+endif
EOF
$ACLOCAL
check_PROGRAMS = main
main_LDADD = libfeep.a
+if !CROSS_COMPILING
TESTS = main
+endif
EOF
$ACLOCAL
src_main_SOURCES = src/main.c
src_main_LDADD = lib/libfeep.a
+if !CROSS_COMPILING
TESTS = src/main
+endif
check-local:
test -f src/main.$(OBJEXT)
AC_LIBSOURCE([feep.c])
AC_PROG_LIBTOOL
AC_CONFIG_FILES([lib/Makefile src/Makefile])
+AM_CONDITIONAL([CROSS_COMPILING], [test $cross_compiling = yes])
AC_OUTPUT
EOF
check_PROGRAMS = main
main_LDADD = ../lib/libfeep.la
+if !CROSS_COMPILING
TESTS = main
+endif
EOF
libtoolize
check_PROGRAMS = main
main_LDADD = libfeep.la
+if !CROSS_COMPILING
TESTS = main
+endif
EOF
$ACLOCAL
src_main_SOURCES = src/main.c
src_main_LDADD = lib/libfeep.la
+if !CROSS_COMPILING
TESTS = src/main
+endif
check-local:
test -f src/main.$(OBJEXT)
AC_PROG_RANLIB
AC_FUNC_ALLOCA
AC_CONFIG_FILES([lib/Makefile src/Makefile])
+AM_CONDITIONAL([CROSS_COMPILING], [test $cross_compiling = yes])
AC_OUTPUT
EOF
check_PROGRAMS = main
main_LDADD = ../lib/libfeep.a
+if !CROSS_COMPILING
TESTS = main
+endif
EOF
$ACLOCAL
check_PROGRAMS = main
main_LDADD = libfeep.a
+if !CROSS_COMPILING
TESTS = main
+endif
EOF
$ACLOCAL
src_main_SOURCES = src/main.c
src_main_LDADD = lib/libfeep.a
+if !CROSS_COMPILING
TESTS = src/main
+endif
check-local:
test -f src/main.$(OBJEXT)
# The true/false example from the manual, plus a check for _SHORTNAME.
+required=native
. ./defs || Exit 1
cat >> configure.in << 'END'
# with one extra indirection in the sources (PR/315), and
# use of _CPPFLAGS (PR/337).
+required=native
. ./defs || Exit 1
cat >> configure.in << 'END'
# Test of subdir objects with ansi2knr.
+required=native
. ./defs || Exit 1
cat > configure.in << END
cd build
../configure
$MAKE
-./foo
-./bar
+if cross_compiling; then :; else
+ ./foo
+ ./bar
+fi
cd ..
./configure
$MAKE
-./foo
-./bar
+if cross_compiling; then :; else
+ ./foo
+ ./bar
+fi
:
# like an "intermediate file" in the GNU make sense).
test -f parse.c
-echo a | ./foo
-echo b | ./foo && Exit 1
+if cross_compiling; then :; else
+ echo a | ./foo
+ echo b | ./foo && Exit 1
+fi
# The generated file `parse.c' must be shipped.
$MAKE echo-distcom