chiark / gitweb /
infra/dgit-ssh-dispatch: New production infra script
[dgit.git] / tests / lib
index 013398750c6a97a98e5915fa91171e663c6efbd6..0073df4123e56ea48014c11e73be87184c42b057 100644 (file)
--- a/tests/lib
+++ b/tests/lib
@@ -3,6 +3,13 @@
 exec 2>&1
 set -x
 
+if [ "x$DGIT_TEST_INTREE" != x ]; then
+       : ${DGIT_TEST:=$DGIT_TEST_INTREE/dgit}
+       : ${DGIT_REPOS_SERVER_TEST:=$DGIT_TEST_INTREE/dgit-repos-server}
+       : ${DGIT_SSH_DISPATCH_TEST:=$DGIT_TEST_INTREE/infra/dgit-ssh-dispatch}
+       export DGIT_TEST DGIT_REPOS_SERVER_TEST DGIT_SSH_DISPATCH_TEST
+fi
+
 root=`pwd`
 troot=$root/tests
 testname="${DGIT_TEST_TESTNAME-${0##*/}}"
@@ -256,10 +263,17 @@ t-drs () {
        cp $root/tests/suites $tmp/.
 }
 
-t-drs-test () {
-       t-drs
+t-chain-test () {
+       local ct=$1
+       local d=${0%/*}
        cd $root
        export DGIT_TEST_TESTNAME="$testname"
        export ADTTMP=$tmp
-       exec "${0///drs-//}" "$@"
+       exec "$d/$ct"
+}      
+
+t-alt-test () {
+       local t=${0##*/}
+       t-${t%%-*}
+       t-chain-test "${t#*-}"
 }