* maint:
sync: update files from upstream with "make fetch"
maintcheck: remove an obsolescent check
tests: rename some tests to more expressive names, again
tests: remove an obsolescent grepping check
tests: merge two tests on automatic remake functionality
tests: rename some test to more expressive names
news: 'compile' supports libfoo.a naming when wrapping Microsoft tools
tests: ensure generation of wrapper tests matching multiple conditions
tests: simplify a loop in gen-testsuite-part
compile: support libfoo.a naming when wrapping Microsoft tools
NEWS: fix wording and grammaros, re-wrap text accordingly
cosmetics: fix typo in 'lib/depcomp' comments
+ Extra non-trivial changes:
* Makefile.am (XFAIL_TESTS): Rename 't/pr8365-remake-timing.sh' to
't/remake-timing-bug-pr8365.sh' (in master, this was done for in
file 't/list-of-tests.mk', but that is gone in ng/master).
* t/parallel-tests-empty-tests.sh: Merge ...
* t/parallel-tests-empty.sh: ... into this, to reduce confusion and
code duplication.
* t/remake-maintainer-mode.sh: Delete: Automake-NG don't support
AM_MAINTAINER_MODE (see commit
v1.12.2-790-g00a3837).
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
EXTRA_DIST += t/README t/ax/is t/ax/is_newest
-TESTS = ## Will be updated later.
+# Hand-written tests for stuff in 'contrib/'.
+include $(srcdir)/contrib/t/local.am
+
+# All tests, both hand-written and autogenerated.
+# IMPORTANT: This assumes that the autogenerated tests are placed
+# in the $(srcdir) as well!
+all_TESTS = \
+ $(wildcard $(srcdir)/t/*.sh) \
+ $(wildcard $(srcdir)/t/*.tap) \
+ $(wildcard $(srcdir)/t/pm/*.pl)
+
+# This is to ensure longer-running tests will be run earlier, which is
+# useful when running the testsuite in parallel on multicore machines.
+# Here too we assume that the autogenerated tests are placed in $(srcdir).
+long_running_TESTS = \
+ $(srcdir)/t/dist-many.sh \
+ $(srcdir)/t/parallel-tests-many.sh \
+ $(srcdir)/t/add-missing.tap \
+ $(srcdir)/t/instspc.tap \
+ $(wildcard $(srcdir)/t/depcomp-*.tap) \
+ $(wildcard $(srcdir)/t/*libtool*.sh) \
+ $(wildcard $(srcdir)/t/lt*.sh) \
+ $(wildcard $(srcdir)/t/remake*.sh)
+
+TESTS = \
+ $(long_running_TESTS) \
+ $(filter-out $(long_running_TESTS), $(all_TESTS)) \
+ $(contrib_TESTS)
+
+EXTRA_DIST += $(TESTS)
+
+# FIXME: this "expected failures" are in truth an hack used to
+# FIXME: to verify that some incorrect usages of our perl libraries
+# FIXME: raise an error. We should find a cleaner way to check that.
+perl_fake_XFAIL_TESTS = \
+ t/pm/Cond2.pl \
+ t/pm/Cond3.pl \
+ t/pm/DisjCon2.pl \
+ t/pm/DisjCon3.pl \
+ t/pm/Version2.pl \
+ t/pm/Version3.pl
+
+XFAIL_TESTS = \
+ t/all.sh \
+ t/override-suggest-local.sh \
+ t/comments-in-var-def.sh \
+ t/cond17.sh \
+ t/dist-srcdir2.sh \
+ t/gcj6.sh \
+ t/override-conditional-2.sh \
+ t/dist-pr109765.sh \
+ t/instdir-cond2.sh \
+ t/interp3.sh \
+ t/java-nobase.sh \
+ t/objext-pr10128.sh \
- t/pr8365-remake-timing.sh \
++ t/remake-timing-bug-pr8365.sh \
+ t/remake-am-pr10111.sh \
+ t/remake-m4-pr10111.sh \
+ t/var-undef-append.sh \
+ $(perl_fake_XFAIL_TESTS)
# Some testsuite-influential variables should be overridable from the
# test scripts, but not from the environment.
EOF
- # FIXME: the following is not really right, since cannot compose wrapping
- # of tests matching more than one condition. Still, there should be no
- # such test at the moment, so the limitation is (temporarily) acceptable.
- while (my ($k, $g) = each %test_generators)
+ # A test script '$test' can possibly match more than one condition, so
+ # for each tests we need to keep a list of generated wrapper tests.
+ # Since what defines these wrapper scripts is the set of initializations
+ # that are issued before sourcing the original, wrapped tests, these
+ # initializations is what we put in our list entries.
+ # The list will be saved in the hash entry '$wrapper_setups{$test}'.
+ my %wrapper_setups = ();
+ foreach my $test (@all_tests)
{
- my @wrapped_tests = grep {
- line_match ($g->{line_matcher}, $_)
- && (!$g->{line_rejecter} || !line_match ($g->{line_rejecter}, $_))
- } @all_tests;
- foreach my $wrapped_test (@wrapped_tests)
+ my @setups = ('');
+ foreach my $x (values %test_generators)
+ {
+ next
+ if not line_match $x->{line_matcher}, $test;
+ next
+ if $x->{line_rejecter} and line_match $x->{line_rejecter}, $test;
+ @setups = map { ($_, "$_\n$x->{shell_setup_code}") } @setups;
+ }
+ @setups = grep { $_ ne '' } @setups;
+ $wrapper_setups{$test} = \@setups if @setups;
+ }
+ # And now create all the wrapper tests.
+ while (my ($wrapped_test, $setup_list) = each %wrapper_setups)
+ {
+ (my $base = $wrapped_test) =~ s/\.([^.]*)$//;
+ my $suf = $1 or die "$me: test '$wrapped_test' lacks a suffix\n";
+ my $count = 0;
+ foreach my $setup (@$setup_list)
{
- (my $base = $wrapped_test) =~ s/\.([^.]*)$//;
- my $suf = $1 or die "$me: test '$wrapped_test' lacks a suffix\n";
- my $wrapper_test = "$srcdir/$base-w.$suf";
+ $count++;
+ my $wbase = "$base-w" . ($count > 1 ? $count : '');
- my $wrapper_test = "$wbase.$suf";
- # Register wrapper test as "autogenerated".
- push @generated_tests, $wrapper_test;
++ my $wrapper_test = "$srcdir/$wbase.$suf";
# Create wrapper test.
atomic_write $wrapper_test,
sub { write_wrapper_script $_[0], $wrapped_test,
$AUTOCONF
$AUTOMAKE -a
- no_test_has_run ()
-./configure
-$MAKE check >stdout || { cat stdout; exit 1; }
-cat stdout
-for x in TOTAL PASS FAIL XPASS FAIL SKIP ERROR; do
- grep "^# $x: *0$" stdout
++no_test_run ()
+{
- ls -1 *.log | grep -v '^test-suite\.log$' | grep . && exit 1
- grep '^# TOTAL: *0$' test-suite.log
++ $MAKE check ${1+"$@"} >stdout || { cat stdout; exit 1; }
++ cat stdout
++ ls *.log | grep -v '^test-suite\.log$' | grep . && exit 1
++ grep '^# TOTAL: *0$' test-suite.log || exit 1
++ for x in TOTAL PASS FAIL XPASS FAIL SKIP ERROR; do
++ grep "^# $x: *0$" stdout || exit 1
++ done
+ :
+}
+
+for vpath in : false; do
+ if $vpath; then
+ mkdir build
+ cd build
+ srcdir=..
+ else
+ srcdir=.
+ fi
+ $srcdir/configure
+ cd sub1
- $MAKE check VERBOSE=yes
- no_test_has_run
++ no_test_run
++ no_test_run VERBOSE=yes
+ cd ../sub2
- $MAKE check VERBOSE=yes TESTS=''
- no_test_has_run
++ no_test_run TESTS=
++ no_test_run VERBOSE=yes TESTS=' '
+ cd ..
++ # Sanity check.
+ $MAKE check
+ cat sub2/foo.log
- $MAKE distclean
+ cd $srcdir
done
-exit 0
+:
$ACLOCAL
$AUTOMAKE
-grep '^Makefile' sub/Makefile.in
+grep -i makefile sub/Makefile.in # For debugging.
+grep '^am\.relpath\.makefile = Makefile$' sub/Makefile.in
+grep '^am\.relpath\.makefile\.in = \$(srcdir)/Makefile\.in$' sub/Makefile.in
+grep '^am\.relpath\.makefile\.am = \$(srcdir)/Makefile\.am$' sub/Makefile.in
+ grep '\$(AUTOMAKE).* sub/Makefile' sub/Makefile.in
: