summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2016-10-23 01:39:34 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2016-10-30 16:36:20 +0000
commit3bbcd7f58885b839778ce9cca4e690c164306418 (patch)
treed3fca9156c060e2e63d350c93abbd7645d340931 /tests
parent326b9679f1ae22dde2016366c699ab6832987855 (diff)
Test suite: orig-include-exclude: Move bulk into a lib-*
We're going to want to re-use it as-is. Well, modulo the introduction of $test_push_2_hook. No functional change. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'tests')
-rw-r--r--tests/lib-orig-include-exclude60
-rwxr-xr-xtests/tests/orig-include-exclude52
2 files changed, 61 insertions, 51 deletions
diff --git a/tests/lib-orig-include-exclude b/tests/lib-orig-include-exclude
new file mode 100644
index 0000000..7c29c96
--- /dev/null
+++ b/tests/lib-orig-include-exclude
@@ -0,0 +1,60 @@
+# designed to be .'d
+
+t-tstunt-parsechangelog
+
+t-archive example 1.0-1
+t-git-none
+
+t-dgit clone $p
+
+origs='orig orig-docs'
+usvsns='1.0 1.1'
+
+for o in $origs; do
+ cp ${p}_{1.0,1.1}.${o}.tar.gz
+done
+
+mkdir -p "$tmp/aq/file_in_archive/%"
+
+cd $p
+
+test-push-1 () {
+ v=$1
+ ch=$2
+
+ t-commit $v $v
+ t-dgit $ch build
+}
+
+test-push-2 () {
+ $test_push_2_hook
+ t-dgit $ch push
+}
+
+test-push-1 1.0-2 --ch:-sa
+
+grep orig ../${p}_${v}_*.changes
+
+test-push-2
+
+# check that dgit stripped out the orig update
+find $tmp/mirror -name '*orig*' -ls >../before
+
+t-archive-process-incoming sid
+
+find $tmp/mirror -name '*orig*' -ls >../after
+diff -u ../before ../after
+
+test-push-1 1.1-1.2 --ch:-sd
+
+test-push-2
+
+t-archive-process-incoming sid
+
+cd ..
+mkdir get
+cd get
+
+t-dgit clone $p
+# ^ checks that all the origs are there, ie that dgit added the origs
+
diff --git a/tests/tests/orig-include-exclude b/tests/tests/orig-include-exclude
index 0276006..b7c7f7f 100755
--- a/tests/tests/orig-include-exclude
+++ b/tests/tests/orig-include-exclude
@@ -2,56 +2,6 @@
set -e
. tests/lib
-t-tstunt-parsechangelog
-
-t-archive example 1.0-1
-t-git-none
-
-t-dgit clone $p
-
-for o in orig orig-docs; do
- cp ${p}_{1.0,1.1}.${o}.tar.gz
-done
-
-cd $p
-
-test-push-1 () {
- v=$1
- ch=$2
-
- t-commit $v $v
- t-dgit $ch build
-}
-
-test-push-2 () {
- t-dgit $ch push
-}
-
-test-push-1 1.0-2 --ch:-sa
-
-grep orig ../${p}_${v}_*.changes
-
-test-push-2
-
-# check that dgit stripped out the orig update
-find $tmp/mirror -name '*orig*' -ls >../before
-
-t-archive-process-incoming sid
-
-find $tmp/mirror -name '*orig*' -ls >../after
-diff -u ../before ../after
-
-test-push-1 1.1-1.2 --ch:-sd
-
-test-push-2
-
-t-archive-process-incoming sid
-
-cd ..
-mkdir get
-cd get
-
-t-dgit clone $p
-# ^ checks that all the origs are there, ie that dgit added the origs
+. $troot/lib-orig-include-exclude
echo done.