[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Automake-NG] [PATCH 13/17] [ng] check: logic to define *LOG_DRIVER vars
From: |
Stefano Lattarini |
Subject: |
[Automake-NG] [PATCH 13/17] [ng] check: logic to define *LOG_DRIVER vars moved to generated Makefiles |
Date: |
Tue, 22 May 2012 22:50:54 +0200 |
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 <address@hidden>
---
automake.in | 37 -------------------------------------
lib/am/parallel-tests.am | 3 +++
t/test-driver-cond.sh | 7 -------
3 files changed, 3 insertions(+), 44 deletions(-)
diff --git a/automake.in b/automake.in
index ec57787..ed1c12b 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 c7badec..1fb5359 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 5538105..3b941ed 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"
--
1.7.9.5
- Re: [Automake-NG] [PATCH 09/17] [ng] check: unconditionally distribute test-driver, (continued)
[Automake-NG] [PATCH 10/17] [ng] am: new make variable '$(am__handle_exxext)', Stefano Lattarini, 2012/05/22
[Automake-NG] [PATCH 13/17] [ng] check: logic to define *LOG_DRIVER vars moved to generated Makefiles,
Stefano Lattarini <=
[Automake-NG] [PATCH 14/17] [ng] check: be laxer in accepted $(TEST_EXTENSIONS), Stefano Lattarini, 2012/05/22
[Automake-NG] [PATCH 16/17] [ng] check: support conditional $(TEST_EXTENSIONS), Stefano Lattarini, 2012/05/22
[Automake-NG] [PATCH 17/17] [ng] cosmetics: improve comments and spacing in 'parallel-tests.am', Stefano Lattarini, 2012/05/22
[Automake-NG] [PATCH 15/17] [ng] check: accept dot-less entries in $(TEST_EXTENSIONS), Stefano Lattarini, 2012/05/22