test runner: work correctly in VPATH setups
[platform/upstream/automake.git] / Makefile.am
index 9d58155..7169eee 100644 (file)
@@ -345,11 +345,6 @@ AM_TESTS_ENVIRONMENT = \
   ; do \
     eval test x"\$${$$v}" = x || unset $$v; \
   done;
-# The 'AM_TESTS_REEXEC=no' setting tells the tests not to needlessly
-# re-execute themselves with the shell detected at configure time, since
-# we are already running them under it explicitly in our setup (see e.g.
-# the definition of TEST_LOG_COMPILER above).
-AM_TESTS_ENVIRONMENT += AM_TESTS_REEXEC=no; export AM_TESTS_REEXEC;
 # We want warning messages and explanations for skipped tests to go to
 # the console if possible, so set up 'stderr_fileno_' properly.
 AM_TESTS_FD_REDIRECT = 9>&2
@@ -405,6 +400,17 @@ defs-static: defs-static.in Makefile
 EXTRA_DIST += defs-static.in
 CLEANFILES += defs-static
 
+t/ax/test-runner: t/ax/test-runner.in Makefile
+       $(AM_V_at)rm -f $@ $@-t
+       $(AM_V_GEN)in=t/ax/test-runner.in \
+         && $(MKDIR_P) t/ax \
+         && $(do_subst) <$(srcdir)/t/ax/test-runner.in >$@-t \
+         && chmod a+x $@-t
+       $(generated_file_finalize)
+EXTRA_DIST += t/ax/test-runner.in
+CLEANFILES += t/ax/test-runner
+noinst_SCRIPTS = t/ax/test-runner
+
 # If two test scripts have the same basename, they will end up sharing
 # the same log file, leading to all sort of undefined and undesired
 # behaviours.
@@ -613,11 +619,6 @@ ChangeLog: am--changelog-regen-hook
          exit 1; \
        fi
 
-# Ensure tests are world-executable.
-# FIXME: this should be turned into a maintainer check...
-dist-hook:
-       $(am__cd) $(distdir)/t && chmod a+rx *.sh *.tap
-
 
 ## --------------------------- ##
 ##  Perl coverage statistics.  ##