summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/lib21
-rw-r--r--tests/lib-gdr2
-rwxr-xr-xtests/playtree-save-refs9
-rwxr-xr-xtests/setup/examplegit2
-rwxr-xr-xtests/setup/gdr-convert-gbp8
-rwxr-xr-xtests/setup/gnupg2
-rwxr-xr-xtests/tests/gdr-diverge-nmu-dgit2
-rwxr-xr-xtests/tests/gdr-edits2
-rwxr-xr-xtests/tests/gdr-import-dgit2
9 files changed, 37 insertions, 13 deletions
diff --git a/tests/lib b/tests/lib
index 4ef275c..99345ce 100644
--- a/tests/lib
+++ b/tests/lib
@@ -17,6 +17,8 @@ funcs: ${FUNCNAME[*]}
lines: ${BASH_LINENO[*]}
files: ${BASH_SOURCE[*]}
END
+ t-save-artifacts
+
exit 16
}
@@ -409,9 +411,18 @@ t-fscks () {
t-ok () {
: '========================================'
t-fscks
+ t-save-artifacts
echo ok.
}
+t-save-artifacts () {
+ artifacts="$AUTOPKGTEST_ARTIFACTS"
+ if [ x"$artifacts" = x ]; then return; fi
+ if [ x"tmp" = x ]; then return; fi
+ GZIP=-1v tar -C "$tmp" -zc -f "$artifacts/${0##*/}.tar.gz" \
+ --exclude=\*.tar .
+}
+
t-rm-dput-dropping () {
rm -f $tmp/${p}_${v}_*.upload
}
@@ -1006,6 +1017,16 @@ t-commit () {
revision=$(( ${revision-0} + 1 ))
}
+t-dch-r-rune () {
+ local cmd="$1"; shift
+ local suite=${1-unstable}
+ $cmd -r -D "$suite" ''
+}
+
+t-dch-commit-r () {
+ t-dch-r-rune t-dch-commit "$@"
+}
+
t-dch-commit () {
faketime @"${GIT_AUTHOR_DATE% *}" dch "$@"
git commit -m "dch $*" debian/changelog
diff --git a/tests/lib-gdr b/tests/lib-gdr
index 22ea6d1..95d2330 100644
--- a/tests/lib-gdr
+++ b/tests/lib-gdr
@@ -222,7 +222,7 @@ t-nmu-upload-2 () {
}
t-nmu-upload-3 () {
- t-dch-commit -r sid
+ t-dch-commit-r
t-dgit -wgf build-source
diff --git a/tests/playtree-save-refs b/tests/playtree-save-refs
new file mode 100755
index 0000000..7841367
--- /dev/null
+++ b/tests/playtree-save-refs
@@ -0,0 +1,9 @@
+#!/bin/bash
+set -e
+set -o pipefail
+find -name .git -type d -exec sh -xec '
+ cd "$1"
+ git for-each-ref \
+ --format='\''update refs/dgit-test-keep/g%(objectname) %(objectname)'\'' \
+' x "{}" \; | \
+ sort -u | git update-ref --stdin
diff --git a/tests/setup/examplegit b/tests/setup/examplegit
index 112e27a..48864d4 100755
--- a/tests/setup/examplegit
+++ b/tests/setup/examplegit
@@ -49,5 +49,3 @@ t-commit Sid
push-to master sid
t-setup-done 'p v suitespecs majorv revision' "aq git mirror $p"
-
-t-ok
diff --git a/tests/setup/gdr-convert-gbp b/tests/setup/gdr-convert-gbp
index e523fd3..6ec374d 100755
--- a/tests/setup/gdr-convert-gbp
+++ b/tests/setup/gdr-convert-gbp
@@ -64,7 +64,7 @@ gbp import-orig --upstream-version=2.0 ../$ust
not-gdr-processable
t-dch-commit -v 2.0-1 -m 'new upstream (did gbp import-orig)'
-t-dch-commit -r sid
+t-dch-commit-r
$ifarchive t-archive-none $p
$ifarchive t-git-none
@@ -84,9 +84,9 @@ t-git-debrebase -fupstream-has-debian convert-from-gbp
v=2.0-2
t-dch-commit -v $v -m 'switch to git-debrebase, no other changes'
-t-dch-commit -r sid
+t-dch-commit-r
-$ifarchive t-dgit -wgf push-source --new --overwrite
+$ifarchive t-dgit -wgf push-source --new
git push
cd ..
@@ -99,5 +99,3 @@ t-setup-done '' "$(echo $p*) salsa $($ifarchive echo git mirror aq)" '
p=example
t-git-next-date
'
-
-t-ok
diff --git a/tests/setup/gnupg b/tests/setup/gnupg
index 7a164ef..56e4e66 100755
--- a/tests/setup/gnupg
+++ b/tests/setup/gnupg
@@ -30,5 +30,3 @@ gpg --list-secret
t-setup-done 'DGIT_TEST_GNUPG_GLOBAL_LOCK DGIT_TEST_GNUPG_LOG' \
'gnupg' "$setup"
-
-t-ok
diff --git a/tests/tests/gdr-diverge-nmu-dgit b/tests/tests/gdr-diverge-nmu-dgit
index 4b5907a..1d136a9 100755
--- a/tests/tests/gdr-diverge-nmu-dgit
+++ b/tests/tests/gdr-diverge-nmu-dgit
@@ -28,7 +28,7 @@ t-git-next-date
v=2.0-2+nmu1
t-nmu-commit-an-upstream-change
t-dch-commit -v$v -m finalise
-t-dch-commit -r sid
+t-dch-commit-r
t-dgit -wgf push-source
diff --git a/tests/tests/gdr-edits b/tests/tests/gdr-edits
index 6c77184..52c083b 100755
--- a/tests/tests/gdr-edits
+++ b/tests/tests/gdr-edits
@@ -16,7 +16,7 @@ cat ../anal.1
t-some-changes edits
-t-dch-commit -r sid
+t-dch-commit-r
git tag t.before
diff --git a/tests/tests/gdr-import-dgit b/tests/tests/gdr-import-dgit
index 19918d8..c18c097 100755
--- a/tests/tests/gdr-import-dgit
+++ b/tests/tests/gdr-import-dgit
@@ -40,7 +40,7 @@ nmu-fold
v=2.0-3
t-dch-commit -v $v -m "incorporate nmu"
-t-dch-commit -r sid
+t-dch-commit-r
t-dgit -wgf push-source
: 'now test a new upstream'