diff options
author | Stefano Lattarini <stefano.lattarini@gmail.com> | 2011-10-01 21:31:07 +0200 |
---|---|---|
committer | Stefano Lattarini <stefano.lattarini@gmail.com> | 2011-10-01 21:58:18 +0200 |
commit | 90bea64bc5023be075b63bf7c651d0242f35a83c (patch) | |
tree | 52736325a2fc4a0276ce9b2cb01f34614992e1d0 /automake.in | |
parent | b9fa1fc1eb50d7907764ec0972a674548a7bd8b3 (diff) | |
download | automake-90bea64bc5023be075b63bf7c651d0242f35a83c.tar.gz |
parallel-tests: automake error our on invalid TEST_EXTENSIONS
This change fixes automake bug#9400.
* automake.in (handle_tests): Bail out if a suffix specified in
TEST_EXTENSIONS would produce an invalid `xxx_LOG_COMPILER'
variable or an invalid suffix rule. Before this change, automake
would have issued a confusing error messages (about invalid or
non-POSIX variables being defined), and in some situations would
have even produced a broken `Makefile.in' file.
($TEST_EXTENSION_PATTERN): New helper variable.
* doc/automake.texi (Simple Tests using parallel-tests): Document
the limitations on TEST_EXTENSIONS explicitly.
* NEWS: Update.
* tests/test-extensions.test: New test.
* tests/Makefile.am (TESTS): Update.
Diffstat (limited to 'automake.in')
-rwxr-xr-x | automake.in | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/automake.in b/automake.in index 215881b14..a60bc9fca 100755 --- a/automake.in +++ b/automake.in @@ -213,6 +213,8 @@ my $DASH_D_PATTERN = "(^|\\s)-d(\\s|\$)"; # Directories installed during 'install-exec' phase. my $EXEC_DIR_PATTERN = '^(?:bin|sbin|libexec|sysconf|localstate|lib|pkglib|.*exec.*)' . "\$"; +# Suffixes that can appear in TEST_EXTENSIONS (parallel-tests support). +my $TEST_EXTENSION_PATTERN = '^(\.[a-zA-Z_][a-zA-Z0-9_]*|@[a-zA-Z0-9_]+@)$'; # Values for AC_CANONICAL_* use constant AC_CANONICAL_BUILD => 1; @@ -4971,7 +4973,15 @@ sub handle_tests } define_variable ('TEST_EXTENSIONS', $suff, INTERNAL); # FIXME: this mishandles conditions. - my @test_suffixes = (var 'TEST_EXTENSIONS')->value_as_list_recursive; + my $var = rvar 'TEST_EXTENSIONS'; + my @test_suffixes = $var->value_as_list_recursive; + if ((my @invalid_test_suffixes = + grep { !/$TEST_EXTENSION_PATTERN/o } @test_suffixes) > 0) + { + error $var->rdef (TRUE)->location, + "invalid test extensions: @invalid_test_suffixes"; + } + @test_suffixes = grep { /$TEST_EXTENSION_PATTERN/o } @test_suffixes; if ($handle_exeext) { unshift (@test_suffixes, $at_exeext) |