summaryrefslogtreecommitdiff
path: root/tests/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests/tests')
-rwxr-xr-xtests/tests/fetch-somegit-notlast2
-rwxr-xr-xtests/tests/gbp-orig42
-rwxr-xr-xtests/tests/tagupl33
-rwxr-xr-xtests/tests/tagupl-baredebian38
-rwxr-xr-xtests/tests/tagupl-gbp28
-rwxr-xr-xtests/tests/tagupl-native1
6 files changed, 99 insertions, 45 deletions
diff --git a/tests/tests/fetch-somegit-notlast b/tests/tests/fetch-somegit-notlast
index 63abe8a..4e42aa3 100755
--- a/tests/tests/fetch-somegit-notlast
+++ b/tests/tests/fetch-somegit-notlast
@@ -10,6 +10,6 @@ t-dgit clone $p
cd $p
t-cloned-fetched-good
-t-has-ancestor debian/3-1
+t-has-ancestor test-dummy/3-1
t-ok
diff --git a/tests/tests/gbp-orig b/tests/tests/gbp-orig
index 9a4937c..c843663 100755
--- a/tests/tests/gbp-orig
+++ b/tests/tests/gbp-orig
@@ -2,49 +2,17 @@
set -e
. tests/lib
-t-tstunt-parsechangelog
-t-tstunt-debuild
-t-tstunt-lintian
-
-t-archive-none example
-t-git-none
-t-worktree 1.0
+t-setup-import gbp
cd $p
-: '----- construct an unpatched branch with patches -----'
-
-git checkout patch-queue/quilt-tip
-gbp pq export
-: 'now on quilt-tip'
-git add debian/patches
-git commit -m 'Commit patch queue'
-
-: '----- construct an upstream branch -----'
-
-git checkout --orphan upstream
-git reset --hard
-git clean -xdf
-
-tar --strip-components=1 -xf $troot/pkg-srcs/${p}_1.0.orig.tar.gz
-
-mkdir docs
-cd docs
-tar --strip-components=1 -xf $troot/pkg-srcs/${p}_1.0.orig-docs.tar.gz
-cd ..
-
-git add -Af .
-git commit -m 'Import 1.0'
-git tag upstream/1.0
-
-git checkout quilt-tip
-t-git-pseudo-merge -m 'gbp-orig pseudomerge' upstream
-
-v=1.0-1
+t-tstunt-parsechangelog
+t-tstunt-debuild
+t-tstunt-lintian
: '----- let gbp build a .orig for comparison -----'
-gbp buildpackage --git-ignore-branch --git-no-sign-tags -us -uc
+gbp buildpackage --git-no-sign-tags -us -uc
mkdir ../gbp-output
mv ../*1.0* ../gbp-output/.
diff --git a/tests/tests/tagupl b/tests/tests/tagupl
index c626c08..9d3e45a 100755
--- a/tests/tests/tagupl
+++ b/tests/tests/tagupl
@@ -23,12 +23,30 @@ git tag $upstreamtag
git checkout -B master quilt-tip-2
+echo foo >bar
+git add bar
+git commit -m"corrupt the upstream source to test upstream-nonidentical check"
+
t-tagupl-settings
tagname=test-dummy/$v
+t-expect-fail "the upstream source in tag $upstreamtag is not identical to the upstream source in refs/heads/master" \
+t-tagupl-test --quilt=gbp --upstream=$upstreamtag
+
+git reset --hard HEAD~1
+
+t-expect-fail "upstream tag $upstreamtag is not an ancestor of refs/heads/master" \
t-tagupl-test --quilt=gbp --upstream=$upstreamtag
+t-expect-fail "upstream tag $upstreamtag is not an ancestor of refs/heads/master" \
+t-tagupl-test --quilt=gbp --force=suite --force=no-such-force-option --upstream=$upstreamtag
+
+t-tagupl-test --quilt=gbp --force=suite --force=no-such-force-option-1 \
+ --force=upstream-nonancestor,no-such-force-option-2 \
+ --upstream=$upstreamtag
+t-pushed-good master
+
# todo: test each miss/rejection
ident=ok
@@ -62,25 +80,26 @@ with-mangled () {
perl <../basetag >../badtag-$ident -pe "$perl"
git tag -u Senatus -f -s -m "$(cat ../badtag-$ident)" "$tagname"
+ LC_MESSAGES=C \
t-tagupl-run-drs $tmp/$p
}
expect-quit () {
next-mangle "$1"
local perl=$2
- local mstring=$3
+ local mregexp=$3
with-mangled "$perl"
- grep ": $mstring" ../tagupl/overall.log
+ egrep ": $mregexp" ../tagupl/overall.log
}
expect-email () {
next-mangle "$1"
local perl=$2
- local mstring=$3
+ local mregexp=$3
with-mangled "$perl"
- grep 'Was not successful' ../sendmail.log
- grep "$mstring" ../sendmail.log
- grep ": failed, emailed" ../tagupl/overall.log
+ egrep 'Was not successful' ../sendmail.log
+ egrep "$mregexp" ../sendmail.log
+ egrep ": failed, emailed" ../tagupl/overall.log
}
raw-mangled () {
@@ -119,7 +138,7 @@ expect-email bupstag1 's/ upstream-tag=/$&:/' \
"failed command: git check-ref-format"
expect-email bupstag2 's/ upstream-tag=/$&x/' \
- "Couldn't find remote ref refs/tags/xUPSTREAM"
+ "[Cc]ouldn't find remote ref refs/tags/xUPSTREAM"
expect-email wrongver '' 'mismatch: changelog Version'
diff --git a/tests/tests/tagupl-baredebian b/tests/tests/tagupl-baredebian
new file mode 100755
index 0000000..b485abb
--- /dev/null
+++ b/tests/tests/tagupl-baredebian
@@ -0,0 +1,38 @@
+#!/bin/bash
+set -e
+. tests/lib
+. $troot/lib-baredebian
+
+t-dependencies quilt git-debpush
+
+t-debpolicy
+
+t-setup-import baredebian
+
+cd $p
+
+baredebian-test-vars
+t-tagupl-settings
+
+baredebian-test-minimum
+baredebian-test-core-prepush
+
+
+sed -i '15icorruption' debian/patches/0002-Edit-the-.c-file.patch
+git add debian/patches/0002-Edit-the-.c-file.patch
+git commit -m"corrupt a quilt patch to test the patches-applicable check"
+
+tagname=test-dummy/$v
+
+t-expect-fail "'git apply' failed to apply patch 0002-Edit-the-.c-file.patch ('patches-applicable' check)" \
+t-tagupl-test --baredebian
+
+git reset --hard HEAD~1
+
+t-tagupl-test --baredebian
+
+git branch split.p dgit/dgit/sid # we didn't generate this here
+
+baredebian-test-core-postpush
+
+t-ok
diff --git a/tests/tests/tagupl-gbp b/tests/tests/tagupl-gbp
new file mode 100755
index 0000000..a4ecb09
--- /dev/null
+++ b/tests/tests/tagupl-gbp
@@ -0,0 +1,28 @@
+#!/bin/bash
+set -e
+. tests/lib
+. $troot/lib-baredebian
+
+t-dependencies git-debpush DEBORIG
+
+t-setup-import gbp
+
+t-debpolicy
+
+cd $p
+
+git deborig
+
+t-dgit -wgf --quilt=gbp --dgit-view-save=split.b quilt-fixup
+
+t-tagupl-settings
+
+tagname=test-dummy/$v
+
+t-tagupl-test --gbp
+
+git branch split.p dgit/dgit/sid # we didn't generate this here
+
+t-gbp-pushed-good sid
+
+t-ok
diff --git a/tests/tests/tagupl-native b/tests/tests/tagupl-native
index 694d879..e8a25c7 100755
--- a/tests/tests/tagupl-native
+++ b/tests/tests/tagupl-native
@@ -25,5 +25,6 @@ git commit -m 'convert to 1.0 native'
tagname=test-dummy/$v
t-tagupl-test
+t-pushed-good master
t-ok