chiark / gitweb /
Test suite: quilt-gbp-build-modes: Lift bulk into lib-build-modes
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 19 Sep 2016 00:59:31 +0000 (01:59 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 25 Sep 2016 19:12:52 +0000 (20:12 +0100)
To split the sbuild test out, we want this to be reusable.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
tests/lib-build-modes
tests/tests/quilt-gbp-build-modes

index 007eaf2..4b0f944 100644 (file)
@@ -38,6 +38,28 @@ bm-prep () {
        cleanmodes="$cleanmodes_default"
 }
 
+bm-gbp-example-acts () {
+       t-gbp-example-prep
+
+       git checkout -b for-build-modes qc/quilt-tip-2
+       # build-modes cannot cope with branches containing /
+
+       bm-prep-ownpackage-branches for-build-modes
+
+       cleanmodes='git dpkg-source'
+
+       for act in "$@"; do
+               bm-guess-e-source-e-targets "$act"
+               real_act="--quilt=gbp $act"
+               case "$act" in
+               sbuild*)    bm_quirk_after_act=bm-quirk-sbuild-after-act ;;
+               gbp-*)      real_act="$real_act --git-ignore-branch" ;;
+               *)          bm_quirk_after_act='' ;;
+               esac
+               bm-act-iterate
+       done
+}
+
 bm-guess-e-source-e-targets () {
        local some_act=$1
        case "$some_act" in
index a061c4b..8f488bb 100755 (executable)
@@ -6,31 +6,12 @@ set -e
 t-dependencies sbuild
 t-restrict x-dgit-schroot-build
 
-t-gbp-example-prep
-
-git checkout -b for-build-modes qc/quilt-tip-2
-# build-modes cannot cope with branches containing /
-
-bm-prep-ownpackage-branches for-build-modes
-
-cleanmodes='git dpkg-source'
-
-for act in                                     \
+bm-gbp-example-acts                            \
        'build-source'                          \
        'build -b'                              \
        'build -S'                              \
        'gbp-build -S'                          \
        'gbp-build -b'                          \
        'sbuild -c build --arch-all'            \
-; do
-       bm-guess-e-source-e-targets "$act"
-       real_act="--quilt=gbp $act"
-       case "$act" in
-       sbuild*)    bm_quirk_after_act=bm-quirk-sbuild-after-act ;;
-       gbp-*)      real_act="$real_act --git-ignore-branch" ;;
-       *)          bm_quirk_after_act='' ;;
-       esac
-       bm-act-iterate
-done
 
 echo ok.