aboutsummaryrefslogtreecommitdiff
path: root/test/run_test.sh
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-11-03 21:21:36 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-11-03 21:21:36 +0000
commita3da76a7780eb98017b185127693962316fd12ac (patch)
tree0dd3b22916f2868705032e71a47c8a0547d54a9b /test/run_test.sh
parent262df8c46ae1fee336bfa93f1381adf8d9387f7a (diff)
downloadpaludis-a3da76a7780eb98017b185127693962316fd12ac.tar.gz
paludis-a3da76a7780eb98017b185127693962316fd12ac.tar.xz
Make parallel tests betterer
Diffstat (limited to 'test/run_test.sh')
-rwxr-xr-xtest/run_test.sh46
1 files changed, 22 insertions, 24 deletions
diff --git a/test/run_test.sh b/test/run_test.sh
index 0c435ac57..62e3da032 100755
--- a/test/run_test.sh
+++ b/test/run_test.sh
@@ -2,66 +2,64 @@
# vim: set ft=sh sw=4 sts=4 et :
testname=${2:-${1}}
+interp=
+[[ ${testname%.py} != ${testname} ]] && interp="${PYTHON}"
+[[ ${testname%.rb} != ${testname} ]] && interp="${RUBY} -I ./.libs/"
+
testname=${testname%.rb}
testname=${testname%.py}
testname=${testname%.bash}
-TEST_OUTPUT_WRAPPER="${OVERRIDE_TEST_OUTPUT_WRAPPER-${TEST_OUTPUT_WRAPPER}}"
+[[ -z "PALUDIS_TESTS_REAL_STDOUT_FD" ]] && export PALUDIS_TESTS_REAL_STDOUT_FD=1
if test -f "$TEST_SCRIPT_DIR""${testname}"_"cleanup.sh" ; then
- echo ">>> cleanup for test ${testname}"
+ echo ">>> cleanup for test ${testname}" 1>&$PALUDIS_TESTS_REAL_STDOUT_FD
if ! "$TEST_SCRIPT_DIR""${testname}"_"cleanup.sh" ; then
- echo ">>> exiting with error for test ${testname}"
+ echo ">>> exiting with error for test ${testname}" 1>&$PALUDIS_TESTS_REAL_STDOUT_FD
exit 255
fi
else
- echo ">>> No $TEST_SCRIPT_DIR${testname}_cleanup.sh to run"
+ echo ">>> No $TEST_SCRIPT_DIR${testname}_cleanup.sh to run" 1>&$PALUDIS_TESTS_REAL_STDOUT_FD
fi
if test -f "$TEST_SCRIPT_DIR""${testname}"_"setup.sh" ; then
- echo ">>> setup for test ${testname}"
+ echo ">>> setup for test ${testname}" 1>&$PALUDIS_TESTS_REAL_STDOUT_FD
if ! "$TEST_SCRIPT_DIR""${testname}"_"setup.sh" ; then
- echo ">>> exiting with error for test ${testname}"
+ echo ">>> exiting with error for test ${testname}" 1>&$PALUDIS_TESTS_REAL_STDOUT_FD
exit 255
fi
else
- echo ">>> No $TEST_SCRIPT_DIR${testname}_setup.sh to run"
+ echo ">>> No $TEST_SCRIPT_DIR${testname}_setup.sh to run" 1>&$PALUDIS_TESTS_REAL_STDOUT_FD
fi
-echo ">>> test ${testname}"
-if [[ -n "${TEST_OUTPUT_WRAPPER}" ]] ; then
- $TEST_OUTPUT_WRAPPER --stdout-prefix "${testname#./}> " --stderr-prefix \
- "${testname#./}> " --wrap-blanks -- ${@}
- code=$?
-else
- ${@}
- code=$?
-fi
+echo ">>> test ${testname}" 1>&$PALUDIS_TESTS_REAL_STDOUT_FD 1>&$PALUDIS_TESTS_REAL_STDOUT_FD
+$interp ${@}
+code=$?
if [[ 0 != ${code} ]] ; then
- echo ">>> test ${testname} returned ${code}"
+ echo ">>> test ${testname} returned ${code}" 1>&$PALUDIS_TESTS_REAL_STDOUT_FD
if [[ -z "${PALUDIS_TESTS_RERUN_VERBOSELY}" ]] && [[ "${testname#./}" != "test_fail_TEST" ]] ; then
out=`pwd`/${testname#./}.epicfail
- echo ">>> rerunning test ${testname} verbosely redirected to ${out}"
+ echo ">>> rerunning test ${testname} verbosely redirected to ${out}" 1>&$PALUDIS_TESTS_REAL_STDOUT_FD
env PALUDIS_TESTS_RERUN_VERBOSELY=no PALUDIS_TESTS_KEEP_STDERR=yes \
PALUDIS_TESTS_KEEP_LOG=yes TEST_OUTPUT_WRAPPER= $0 $@ > $out 2>&1
- echo ">>> saved output of verbose ${testname} rerun to ${out}"
+ echo ">>> saved output of verbose ${testname} rerun to ${out}" 1>&$PALUDIS_TESTS_REAL_STDOUT_FD
fi
- echo ">>> exiting with error for test ${testname}"
+ echo ">>> exiting with error for test ${testname}" 1>&$PALUDIS_TESTS_REAL_STDOUT_FD
exit 255
fi
if test -f "$TEST_SCRIPT_DIR""${testname}"_"cleanup.sh" ; then
- echo ">>> cleanup for test ${testname}"
+ echo ">>> cleanup for test ${testname}" 1>&$PALUDIS_TESTS_REAL_STDOUT_FD
if ! "$TEST_SCRIPT_DIR""${testname}"_"cleanup.sh" ; then
- echo ">>> exiting with error for test ${testname}"
+ echo ">>> exiting with error for test ${testname}" 1>&$PALUDIS_TESTS_REAL_STDOUT_FD
exit 255
fi
else
- echo ">>> No $TEST_SCRIPT_DIR${testname}_cleanup.sh to run"
+ echo ">>> No $TEST_SCRIPT_DIR${testname}_cleanup.sh to run" 1>&$PALUDIS_TESTS_REAL_STDOUT_FD
fi
-echo ">>> exiting with success for test ${testname}"
+echo ">>> exiting with success for test ${testname}" 1>&$PALUDIS_TESTS_REAL_STDOUT_FD
exit 0