]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
[ng] check: logic to define *LOG_DRIVER vars moved to generated Makefiles
authorStefano Lattarini <stefano.lattarini@gmail.com>
Tue, 22 May 2012 15:01:12 +0000 (17:01 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Tue, 22 May 2012 20:46:55 +0000 (22:46 +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 <stefano.lattarini@gmail.com>
automake.in
lib/am/parallel-tests.am
t/test-driver-cond.sh

index ec57787696a3ee559baee0b3b9aeec78d5dc402a..ed1c12b3e7adaada81797609dd3309a7ad268b31 100644 (file)
@@ -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;
index c7badecf6c3058e0219ed7af758e1f6c35de675e..1fb53592c5d2e3edcf58bc6a74f47ebba93af40f 100644 (file)
@@ -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
index 5538105b5aae8e3baee67cd30d50094662009ffc..3b941edd83bafaf97e1453e5ed6564a28eff400c 100755 (executable)
@@ -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"