automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[FYI] {maint} test runner: work correctly in VPATH setups


From: Stefano Lattarini
Subject: [FYI] {maint} test runner: work correctly in VPATH setups
Date: Fri, 6 Jul 2012 22:23:59 +0200

Due to a "feature" of AC_CONFIG_FILES, because 't/ax/test-runner.in'
is in a subdirectory, the '@srcdir@' value that is AC_SUBST'd in it
gets tweaked to contain as much '..' components as are the directory
components of 't/ax/test-runner'.  Because our build system operates
in a non-recursive setup, this substitution is wrong; for example,
the final 't/ax/test-runner' build in a VPATH builds where the source
directory is ".." contains the line:

    : ${srcdir='../../../t/ax'}

instead of the expected (and correct):

    : ${srcdir='../t/ax'}

We solve the issue by making 't/ax/test-runner' built by a Makefile
recipe rather than by a config.status substitutions; this is already
done for other testsuite-related files, like 'defs-static'.

* configure.ac (AC_CONFIG_FILES): Don't build 't/ax/test-runner'
anymore.
* Makefile.am (t/ax/test-runner): New rule.
(EXTRA_DIST): Add 't/ax/test-runner.in'.
(CLEANFILES, noinst_SCRIPTS): Add 't/ax/test-runner'.

Signed-off-by: Stefano Lattarini <address@hidden>
---
 Makefile.am  |   11 +++++++++++
 configure.ac |    1 -
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/Makefile.am b/Makefile.am
index f55f6fb..7169eee 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -400,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 $@ address@hidden
+       $(AM_V_GEN)in=t/ax/test-runner.in \
+         && $(MKDIR_P) t/ax \
+         && $(do_subst) <$(srcdir)/t/ax/test-runner.in >address@hidden \
+         && chmod a+x address@hidden
+       $(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.
diff --git a/configure.ac b/configure.ac
index 10fa93d..7d30762 100644
--- a/configure.ac
+++ b/configure.ac
@@ -559,7 +559,6 @@ AC_SUBST([EXEEXT])
 ## ---------------------- ##
 
 AC_CONFIG_FILES([Makefile])
-AC_CONFIG_FILES([t/ax/test-runner], [chmod +x t/ax/test-runner])
 
 AC_CONFIG_LINKS([GNUmakefile:GNUmakefile])
 AC_CONFIG_LINKS([defs:defs])
-- 
1.7.9.5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]