chiark / gitweb /
sbuild-gitish: New test case to check running sbuild from git
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 16 Jul 2017 16:51:15 +0000 (17:51 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 18 Jul 2017 20:38:06 +0000 (21:38 +0100)
This involves creating a new "gitish-only" branch in the example
worktree.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
debian/changelog
debian/tests/control
tests/tests/sbuild-gitish [new file with mode: 0755]
tests/worktrees/example_1.0.tar

index 5978c663a65e5630806fba3d6c7dd49f46320f06..aec94185418864276ad789d4a2233993215c3948 100644 (file)
@@ -3,6 +3,9 @@ dgit (4.1~) experimental; urgency=medium
   Internal changes:
   * using-these: New script to help with ad-hoc-testing.
 
+  Test suite:
+  * sbuild-gitish: New test case to check running sbuild from git
+
  --
 
 dgit (4.0) experimental; urgency=low
index 0df610e769e631048da1d4e7e9d955aa71029b76..04095cb272dabdbef95fd9c28fb1b4f6c59aa37f 100644 (file)
@@ -19,7 +19,7 @@ Tests: defdistro-mirror mirror mirror-debnewgit mirror-private
 Tests-Directory: tests/tests
 Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, rsync
 
-Tests: build-modes-sbuild quilt-gbp-build-modes-sbuild
+Tests: build-modes-sbuild quilt-gbp-build-modes-sbuild sbuild-gitish
 Tests-Directory: tests/tests
 Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, sbuild
 Restrictions: x-dgit-schroot-build
diff --git a/tests/tests/sbuild-gitish b/tests/tests/sbuild-gitish
new file mode 100755 (executable)
index 0000000..c20bc93
--- /dev/null
@@ -0,0 +1,36 @@
+#!/bin/bash
+set -e
+. tests/lib
+
+t-dependencies sbuild
+t-restrict x-dgit-schroot-build
+
+t-tstunt-parsechangelog
+
+t-prep-newpackage example 1.1
+
+cd $p
+
+build () {
+       git clean -xdf
+       sbuild -c build -A --no-clean-source \
+               --dpkg-source-opts='-Zgzip -z1 --format=1.0 -sn'
+}
+
+git checkout quilt-tip-1.1~0
+
+build
+
+git checkout gitish-only~0
+
+cat <<'END' >clean-target-hook
+#!/bin/sh
+set -ex
+test "$SCHROOT_SESSION_ID"
+END
+git add clean-target-hook
+git commit -m 'insist on schroot'
+
+build
+
+t-ok
index 6f66a915eb6082dfb3d20b85727710cadc51ab3e..fe108d11aafef68cbd24ac543a6644adfececcae 100644 (file)
Binary files a/tests/worktrees/example_1.0.tar and b/tests/worktrees/example_1.0.tar differ