summaryrefslogtreecommitdiff
path: root/tests/lib
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib')
-rw-r--r--tests/lib36
1 files changed, 30 insertions, 6 deletions
diff --git a/tests/lib b/tests/lib
index 5d8e742..23daeac 100644
--- a/tests/lib
+++ b/tests/lib
@@ -188,6 +188,8 @@ t-git-merge-base () {
}
t-has-ancestor () {
+ # t-has-ancestor ANCESTOR
+ # (CHILD is implicit, HEAD)
local now=`git rev-parse HEAD`
local ancestor=`git rev-parse $1^{}`
local mbase=`t-git-merge-base $ancestor $now`
@@ -196,6 +198,18 @@ t-has-ancestor () {
fi
}
+t-has-parent-or-is () {
+ # t-has-parent-or-is CHILD PARENT
+ local child=$1
+ local parent=$2
+ local parents=$(git show --pretty=format:' %P %H ' "$child")
+ parent=$(git rev-parse "$parent~0")
+ case "$parents" in
+ *" $parent "*) ;;
+ *) fail "child $child lacks parent $parent" ;;
+ esac
+}
+
t-prep-newpackage () {
t-select-package $1
v=$2
@@ -278,7 +292,7 @@ t-archive-updated () {
t-archive-process-incoming () {
local suite=$1
- mv $tmp/incoming/${p}_${v}[._]* $tmp/mirror/pool/main/
+ mv $tmp/incoming/${p}_* $tmp/mirror/pool/main/
t-archive-query "$suite"
}
@@ -475,17 +489,19 @@ t-ref-head () {
t-ref-same-val () {
local name="$1"
local val=$2
- case "$t_ref_val" in
- '') ;;
+ case "${t_ref_val-unset}" in
+ unset) ;;
"$val") ;;
- *) fail "ref varies: $name:\
- ${val:-nothing} != ${t_ref_val:-nothing}" ;;
+ *) fail "ref varies: ($name)\
+ ${val:-nothing} != ${t_ref_val:-nothing} (${t_ref_names[*]})" ;;
esac
t_ref_val="$val"
+ t_ref_names+=("$name")
}
t-refs-same-start () {
- t_ref_val=''
+ unset t_ref_val
+ t_ref_names=()
}
t-refs-same () {
@@ -573,6 +589,7 @@ t-splitbrain-pushed-good--unpack () {
mkdir t-unpack
cd t-unpack
ln -s $tmp/mirror/pool/main/*.orig*.tar* .
+ ln -s $tmp/incoming/*.orig*.tar* . ||:
ln -s $incoming_dsc .
ln -s ${incoming_dsc/.dsc/.debian.tar}* .
dpkg-source "$@" -x *.dsc
@@ -602,6 +619,13 @@ t-splitbrain-pushed-good-start () {
git merge-base --is-ancestor $dep14tag $dgittag
t-refs-same-start
+ t-ref-same refs/heads/split.p
+ case "$(t-git-get-ref refs/heads/split.b)" in
+ "$t_ref_val") ;;
+ "$(git rev-parse refs/heads/split.p^0)") ;;
+ "$(git rev-parse refs/heads/split.p^1)") ;;
+ *) fail 'bad b/p' ;;
+ esac
t-pushed-good-core
t-incoming-dsc