summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2019-06-29 15:51:12 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2019-06-30 21:11:17 +0100
commit173b552549446518c223d805ee610656d79fa1ea (patch)
treeffde4ce4787128e3be216d76c46c994ecf1c27fd /tests
parent7eae06198ec91f27d40fb92267ff3dfde4d42495 (diff)
test suite: baredebian: break out lib-baredebian, baredebian-test
No functional change. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'tests')
-rw-r--r--tests/lib-baredebian64
-rwxr-xr-xtests/tests/baredebian-push63
2 files changed, 66 insertions, 61 deletions
diff --git a/tests/lib-baredebian b/tests/lib-baredebian
new file mode 100644
index 0000000..f3ee03e
--- /dev/null
+++ b/tests/lib-baredebian
@@ -0,0 +1,64 @@
+#
+
+baredebian-test () {
+ t-expect-fail 'contradicts clean mode git-ff' \
+ t-dgit -wgf --dgit-view-save=split.f1 --baredebian quilt-fixup
+
+ t-dgit -wn --dgit-view-save=split.f1 --baredebian quilt-fixup
+
+ v=1.0-1
+ suite=sid
+
+ tar --strip-components=1 -axf ../${p}_${v%-*}.orig.tar.*
+
+ cd debian
+ git clean -xdff
+ git checkout HEAD -- .
+ cd ..
+
+ # Now we are in this insane state that people seem to expect
+
+ export QUILT_PATCHES=debian/patches
+ quilt push -a
+
+ git add -Af .
+ git reset .pc
+ git diff --cached --exit-code split.f1 -- :/ :!/debian
+ git diff --exit-code HEAD..split.f1 -- :/debian
+ git reset
+
+ quilt new made-with-quilt
+ quilt add src.c
+ echo //omg >>src.c
+ quilt refresh
+
+ git add debian/patches/.
+ t-commit 'extra patch made with quilt' 1.0-2
+
+ dpkg-buildpackage -uc -us --build=source
+ # ^ Do this by hand here not because we expect users to do this
+ # (rather than dgit build), but so that we can check that our
+ # output is the same as users are used to.
+
+ t-dgit -wn --quilt=baredebian --dgit-view-save=split.b quilt-fixup
+ t-dgit -wn --quilt=baredebian --dgit-view-save=split.p --new push
+
+ git merge-base --is-ancestor v${v%-*} split.p
+ git merge-base --is-ancestor HEAD split.p
+ set +e; git merge-base HEAD v${v%-*}; rc=$?; set -e; [ $rc = 1 ]
+
+ git clean -xdff
+ # t-pushed-good-* wants a clean tree to start with, but this
+ # workflow expects a mess
+
+ t-splitbrain-pushed-good-start
+ t-splitbrain-pushed-good--unpack
+
+ find . -mindepth 1 -maxdepth 1 \
+ \! -path ./debian \
+ \! -path ./.git \
+ -print0 \
+ | xargs -0r rm -rf --
+
+ t-splitbrain-pushed-good-end-made-dep14
+}
diff --git a/tests/tests/baredebian-push b/tests/tests/baredebian-push
index bfbf9e9..d0ecf93 100755
--- a/tests/tests/baredebian-push
+++ b/tests/tests/baredebian-push
@@ -1,6 +1,7 @@
#!/bin/bash
set -e
. tests/lib
+. $troot/lib-baredebian
t-dependencies GDR DEBORIG quilt
@@ -8,66 +9,6 @@ t-setup-import baredebian
t-tstunt-parsechangelog
cd $p
-
-t-expect-fail 'contradicts clean mode git-ff' \
-t-dgit -wgf --dgit-view-save=split.f1 --baredebian quilt-fixup
-
-t-dgit -wn --dgit-view-save=split.f1 --baredebian quilt-fixup
-
-v=1.0-1
-suite=sid
-
-tar --strip-components=1 -axf ../${p}_${v%-*}.orig.tar.*
-
-cd debian
-git clean -xdff
-git checkout HEAD -- .
-cd ..
-
-# Now we are in this insane state that people seem to expect
-
-export QUILT_PATCHES=debian/patches
-quilt push -a
-
-git add -Af .
-git reset .pc
-git diff --cached --exit-code split.f1 -- :/ :!/debian
-git diff --exit-code HEAD..split.f1 -- :/debian
-git reset
-
-quilt new made-with-quilt
-quilt add src.c
-echo //omg >>src.c
-quilt refresh
-
-git add debian/patches/.
-t-commit 'extra patch made with quilt' 1.0-2
-
-dpkg-buildpackage -uc -us --build=source
-# ^ Do this by hand here not because we expect users to do this
-# (rather than dgit build), but so that we can check that our
-# output is the same as users are used to.
-
-t-dgit -wn --quilt=baredebian --dgit-view-save=split.b quilt-fixup
-t-dgit -wn --quilt=baredebian --dgit-view-save=split.p --new push
-
-git merge-base --is-ancestor v${v%-*} split.p
-git merge-base --is-ancestor HEAD split.p
-set +e; git merge-base HEAD v${v%-*}; rc=$?; set -e; [ $rc = 1 ]
-
-git clean -xdff
-# t-pushed-good-* wants a clean tree to start with, but this
-# workflow expects a mess
-
-t-splitbrain-pushed-good-start
-t-splitbrain-pushed-good--unpack
-
-find . -mindepth 1 -maxdepth 1 \
- \! -path ./debian \
- \! -path ./.git \
- -print0 \
- | xargs -0r rm -rf --
-
-t-splitbrain-pushed-good-end-made-dep14
+baredebian-test
t-ok