* The 'portability-recursive' warning category is obsolete, and has been
removed.
+Serial testsuite harness (obsolescent)
+======================================
+
+* The $(TESTS) and $(XFAIL_TESTS) variables are not anymore rewritten for
+ $(EXEEXT) appending. The use of compiled programs in $(TESTS) and
+ $(XFAIL_TESTS) still works as before though, even on systems where
+ $(EXEEXT) is non-empty.
+
Parallel testsuite harness
==========================
CHECK_DEPS => "@check");
if (option 'serial-tests')
{
- # Tests that are known programs should have $(EXEEXT) appended.
- # For matching purposes, we need to adjust XFAIL_TESTS as well.
- append_exeext { exists $known_programs{$_[0]} } 'TESTS';
- append_exeext { exists $known_programs{$_[0]} } 'XFAIL_TESTS'
- if (var ('XFAIL_TESTS'));
+ 1; # Nothing to do, for now.
}
else
{
## Obsolescent serial testsuite driver.
-check-TESTS: $(TESTS)
+if %?HANDLE-EXEEXT%
+## This is suboptimal, but we need to preserve the order of $(TESTS).
+am__check_cook_with_exeext_1 = \
+ $(if $(filter $(am__all_progs), $1), $1$(EXEEXT), $1)
+am__check_cook_with_exeext = $(strip \
+ $(if $(EXEEXT), $(foreach am__t, $1, $(call $(0)_1, $(am__t))), $1))
+else !%?HANDLE-EXEEXT%
+am__check_cook_with_exeext = $(strip $1)
+endif !%?HANDLE-EXEEXT%
+
+# TESTS can contain compiled programs, in which case we might have
+# to account for $(EXEEXT) appending. For matching purposes, we
+# need to adjust XFAIL_TESTS as well.
+am__cooked_tests = $(call am__check_cook_with_exeext, $(TESTS))
+am__cooked_xfail_tests = $(call am__check_cook_with_exeext, $(XFAIL_TESTS))
+
+check-TESTS: $(am__cooked_tests)
@failed=0; all=0; xfail=0; xpass=0; skip=0; \
srcdir=$(srcdir); export srcdir; \
- list='$(TESTS)'; \
+ list='$(am__cooked_tests)'; \
$(am__tty_colors); \
+ is_xfail_test () { \
+ case " $(strip $(am__cooked_xfail_tests)) " in \
+ *" $$tst "*) return 0;; \
+ *) return 1;; \
+ esac; \
+ }; \
if test -n "$$list"; then \
for tst in $$list; do \
if test -f ./$$tst; then dir=./; \
if $(TESTS_ENVIRONMENT) $${dir}$$tst $(AM_TESTS_FD_REDIRECT); then \
## Success
all=`expr $$all + 1`; \
- case " $(XFAIL_TESTS) " in \
- *[\ \ ]$$tst[\ \ ]*) \
+ if is_xfail_test; then \
xpass=`expr $$xpass + 1`; \
failed=`expr $$failed + 1`; \
col=$$red; res=XPASS; \
- ;; \
- *) \
+ else \
col=$$grn; res=PASS; \
- ;; \
- esac; \
+ fi; \
elif test $$? -ne 77; then \
## Failure
all=`expr $$all + 1`; \
- case " $(XFAIL_TESTS) " in \
- *[\ \ ]$$tst[\ \ ]*) \
+ if is_xfail_test; then \
xfail=`expr $$xfail + 1`; \
col=$$lgn; res=XFAIL; \
- ;; \
- *) \
+ else \
failed=`expr $$failed + 1`; \
col=$$red; res=FAIL; \
- ;; \
- esac; \
+ fi; \
else \
## Skipped
skip=`expr $$skip + 1`; \
test -f one$(EXEEXT)
test -f two$(EXEEXT)
touch ok
-.PHONY: print-tests
-print-tests:
- echo BEG: $(TESTS) :END
+prepare-for-fake-exeext:
+ rm -f ok
+ mv -f one$(EXEEXT) one.bin
+ mv -f two$(EXEEXT) two.bin
+post-check-for-fake-exeext:
+ test -f ok
+ test ! -f one$(EXEEXT)
+ test ! -f two$(EXEEXT)
+.PHONY: prepare-for-fake-exeext post-check-for-fake-exeext
END
$ACLOCAL
cp one.c two.c
./configure
+
$MAKE check
test -f ok
-$MAKE EXEEXT=.bin 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
-$FGREP 'TESTS = $(check_PROGRAMS)' Makefile.in
+
+$MAKE prepare-for-fake-exeext
+$MAKE check EXEEXT=.bin
+$MAKE post-check-for-fake-exeext
+
+# No TESTS rewriting has taken place.
+grep '^TESTS = \$(check_PROGRAMS)$' Makefile.in
:
XFAIL_TESTS = a b c d
check_PROGRAMS = a c d
check_SCRIPTS = b
+EXTRA_PROGRAMS = new old
EXTRA_DIST = $(check_SCRIPTS)
-.PHONY: print-xfail-tests
-print-xfail-tests:
- @echo BEG: $(XFAIL_TESTS) :END
+prepare-for-fake-exeext:
+ rm -f out.new out.old
+ touch a.fake c.fake d.fake
+ mv -f new$(EXEEXT) new.fake
+ mv -f old$(EXEEXT) old.fake
+post-check-for-fake-exeext:
+ test -f new.fake
+ test -f old.fake
+ test ! -f new
+ test ! -f new$(EXEEXT)
+ test ! -f old
+ test ! -f old$(EXEEXT)
+.PHONY: prepare-for-fake-exeext post-check-for-fake-exeext
END
cat > b <<'END'
cp a.c c.c
cp a.c d.c
+cat > new.c <<'END'
+#include <stdio.h>
+int main (void)
+{
+ FILE *fp = fopen ("out.new", "w");
+ fprintf (fp, "%s!\n", "Hello, Brave New World");
+ return (fclose (fp) != 0);
+}
+END
+
+cat > old.c <<'END'
+#include <stdio.h>
+int main (void)
+{
+ FILE *fp = fopen ("out.old", "w");
+ fprintf (fp, "%s!\n", "Hello, Europe");
+ return (fclose (fp) == 0);
+}
+END
+
$ACLOCAL
$AUTOCONF
$AUTOMAKE -a
./configure
$MAKE check
-if test x"$am_serial_tests" = x"yes"; then
- $MAKE EXEEXT=.bin print-xfail-tests >stdout || { cat stdout; Exit 1; }
- cat stdout
- $FGREP 'BEG: a.bin b c.bin d.bin :END' stdout
-fi
+$MAKE check TESTS='old new' XFAIL_TESTS=old
+grep 'Hello, Brave New World!' out.new
+grep 'Hello, Europe!' out.old
+
+$MAKE prepare-for-fake-exeext
+$MAKE check TESTS='old new' EXEEXT=.fake XFAIL_TESTS=old
+$MAKE post-check-for-fake-exeext
+grep 'Hello, Brave New World!' out.new
+grep 'Hello, Europe!' out.old
$MAKE distcheck
BAZ = baz $(DEP)
endif
bin_PROGRAMS = $(programs) @programs@ prg3 $(BAR) $(BAZE)
+sbin_PROGRAMS = prg4 $(BAZ)
EXTRA_PROGRAMS = prg1 prg2 prg3
-TESTS = prg1 prg3 prg4 $(BAZ)
.PHONY: test-cond test-nocond
test-nocond:
is $(bin_PROGRAMS) == prg1.x prg2.x prg1.x prg2.x prg3.x
is $(EXTRA_PROGRAMS) == prg1.x prg2.x prg3.x
- is $(TESTS) == prg1.x prg3.x prg4
+ is $(sbin_PROGRAMS) == prg4.x
test-cond:
is $(bin_PROGRAMS) == prg1.x prg2.x prg1.x prg2.x prg3.x bar.x baz.x
is $(EXTRA_PROGRAMS) == prg1.x prg2.x prg3.x
- is $(TESTS) == prg1.x prg3.x prg4 baz.x bar.x
+ is $(sbin_PROGRAMS) == prg4.x baz.x bar.x
is $(BAR) $(BAZ) == bar baz bar
END
{
$EGREP -i 'test_suite_log|test_(logs|bases)|\.log.*:' $1 && Exit 1
grep 'recheck.*:' $1 && Exit 1
- grep '^check-TESTS: \$(TESTS)$' $1
+ grep '^check-TESTS: \$(am__cooked_tests)$' $1
}
has_parallel_tests ()