From: Stefano Lattarini Date: Mon, 21 May 2012 22:31:20 +0000 (+0200) Subject: Merge branch 'master' into ng/master X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9b5f37246d4a9947922725fbe6944ef2a810b800;p=thirdparty%2Fautomake.git Merge branch 'master' into ng/master * master: check: the parallel-tests driver is now the default ylwrap: preserve subdirectories in "#line" munging ylwrap: preparatory refactoring Signed-off-by: Stefano Lattarini --- 9b5f37246d4a9947922725fbe6944ef2a810b800 diff --cc automake.in index bbda43936,22fbbd764..7596adad0 --- a/automake.in +++ b/automake.in @@@ -4562,12 -4764,10 +4562,10 @@@ sub handle_tests_dejagn $output_rules .= file_contents ('dejagnu', new Automake::Location); } -sub handle_per_suffix_test +sub handle_per_suffix_test($) { - my ($test_suffix, %transform) = @_; - my ($pfx, $generic, $am_exeext); + my $test_suffix = shift; - my ($pfx, $parallel_tests_option); - prog_error ("called with 'parallel-tests' option not set") - unless $parallel_tests_option = option 'parallel-tests'; ++ my $pfx; if ($test_suffix eq '') { $pfx = ''; @@@ -4577,15 -4779,17 +4575,14 @@@ prog_error ("test suffix '$test_suffix' lacks leading dot") unless $test_suffix =~ m/^\.(.*)/; $pfx = uc ($1) . '_'; - $generic = 1; - $am_exeext = exists $configure_vars{'EXEEXT'} ? 'am__EXEEXT' - : 'FALSE'; } # The "test driver" program, deputed to handle tests protocol used by - # test scripts. By default, it's assumed that no protocol is used, - # so we fall back to the old "parallel-tests" behaviour, implemented - # by the 'test-driver' auxiliary script. + # test scripts. By default, it's assumed that no protocol is used, so + # we fall back to the old behaviour, implemented by the 'test-driver' + # auxiliary script. if (! var "${pfx}LOG_DRIVER") { - require_conf_file ($parallel_tests_option->{position}, FOREIGN, - 'test-driver'); + require_conf_file ("parallel-tests", FOREIGN, 'test-driver'); define_variable ("${pfx}LOG_DRIVER", "\$(SHELL) $am_config_aux_dir/test-driver", INTERNAL); @@@ -4632,12 -4846,19 +4629,19 @@@ sub handle_test if (var ('TESTS')) { push (@check_tests, 'check-TESTS'); - my $check_deps = "@check"; $output_rules .= &file_contents ('check', new Automake::Location, COLOR => !! option 'color-tests', - PARALLEL_TESTS => !! option 'parallel-tests', + SERIAL_TESTS => !! option 'serial-tests', - CHECK_DEPS => $check_deps); - - # 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')); - - if (! option 'serial-tests') + CHECK_DEPS => "@check"); - - if (my $parallel_tests = option 'parallel-tests') ++ 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')); ++ } ++ else { define_variable ('TEST_SUITE_LOG', 'test-suite.log', INTERNAL); my $suff = '.test'; @@@ -4659,29 -4889,76 +4663,21 @@@ "invalid test extensions: @invalid_test_suffixes"; } @test_suffixes = grep { is_valid_test_extension $_ } @test_suffixes; - if ($handle_exeext) - { - unshift (@test_suffixes, $at_exeext) - unless $test_suffixes[0] eq $at_exeext; - } - unshift (@test_suffixes, ''); - - transform_variable_recursively - ('TESTS', 'TEST_LOGS', 'am__testlogs', 1, INTERNAL, - sub { - my ($subvar, $val, $cond, $full_cond) = @_; - my $obj = $val; - return $obj - if $val =~ /^\@.*\@$/; - $obj =~ s/\$\(EXEEXT\)$//o; - - if ($val =~ /(\$\((top_)?srcdir\))\//o) - { - msg ('error', $subvar->rdef ($cond)->location, - "using '$1' in TESTS is currently broken: '$val'"); - } - - foreach my $test_suffix (@test_suffixes) - { - next - if $test_suffix eq $at_exeext || $test_suffix eq ''; - return substr ($obj, 0, length ($obj) - length ($test_suffix)) . '.log' - if substr ($obj, - length ($test_suffix)) eq $test_suffix; - } - my $base = $obj; - $obj .= '.log'; - handle_per_suffix_test ('', - OBJ => $obj, - BASE => $base, - SOURCE => $val); - return $obj; - }); - - my $nhelper=1; - my $prev = 'TESTS'; - my $post = ''; - my $last_suffix = $test_suffixes[$#test_suffixes]; - my $cur = ''; + # 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 + # from a non-existent 'all' program (because the Makefile contains + # an explicit 'all' target) rather than from the 'all.test' script, + # thus causing all sort of mishaps and confusion. + push @test_suffixes, ''; foreach my $test_suffix (@test_suffixes) { - if ($test_suffix eq $last_suffix) - { - $cur = 'TEST_LOGS'; - } - else - { - $cur = 'am__test_logs' . $nhelper; - } - define_variable ($cur, - '$(' . $prev . ':' . $test_suffix . $post . '=.log)', INTERNAL); - $post = '.log'; - $prev = $cur; - $nhelper++; - if ($test_suffix ne $at_exeext && $test_suffix ne '') - { - handle_per_suffix_test ($test_suffix, - OBJ => '', - BASE => '$*', - SOURCE => '$<'); - } + handle_per_suffix_test ($test_suffix); } - $clean_files{'$(TEST_LOGS)'} = MOSTLY_CLEAN; - $clean_files{'$(TEST_LOGS:.log=.trs)'} = MOSTLY_CLEAN; + $clean_files{'$(am__test_logs)'} = MOSTLY_CLEAN; + $clean_files{'$(am__test_results)'} = MOSTLY_CLEAN; $clean_files{'$(TEST_SUITE_LOG)'} = MOSTLY_CLEAN; } - else - { - # 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')); - } } } diff --cc lib/am/check.am index 903dfc247,67b254ffb..45bc61567 --- a/lib/am/check.am +++ b/lib/am/check.am @@@ -46,8 -46,10 +46,8 @@@ endif !%?COLOR .PHONY: check-TESTS - if %?PARALLEL_TESTS% + if !%?SERIAL_TESTS% -include inst-vars.am - ## New parallel test driver. ## ## The first version of the code here was adapted from check.mk, which was @@@ -367,7 -450,11 +367,9 @@@ recheck: all %CHECK_DEPS AM_RECURSIVE_TARGETS += check recheck - else !%?PARALLEL_TESTS% -.PHONY: recheck - + else %?SERIAL_TESTS% + + ## Obsolescent serial testsuite driver. check-TESTS: $(TESTS) @failed=0; all=0; xfail=0; xpass=0; skip=0; \ diff --cc t/test-driver-is-distributed.sh index c6e83feb3,88f7982e8..23a4d1803 --- a/t/test-driver-is-distributed.sh +++ b/t/test-driver-is-distributed.sh @@@ -57,10 -51,9 +51,9 @@@ EN .PHONY: test-top END unindent > tests/Makefile.am << END - AUTOMAKE_OPTIONS = $am_opts check-local: test-sub test-sub: - echo ' ' \$(DIST_COMMON) ' ' | grep '[ /]$test_driver ' + echo ' ' \$(am__dist_common) ' ' | grep '[ /]$test_driver ' TESTS = foo.test EXTRA_DIST = \$(TESTS) END