4 # after tests/tests/some-test has been run (and maybe failed)
5 # cd tests/tmp/some-test/blah
6 # ../../adhoc ../../../dgit some options
8 # after tests/tests/some-test has been run (and maybe failed)
9 # cd tests/tmp/some-test/blah
10 # ../../adhoc some rune run by some piece of infrastructure
13 # directly sets the env variables which arrange to use
14 # programs etc. from the working tree
20 : ${DGIT_TEST_INTREE:=$(realpath "${0%/$ourname}/..")}
23 echo >&2 "$ourname must be invoked as .../$ourname not $0"
28 export DGIT_TEST_INTREE
30 . $DGIT_TEST_INTREE/tests/lib-core
34 pwd=$(realpath "$(pwd)")
35 basis=$DGIT_TEST_INTREE/tests/tmp
37 "$basis" | "$basis"/*)
38 testname=${pwd/"$basis/"/}
39 testname=${testname%%/*}
40 tmp="$basis/$testname"
43 fail "$ourname pwd must be inside some test (in $basis), not $pwd"