From fb21ed841b61c61d70ac9c370f53d2cf53231764 Mon Sep 17 00:00:00 2001 From: Stefano Lattarini Date: Wed, 17 Aug 2011 12:06:25 +0200 Subject: testsuite: refactor tests on TAP support in view of future changes * tests/defs (fetch_tap_driver): New subroutine; it fetches the automake-provided TAP driver from the `lib/' directory into the current directory, and edits its shebang line so that it will be run with the perl interpreter determined at configure time. * tests/tap-setup.sh: Use it. * tests/tap-common-setup.test: There's no need to AC_SUBST `PERL' anymore, nor to use it in the Makefile to run the TAP driver. Also, use the `fetch_tap_driver' function instead of copying the `tap-driver' auxiliary script directly. * tests/tap-bad-prog.tap: Likewise. * tests/tap-diagnostic-custom.test: Likewise. * tests/tap-doc.test: Likewise. * tests/tap-merge-stdout-stderr.test: Likewise. * tests/tap-more.test: Likewise. * tests/tap-more2.test: Likewise. * tests/tap-recheck.test: Likewise. * tests/tap-summary-aux.sh: Likewise. * tests/tap-basic.test: Likewise, and fix a grammaro in comments since we are at it. --- tests/defs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tests/defs') diff --git a/tests/defs b/tests/defs index afce3cba9..2b5df6b0a 100644 --- a/tests/defs +++ b/tests/defs @@ -306,6 +306,18 @@ unindent () } sed_unindent_prog="" # Avoid interferences from the environment. +# fetch_tap_driver +# ---------------- +# Fetch the Automake-provided TAP driver from the `lib/' directory into +# the current directory, and edit its shebang line so that it will be +# run with the perl interpreter determined at configure time. +fetch_tap_driver () +{ + sed "1s|#!.*|#! $PERL -w|" "$top_testsrcdir"/lib/tap-driver >tap-driver \ + && chmod a+x tap-driver \ + || fatal_ "failed to fetch perl tap driver" + sed 10q tap-driver # For debugging. +} ## ----------------------------------------------------------- ## ## Checks for required tools, and additional setups (if any) ## -- cgit v1.2.1