chiark
/
gitweb
/
~ianmdlvl
/
dgit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Test suite: tartree-edit: gitfetchinfo: Specify commit timestamps
[dgit.git]
/
tests
/
lib
diff --git
a/tests/lib
b/tests/lib
index 7cd8062cae3c7d1b6671832bce1197a9d35a587a..7f459aa2cf2f258fc124de9fce0ceeb342ea1ddc 100644
(file)
--- a/
tests/lib
+++ b/
tests/lib
@@
-5,12
+5,16
@@
set -x
set -o pipefail
. tests/lib-core
set -o pipefail
. tests/lib-core
+. tests/lib-restricts
t-set-intree
t-set-intree
-: ${DGIT_TEST_DEBUG
:
=-D}
+: ${DGIT_TEST_DEBUG=-D}
export DGIT_TEST_DEBUG
export DGIT_TEST_DEBUG
+export GIT_COMMITTER_DATE='1440253867 +0100'
+export GIT_AUTHOR_DATE='1440253867 +0100'
+
root=`pwd`
troot=$root/tests
testname="${DGIT_TEST_TESTNAME-${0##*/}}"
root=`pwd`
troot=$root/tests
testname="${DGIT_TEST_TESTNAME-${0##*/}}"
@@
-44,6
+48,11
@@
incoming = $tmp/incoming
run_dinstall = 0
END
run_dinstall = 0
END
+t-git-next-date () {
+ GIT_COMMITTER_DATE="$(( ${GIT_COMMITTER_DATE%% *} + 1 )) ${GIT_COMMITTER_DATE#* }"
+ GIT_AUTHOR_DATE="$GIT_COMMITTER_DATE"
+}
+
t-expect-fail () {
local mpat="$1"; shift
t-expect-fail () {
local mpat="$1"; shift
@@
-58,6
+67,13
@@
t-expect-fail () {
*) fail "tee failed" ;;
esac
*) fail "tee failed" ;;
esac
+ t-grep-mpat "$mpat" $tmp/t.output
+}
+
+t-grep-mpat () {
+ local mpat="$1"
+ local file="$2"
+
local grepper=fgrep
case "$mpat" in
[A-Z]:*)
local grepper=fgrep
case "$mpat" in
[A-Z]:*)
@@
-70,8
+86,8
@@
t-expect-fail () {
;;
esac
;;
esac
- $grepper -e "$mpat"
$tmp/t.output
||
- fail "
error
message not found"
+ $grepper -e "$mpat"
"$file"
||
+ fail "message not found"
}
t-expect-push-fail () {
}
t-expect-push-fail () {
@@
-104,11
+120,12
@@
t-git-objects-not-present () {
t-reporefs () {
local whichoutput=$1; shift
t-reporefs () {
local whichoutput=$1; shift
+ local whichrepo=${1-$dgitrepo}
local outputfile="$tmp/show-refs.$whichoutput"
(set -e
exec >"$outputfile"
local outputfile="$tmp/show-refs.$whichoutput"
(set -e
exec >"$outputfile"
- if test -d $
dgit
repo; then
- cd $
dgit
repo
+ if test -d $
which
repo; then
+ cd $
which
repo
git show-ref |sort
fi)
}
git show-ref |sort
fi)
}
@@
-293,6
+310,15
@@
t-diff-nogit () {
diff --exclude=.git --exclude=.pc -ruN $*
}
diff --exclude=.git --exclude=.pc -ruN $*
}
+t-files-notexist () {
+ local f
+ for f in "$@"; do
+ if [ -e $f ]; then
+ fail "$f exists!"
+ fi
+ done
+}
+
t-cloned-fetched-good () {
t-diff-nogit ../extract/$p-${v%-*} .
t-clean-on-branch dgit/sid
t-cloned-fetched-good () {
t-diff-nogit ../extract/$p-${v%-*} .
t-clean-on-branch dgit/sid
@@
-419,6
+445,16
@@
t-pushed-good () {
git verify-tag `t-v-tag`
}
git verify-tag `t-v-tag`
}
+t-commit-build-push-expect-log () {
+ local msg=$1
+ local mpat=$2
+ t-commit "$msg"
+ t-dgit build
+ LC_MESSAGES=C \
+ t-dgit push --new 2>&1 |tee $tmp/push.log
+ t-grep-mpat "$mpat" $tmp/push.log
+}
+
t-822-field () {
local file=$1
local field=$2
t-822-field () {
local file=$1
local field=$2
@@
-540,14
+576,20
@@
t-policy-nonexist () {
ln -sf no-such-file-or-directory $drs_dispatch/policy-hook
}
ln -sf no-such-file-or-directory $drs_dispatch/policy-hook
}
-t-policy () {
- local policyhook=$1
- policyhook=${DGIT_INFRA_PFX}$policyhook
- case $policyhook in
+t-make-hook-link () {
+ local hook=$1 # in infra/
+ local linkpath=$2
+ hook=${DGIT_INFRA_PFX}$hook
+ case $hook in
*/*) ;;
*/*) ;;
- *)
policyhook=`type -P $policy
hook` ;;
+ *)
hook=`type -P $
hook` ;;
esac
esac
- ln -sf "$policyhook" $drs_dispatch/policy-hook
+ ln -sf "$hook" $linkpath
+}
+
+t-policy () {
+ local policyhook=$1
+ t-make-hook-link $policyhook $drs_dispatch/policy-hook
}
t-debpolicy () {
}
t-debpolicy () {
@@
-563,6
+605,15
@@
t-policy-periodic () {
test-dummy $drs_dispatch '' --cron
}
test-dummy $drs_dispatch '' --cron
}
+t-restrict () {
+ local restriction=$1
+ (cd $root; t-restriction-$restriction >&2)
+}
+
+t-dependencies () {
+ : "Hopefully installed: $*"
+}
+
t-chain-test () {
local ct=$1
local d=${0%/*}
t-chain-test () {
local ct=$1
local d=${0%/*}