test runner: work correctly in VPATH setups
authorStefano Lattarini <stefano.lattarini@gmail.com>
Fri, 6 Jul 2012 20:17:59 +0000 (22:17 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Fri, 6 Jul 2012 20:17:59 +0000 (22:17 +0200)
commita5edf3d61c28f0c9702dd012bf8d0623310e19c5
tree3a9b135c21905e4030c2612d7119910d4bfcb5a5
parentcca426348a05caf190c3ef60f2f54d1a590b4459
test runner: work correctly in VPATH setups

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 building 't/ax/test-runner' with a Makefile
recipe instead of 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 <stefano.lattarini@gmail.com>
Makefile.am
configure.ac