chiark / gitweb /
dgit: import-dsc: New test for abs/rel dsc component links
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 13 Jan 2019 18:36:18 +0000 (18:36 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 1 Mar 2019 18:06:21 +0000 (18:06 +0000)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
debian/tests/control
tests/tests/import-linkorigs [new file with mode: 0755]

index 6559071..7f0a908 100644 (file)
@@ -68,7 +68,7 @@ Tests: trustingpolicy-replay
 Tests-Directory: tests/tests
 Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc, faketime, dput-ng
 
-Tests: absurd-gitapply badcommit-rewrite build-modes build-modes-long build-modes-source checkout clone-clogsigpipe clone-gitnosuite clone-nogit debpolicy-dbretry debpolicy-newreject debpolicy-quilt-gbp defdistro-rpush defdistro-setup distropatches-reject dpkgsourceignores-correct drs-clone-nogit drs-push-masterupdate drs-push-rejects dsd-clone-nogit dsd-divert fetch-localgitonly fetch-somegit-notlast gbp-orig gitconfig gitworktree import-dsc import-maintmangle import-native import-nonnative import-tarbomb inarchivecopy mismatches-contents mismatches-dscchanges multisuite newtag-clone-nogit oldnewtagalt oldtag-clone-nogit orig-include-exclude orig-include-exclude-chkquery overwrite-chkclog overwrite-junk overwrite-splitbrains overwrite-version pbuilder protocol-compat push-buildproductsdir push-newpackage push-newrepeat push-nextdgit push-source push-source-with-changes quilt quilt-gbp quilt-gbp-build-modes quilt-singlepatch quilt-splitbrains quilt-useremail rpush sourceonlypolicy tag-updates unrepresentable version-opt
+Tests: absurd-gitapply badcommit-rewrite build-modes build-modes-long build-modes-source checkout clone-clogsigpipe clone-gitnosuite clone-nogit debpolicy-dbretry debpolicy-newreject debpolicy-quilt-gbp defdistro-rpush defdistro-setup distropatches-reject dpkgsourceignores-correct drs-clone-nogit drs-push-masterupdate drs-push-rejects dsd-clone-nogit dsd-divert fetch-localgitonly fetch-somegit-notlast gbp-orig gitconfig gitworktree import-dsc import-linkorigs import-maintmangle import-native import-nonnative import-tarbomb inarchivecopy mismatches-contents mismatches-dscchanges multisuite newtag-clone-nogit oldnewtagalt oldtag-clone-nogit orig-include-exclude orig-include-exclude-chkquery overwrite-chkclog overwrite-junk overwrite-splitbrains overwrite-version pbuilder protocol-compat push-buildproductsdir push-newpackage push-newrepeat push-nextdgit push-source push-source-with-changes quilt quilt-gbp quilt-gbp-build-modes quilt-singlepatch quilt-splitbrains quilt-useremail rpush sourceonlypolicy tag-updates unrepresentable version-opt
 Tests-Directory: tests/tests
 Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc, faketime
 
diff --git a/tests/tests/import-linkorigs b/tests/tests/import-linkorigs
new file mode 100755 (executable)
index 0000000..815f960
--- /dev/null
@@ -0,0 +1,60 @@
+#!/bin/bash
+set -e
+. tests/lib
+. $troot/lib-import-chk
+
+t-tstunt-parsechangelog
+
+t-archive-none example
+v=1.0-1
+
+link_src_files () {
+       mkdir $1
+       cp $troot/pkg-srcs/${p}_* $1
+       dscfn=$1/$dscleaf
+}
+
+combo () {
+       case $bpdhow in
+       none)   bpd=..                          ;;
+       abs)    bpd=$tmp/$subdir/bpd            ;;
+       rel)    bpd=../bpd                      ;;
+       *)      x-unknown-bpdhow $bpdhow        ;;
+       esac
+
+       mkdir -p $bpd
+       git config --local dgit.default.build-products-dir $bpd
+
+       dscleaf=${p}_${v}.dsc
+       dscfn=$troot/pkg-srcs/$dscleaf
+
+       case $dschow in
+       abs)                                    ;;
+       rel)    link_src_files ../copies        ;;
+       bpd)    link_src_files $bpd             ;;
+       *)      x-unknown-dschow $dschow        ;;
+       esac
+
+       t-dgit import-dsc $dscfn +import
+       git reset --hard import
+
+       t-dch-commit -v$v.1 -m 'New version'
+       t-dch-commit-r
+       t-dgit build-source
+}
+
+for bpdhow in none rel abs; do
+       for dschow in rel abs; do
+
+               subdir=$bpdhow-$dschow
+               mkdir $subdir
+               cd $subdir
+
+               mkdir $p
+               cd $p
+
+               git init
+               combo
+               cd ../..
+       done
+done