From 3a1a8c6d3cb46bfe65b715ddd8a3e0d7e27e1bf7 Mon Sep 17 00:00:00 2001 From: Stefano Lattarini Date: Fri, 22 Jun 2012 11:40:39 +0200 Subject: tests: automatic re-execution works for non-POSIX shells too Some inferior shells are too greedy in parsing their input. If a non-POSIX Bourne shell (like Solaris 10 /bin/sh) was used to launch one of our test scripts, it would fail unconditionally, because it unexpectedly saw some (by it) unsupported constructs, notwithstanding such constructs being placed *after* the code implementing automatic test re-execution with a better shell. In conclusion, the shell bailed out like this: $ /bin/sh t/ar.sh $ t/ar.sh: syntax error at line 257: `is_newest_files=$' unexpected By moving all the potentially problematic code in a separate file, to be sourced only after the code for automatic re-execution with a better shell, we ensure that inferior shell cannot see such code by mistake. * defs: All code after automatic shell re-execution moved out ... * t/ax/test-init.sh: ... to this new file. * syntax-checks.mk (xdefs): Add it. * Makefile.am (dist_check_DATA): Add it. Also move in 'defs' from a less explicit 'check_DATA' declaration. (nodist_check_DATA): Move in 'defs-static' from a less explicit 'check_DATA' declaration. (check_DATA): Remove. * t/self-check-sanity.sh: Remove, it was actually too hacky and brittle, sanity-checking situations we don0t actually care about. * t/list-of-tests.mk: Adjust. * t/self-check-explicit-skips.sh: Adjust, and fix a botched heading comments while we are at it. * t/self-check-reexec.tap: Adjust. * t/self-check-cleanup.tap: Likewise. Signed-off-by: Stefano Lattarini --- Makefile.am | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'Makefile.am') diff --git a/Makefile.am b/Makefile.am index 57a21373a..c464d8bab 100644 --- a/Makefile.am +++ b/Makefile.am @@ -387,8 +387,11 @@ $(srcdir)/t/testsuite-part.am: $(srcdir)/gen-testsuite-part Makefile.am # Static dependencies valid for each test case. check_SCRIPTS = t/wrap/aclocal-$(APIVERSION) t/wrap/automake-$(APIVERSION) -dist_check_DATA = t/ax/plain-functions.sh t/ax/tap-functions.sh -check_DATA = defs defs-static +dist_check_DATA = \ + t/ax/test-init.sh \ + t/ax/plain-functions.sh \ + t/ax/tap-functions.sh +nodist_check_DATA = defs-static # Few more static dependencies. t/distcheck-missing-m4.log: t/ax/distcheck-hook-m4.am -- cgit v1.2.1