* t/ax/tests-init.sh: Make the code creating the temporary
test subdirectory smart enough to automatically create it
in the same subdirectory of the test that is being run.
* defs-static.in ($MKDIR_P, $am_rel_srcdir): New variables,
AC_SUBST'd from @MKDIR_P@ and @srcdir@ respectively, and
used in the new 'tests-init.sh' code.
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
case $argv0 in *.tap) am_using_tap=yes;; *) am_using_tap=no;; esac
fi
+am_rel_srcdir='@srcdir@'
am_top_srcdir='@abs_srcdir@'
am_top_builddir='@abs_builddir@'
testprefix='@prefix@'
host_alias=${host_alias-'@host_alias@'}; export host_alias
build_alias=${build_alias-'@build_alias@'}; export build_alias
+# A concurrency-safe "mkdir -p" implementation.
+MKDIR_P=${AM_TESTSUITE_MKDIR_P-'@MKDIR_P@'}
+
# The shell we use to run our own test scripts, determined at configure
# time. It is required in the self tests, and most importantly for the
# automatic re-execution of test scripts.
# temporary/data files. This will be created shortly, and will be removed
# by the cleanup trap below if the test passes. If the test doesn't pass,
# this directory will be kept, to facilitate debugging.
- testSubDir=t/$me.dir
+ testSubDir=${argv0#$am_rel_srcdir/}
+ case $testSubDir in
+ */*) testSubDir=${testSubDir%/*}/$me.dir;;
+ *) testSubDir=$me.dir;;
+ esac
test ! -e $testSubDir || rm_rf_ $testSubDir \
|| framework_failure_ "removing old test subdirectory"
- test -d t || mkdir t
- mkdir $testSubDir \
+ $MKDIR_P $testSubDir \
|| framework_failure_ "creating test subdirectory"
# The leading './' is to avoid CDPATH issues.
cd ./$testSubDir \