diff --git a/src/test/tpkg/100-compile.tpkg/100-compile.pre b/src/test/tpkg/100-compile.tpkg/100-compile.pre index e0840f65..1c71f4c7 100644 --- a/src/test/tpkg/100-compile.tpkg/100-compile.pre +++ b/src/test/tpkg/100-compile.tpkg/100-compile.pre @@ -1,6 +1,15 @@ # #-- 100-compile.pre--# # source the master var file when it's there -[ -f ../.tpkg.var.master ] && source ../.tpkg.var.master +if [ -f ../.tpkg.var.master ] +then + source ../.tpkg.var.master +else + ( + cd .. + [ -f "${TPKG_SRCDIR}/setup-env.sh" ] \ + && sh "${TPKG_SRCDIR}/setup-env.sh" + ) && source ../.tpkg.var.master +fi # use .tpkg.var.test for in test variable passing [ -f .tpkg.var.test ] && source .tpkg.var.test diff --git a/src/test/tpkg/200-stub-only-compile.tpkg/200-stub-only-compile.pre b/src/test/tpkg/200-stub-only-compile.tpkg/200-stub-only-compile.pre index 77d59847..e95a7446 100644 --- a/src/test/tpkg/200-stub-only-compile.tpkg/200-stub-only-compile.pre +++ b/src/test/tpkg/200-stub-only-compile.tpkg/200-stub-only-compile.pre @@ -1,6 +1,15 @@ # #-- 200-stub-only-compile.pre--# # source the master var file when it's there -[ -f ../.tpkg.var.master ] && source ../.tpkg.var.master +if [ -f ../.tpkg.var.master ] +then + source ../.tpkg.var.master +else + ( + cd .. + [ -f "${TPKG_SRCDIR}/setup-env.sh" ] \ + && sh "${TPKG_SRCDIR}/setup-env.sh" + ) && source ../.tpkg.var.master +fi # use .tpkg.var.test for in test variable passing [ -f .tpkg.var.test ] && source .tpkg.var.test diff --git a/src/test/tpkg/300-event-loops-compile.tpkg/300-event-loops-compile.pre b/src/test/tpkg/300-event-loops-compile.tpkg/300-event-loops-compile.pre index 85bbe341..87dfe2c6 100644 --- a/src/test/tpkg/300-event-loops-compile.tpkg/300-event-loops-compile.pre +++ b/src/test/tpkg/300-event-loops-compile.tpkg/300-event-loops-compile.pre @@ -1,6 +1,15 @@ # #-- 300-event-loops-compile.pre--# # source the master var file when it's there -[ -f ../.tpkg.var.master ] && source ../.tpkg.var.master +if [ -f ../.tpkg.var.master ] +then + source ../.tpkg.var.master +else + ( + cd .. + [ -f "${TPKG_SRCDIR}/setup-env.sh" ] \ + && sh "${TPKG_SRCDIR}/setup-env.sh" + ) && source ../.tpkg.var.master +fi # use .tpkg.var.test for in test variable passing [ -f .tpkg.var.test ] && source .tpkg.var.test diff --git a/src/test/tpkg/setup-env.sh b/src/test/tpkg/setup-env.sh index 931aa5f3..8a23fc71 100755 --- a/src/test/tpkg/setup-env.sh +++ b/src/test/tpkg/setup-env.sh @@ -7,6 +7,14 @@ export BUILDDIR=`pwd` export BUILDROOT=`(cd "${BUILDDIR}/../../.."; pwd)` export LIBTOOL="${BUILDROOT}/libtool" +if [ ! -f "${SRCROOT}/libtool" ] +then + (cd "${SRCROOT}"; libtoolize -fic) +fi +if [ ! -f "${SRCROOT}/configure" ] +then + (cd "${SRCROOT}"; autoreconf -fi) +fi if [ -f .tpkg.var.master ] then cat .tpkg.var.master \ diff --git a/src/test/tpkg/tpkg b/src/test/tpkg/tpkg index ab825b53..7bab54a1 100755 --- a/src/test/tpkg/tpkg +++ b/src/test/tpkg/tpkg @@ -494,8 +494,8 @@ if [ -z "${archive}" ]; then fi testname=`basename "${archive}" .tpkg` -testpath=`dirname "${archive}"` -test_pkg="${testpath}/${testname}.tpkg" +export TPKG_SRCDIR=`dirname "${archive}"` +test_pkg="${TPKG_SRCDIR}/${testname}.tpkg" dsc_file=$testname.dsc if [ -z $testname ]; then err "[fatal] The test package should have a .tpkg extension. Abort." @@ -785,8 +785,8 @@ done # if we depend on another test to that one first and then return for deptest in ${dsc_depends}; do cd .. # go up one dir - out "[log] executing dependency test: ${testpath}/${deptest}" - ${SHELL} $0 "-b ${TPKG_BASE}" exe "${testpath}/${deptest}" + out "[log] executing dependency test: ${TPKG_SRCDIR}/${deptest}" + ${SHELL} $0 "-b ${TPKG_BASE}" exe "${TPKG_SRCDIR}/${deptest}" test_result=$? cd - > /dev/null # back where we belong if [ $test_result -ne 0 ]; then