aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-09-23 11:50:45 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-09-23 11:50:45 +0000
commitbe73d69521951b5efe2852d1313d05f3054facab (patch)
treedada81f9a1ae5bac575cc3d5b4a0cdd343579b49 /test
parent71eb5a51c9ab9d8b38eb2f6a1518719e831c798a (diff)
downloadpaludis-be73d69521951b5efe2852d1313d05f3054facab.tar.gz
paludis-be73d69521951b5efe2852d1313d05f3054facab.tar.xz
More Ruby interface
Diffstat (limited to 'test')
-rwxr-xr-xtest/run_test.sh31
1 files changed, 17 insertions, 14 deletions
diff --git a/test/run_test.sh b/test/run_test.sh
index 3dc57a7..bee8b37 100755
--- a/test/run_test.sh
+++ b/test/run_test.sh
@@ -1,33 +1,36 @@
#!/bin/bash
# vim: set ft=sh sw=4 sts=4 et :
-if test -f "$TEST_SCRIPT_DIR""${2:-${1}}"_"setup.sh" ; then
- echo ">>> setup for test ${2:-${1}}"
- if ! "$TEST_SCRIPT_DIR""${2:-${1}}"_"setup.sh" ; then
- echo ">>> exiting with error for test ${2:-${1}}"
+testname=${2:-${1}}
+testname=${testname%.rb}
+
+if test -f "$TEST_SCRIPT_DIR""${testname}"_"setup.sh" ; then
+ echo ">>> setup for test ${testname}"
+ if ! "$TEST_SCRIPT_DIR""${testname}"_"setup.sh" ; then
+ echo ">>> exiting with error for test ${testname}"
exit 255
fi
fi
-echo ">>> test ${2:-${1}}"
+echo ">>> test ${testname}"
if ! ${@} ; then
- if test -f "$TEST_SCRIPT_DIR""${2:-${1}}"_"cleanup.sh" ; then
- echo ">>> cleanup for test ${2:-${1}}"
- "$TEST_SCRIPT_DIR""${2:-${1}}"_"cleanup.sh"
+ if test -f "$TEST_SCRIPT_DIR""${testname}"_"cleanup.sh" ; then
+ echo ">>> cleanup for test ${testname}"
+ "$TEST_SCRIPT_DIR""${testname}"_"cleanup.sh"
fi
- echo ">>> exiting with error for test ${2:-${1}}"
+ echo ">>> exiting with error for test ${testname}"
exit 255
fi
-if test -f "$TEST_SCRIPT_DIR""${2:-${1}}"_"cleanup.sh" ; then
- echo ">>> cleanup for test ${2:-${1}}"
- if ! "$TEST_SCRIPT_DIR""${2:-${1}}"_"cleanup.sh" ; then
- echo ">>> exiting with error for test ${2:-${1}}"
+if test -f "$TEST_SCRIPT_DIR""${testname}"_"cleanup.sh" ; then
+ echo ">>> cleanup for test ${testname}"
+ if ! "$TEST_SCRIPT_DIR""${testname}"_"cleanup.sh" ; then
+ echo ">>> exiting with error for test ${testname}"
exit 255
fi
fi
-echo ">>> exiting with success for test ${2:-${1}}"
+echo ">>> exiting with success for test ${testname}"
exit 0