]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
[ng] check: warn about invalid TEST_EXTENSIONS at make runtime
authorStefano Lattarini <stefano.lattarini@gmail.com>
Mon, 21 May 2012 23:37:28 +0000 (01:37 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Tue, 22 May 2012 20:46:18 +0000 (22:46 +0200)
* automake.in (handle_tests): Instead of warning about invalid test
extensions at Automake runtime, pass their list through the transform
'%INVALID_TEST_EXTENSIONS%' to ...
* lib/am/parallel-tests.am: ... this file, that will warn at make
runtime if that list is not empty.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
automake.in
lib/am/parallel-tests.am
lib/am/serial-tests.am
t/test-extensions.sh

index 032d70b55165673161e225e08bd21bfe8d68894c..db0fe586bab312722b9c9d08246d57a561285ca3 100644 (file)
@@ -4654,17 +4654,14 @@ sub handle_tests
                      "'TEST_EXTENSIONS' cannot have conditional contents";
            }
          my @test_suffixes = $var->value_as_list_recursive;
-          if ((my @invalid_test_suffixes =
-                  grep { !is_valid_test_extension $_ } @test_suffixes) > 0)
-            {
-              error $var->rdef (TRUE)->location,
-                    "invalid test extensions: @invalid_test_suffixes";
-            }
+          my @invalid_test_suffixes = grep { !is_valid_test_extension $_ }
+                                           @test_suffixes;
           @test_suffixes = grep { is_valid_test_extension $_ } @test_suffixes;
           $output_rules .=
             file_contents ('parallel-tests', new Automake::Location,
                            COLOR => !! option 'color-tests',
-                           CHECK_DEPS => "@check");
+                           CHECK_DEPS => "@check",
+                           INVALID_TEST_EXTENSIONS => "@invalid_test_suffixes");
           # It is *imperative* that the empty 'suffix goes last.
           # Otherwise, a declaration like "TESTS = all.test" would cause GNU
           # make to mistakenly try to build the 'all.log' and 'all.trs' files
index fc33bff0541b7e51bb351c152a385efab1f6f006..d0fcebbf812b3793280f37cb0bf8a1da4a7c669e 100644 (file)
@@ -25,6 +25,12 @@ include color-tests.am
 ## of more test metadata, and the use of custom test derivers and protocols
 ## (among them, TAP).
 
+am__invalid_test_extensions = %INVALID_TEST_EXTENSIONS%
+$(if $(am__invalid_test_extensions), \
+  $(foreach am__e, $(am__invalid_test_extensions), \
+    $(warning invalid test extension: '$(am__e)')) \
+  $(error invalid test extensions have been encountered))
+
 # The names of the given tests scripts with any possible registered
 # test extension removed, as well as any leading '$(srcdir)' component
 # (if any) stripped.
index b6a71846091422d2041c0ae706b1dca3f8339d57..af5e7b5518b1e482ea49e6b7088595560da40133 100644 (file)
@@ -34,6 +34,7 @@ endif !%?HANDLE-EXEEXT%
 am__cooked_tests = $(call am__check_cook_with_exeext, $(TESTS))
 am__cooked_xfail_tests = $(call am__check_cook_with_exeext, $(XFAIL_TESTS))
 
+.PHONY: check-TESTS
 check-TESTS: $(am__cooked_tests)
        @failed=0; all=0; xfail=0; xpass=0; skip=0; \
        srcdir=$(srcdir); export srcdir; \
index 481d1e35c6cce052f9e3190cdf4845280f8ba90a..b2e037f7f52bfe264dd2860fa855a721598b3606 100755 (executable)
@@ -47,24 +47,25 @@ done
 # The produced Makefile is not broken.
 ./configure
 $MAKE all check
+$MAKE distclean
 
 cat > Makefile.am << 'END'
 TESTS = foo.test bar.sh
-TEST_EXTENSIONS  = .test mu .x-y a-b .t.1 .sh .6c .0 .11 .= @suf@ .@ext@
+TEST_EXTENSIONS  = .test mu .x-y a-b .t.1 .sh .6c .0 .11
 TEST_EXTENSIONS += .= .t33 .a@b _&_
 END
 
-AUTOMAKE_fails
-for suf in mu .x-y a-b .t.1 .6c .0 .11  @suf@ .@ext@ '.=' '_&_'; do
-  suf2=`printf '%s\n' "$suf" | sed -e 's/\./\\./'`
-  $EGREP "^Makefile\.am:2:.*invalid test extension.* $suf2( |$)" stderr
+$AUTOMAKE
+./configure
+
+$MAKE 2>stderr && { cat stderr >&2; Exit 1; }
+cat stderr >&2
+for suf in mu .x-y a-b .t.1 .6c .0 .11  '.=' '_&_'; do
+  $FGREP "invalid test extension: '$suf'" stderr
 done
 
 # Verify that we accept valid suffixes, even if intermixed with
 # invalid ones.
-$EGREP '\.(sh|test|t33)' stderr && Exit 1
-
-# Verify that we don't try to handle invalid suffixes.
-$EGREP '(LOG_COMPILER|non-POSIX var|bad character)' stderr && Exit 1
+$EGREP 'invalid.*\.(sh|test|t33)' stderr && Exit 1
 
 :