chiark / gitweb /
dgit-nmu-simple(7): Cannot yet use DELAYED
[dgit.git] / tests / lib-core
1 #
2
3 fail () {
4         echo >&2 "failed: $*"
5         exit 1
6 }
7
8 t-set-intree () {
9         if [ "x$DGIT_TEST_INTREE" = x ]; then return; fi
10         : ${DGIT_TEST:=$DGIT_TEST_INTREE/dgit}
11         : ${DGIT_REPOS_SERVER_TEST:=$DGIT_TEST_INTREE/infra/dgit-repos-server}
12         : ${DGIT_SSH_DISPATCH_TEST:=$DGIT_TEST_INTREE/infra/dgit-ssh-dispatch}
13         : ${DGIT_INFRA_PFX:=$DGIT_TEST_INTREE${DGIT_TEST_INTREE:+/infra/}}
14         export DGIT_TEST DGIT_REPOS_SERVER_TEST DGIT_SSH_DISPATCH_TEST
15         export PERLLIB="$DGIT_TEST_INTREE${PERLLIB:+:}${PERLLIB}"
16 }
17
18 t-set-using-tmp () {
19         export HOME=$tmp
20         export DGIT_TEST_DUMMY_DIR=$tmp
21         export DGIT_TEST_TMP=$tmp
22         export GNUPGHOME=$tmp/nonexistent
23 }
24
25 t-filter-out-git-hyphen-dir () {
26         local pathent=$(type -p git-rev-parse ||:)
27         case "$pathent" in '') return ;; esac
28         pathent=${pathent%/*}
29         local path=":$PATH:"
30         path="${path//:$pathent:/}"
31         path="${path#:}"
32         path="${path%:}"
33         PATH="$path"
34 }