summaryrefslogtreecommitdiff
path: root/tests/lib
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2016-07-01 23:37:55 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2016-07-01 23:53:10 +0100
commitae6f73de56d388b235980c765acbdb2e205c332e (patch)
tree4d092602363f564bcfe3a787172a61c102e0bcbc /tests/lib
parent8b21e27c6d1fb3d3d7c1da290f2e6f3bc278b40a (diff)
Set GIT_COMMITTER_DATE and GIT_AUTHOR_DATE
This avoids most date dependencies: unless other measures are taken, the commits and tags are identical iff they are constructed identically. This makes the test suite more deterministic. In drs-push-rejects test, increment them explicitly, so as to make all of mktag's tags distinct objects. Otherwise it can generate identical tags (now, always; previously, only sometimes on fast computers), causing spurious variations in behaviour (eg, things not being rejected because they do not represent any change).
Diffstat (limited to 'tests/lib')
-rw-r--r--tests/lib8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/lib b/tests/lib
index 9308b16..7f459aa 100644
--- a/tests/lib
+++ b/tests/lib
@@ -12,6 +12,9 @@ t-set-intree
: ${DGIT_TEST_DEBUG=-D}
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##*/}}"
@@ -45,6 +48,11 @@ incoming = $tmp/incoming
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