From: Stefano Lattarini Date: Tue, 22 May 2012 15:01:12 +0000 (+0200) Subject: [ng] check: logic to define *LOG_DRIVER vars moved to generated Makefiles X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e5d1890ba1b3a5d83fd4b133d144c1ff38b5b681;p=thirdparty%2Fautomake.git [ng] check: logic to define *LOG_DRIVER vars moved to generated Makefiles If a LOG_DRIVER variable is undefined, we should define a default for it, pointing to the "simple" test driver ('lib/test-driver' in the automake repository). Move the logic to do so out of the automake script and into the generated Makefiles. * automake.in (handle_per_suffix_test): Remove. (handle_tests): Don't call it anymore, and simplify accordingly. * lib/am/parallel-tests.am (am__handle_per_suffix_test): Define the relevant LOG_DRIVER variable to a proper default if it is undefined. * t/test-driver-cond.sh: Remove obsolete grepping checks. Signed-off-by: Stefano Lattarini --- diff --git a/automake.in b/automake.in index ec5778769..ed1c12b3e 100644 --- a/automake.in +++ b/automake.in @@ -4551,32 +4551,6 @@ sub handle_tests_dejagnu $output_rules .= file_contents ('dejagnu', new Automake::Location); } -sub handle_per_suffix_test($) -{ - my $test_suffix = shift; - my $pfx; - if ($test_suffix eq '') - { - $pfx = ''; - } - else - { - prog_error ("test suffix '$test_suffix' lacks leading dot") - unless $test_suffix =~ m/^\.(.*)/; - $pfx = uc ($1) . '_'; - } - # 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 behaviour, implemented by the 'test-driver' - # auxiliary script. - if (! var "${pfx}LOG_DRIVER") - { - define_variable ("${pfx}LOG_DRIVER", - '$(SHELL) $(am__config_aux_dir)/test-driver', - INTERNAL); - } -} - # is_valid_test_extension ($EXT) # ------------------------------ # Return true if $EXT can appear in $(TEST_EXTENSIONS), return false @@ -4642,17 +4616,6 @@ sub handle_tests COLOR => !! option 'color-tests', 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 - # 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) - { - handle_per_suffix_test ($test_suffix); - } $clean_files{'$(am__test_logs)'} = MOSTLY_CLEAN; $clean_files{'$(am__test_results)'} = MOSTLY_CLEAN; $clean_files{'$(TEST_SUITE_LOG)'} = MOSTLY_CLEAN; diff --git a/lib/am/parallel-tests.am b/lib/am/parallel-tests.am index c7badecf6..1fb53592c 100644 --- a/lib/am/parallel-tests.am +++ b/lib/am/parallel-tests.am @@ -70,6 +70,7 @@ am__tpfx = \ $(if $1,$(call am__toupper,$(patsubst .%,%_,$1))) !define am__handle_per_suffix_test +!$$(call am__tpfx,$1)LOG_DRIVER ?= $(SHELL) $(am__config_aux_dir)/test-driver !%.log %.trs: %$1 $$($$(call am__tpfx,$1)LOG_DEPENDENCIES) ! @$$(call am__runtest,$$(call am__tpfx,$1)) !ifeq ($(am__handle_exeext),yes) @@ -80,6 +81,8 @@ am__tpfx = \ !endif # am__handle_exeext = yes !endef ! +## FIXME: it would be nice to break these on multiple lines. Unfortnately, +## FIXME: our '!' is not yet smart enough to handle that :-( !$(foreach am__e,$(TEST_EXTENSIONS), $(eval $(call am__handle_per_suffix_test,$(am__e)))) ## It is *imperative* that the "empty" suffix goes last. Otherwise, a ## declaration like "TESTS = all.test" would cause GNU make to mistakenly diff --git a/t/test-driver-cond.sh b/t/test-driver-cond.sh index 5538105b5..3b941edd8 100755 --- a/t/test-driver-cond.sh +++ b/t/test-driver-cond.sh @@ -79,13 +79,6 @@ chmod a+x foo bar.test baz.sh $AUTOMAKE -a test -f test-driver -grep DRIVER Makefile.in || Exit 99 # For debugging. - -grep '^my_LOG_DRIVER *=' Makefile.in \ - && fatal_ 'unexpected $(my_LOG_DRIVER) in Makefile.in' - -grep '^TEST_LOG_DRIVER =.*\$(SHELL).*/test-driver' Makefile.in - $PERL -MTAP::Parser -e 1 \ || skip_ "cannot import TAP::Parser perl module"