chiark / gitweb /
autopkgtests: Provide tests/lib, and one pari-extra based clone test.
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 16 Nov 2013 16:50:29 +0000 (16:50 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 24 Nov 2013 17:45:26 +0000 (17:45 +0000)
.gitignore
debian/changelog
debian/copyright
tests/lib [new file with mode: 0644]
tests/pkg-srcs/pari-extra_3-1.diff.gz [new file with mode: 0644]
tests/pkg-srcs/pari-extra_3-1.dsc [new file with mode: 0644]
tests/pkg-srcs/pari-extra_3.orig.tar.gz [new file with mode: 0644]
tests/tests/clone-nogit [new file with mode: 0755]

index 1632e2a..737875f 100644 (file)
@@ -1,4 +1,5 @@
 *~
+tests/tmp
 debian/dgit
 debian/files
 debian/*.substvars
index ff334e4..f2b6126 100644 (file)
@@ -3,6 +3,7 @@ dgit (0.19~experimental1) experimental; urgency=low
   Testing facilities:
   * Provide "test-dummy" distro with "dummycat" access method.
   * Provide fake "ssh" program in tests/ which does nothing much.
+  * Provide tests/lib, and one pari-extra based clone test.
 
  --
 
index 461cbfd..081ff31 100644 (file)
@@ -15,3 +15,9 @@ GNU General Public License for more details.
 
 A copy of the GNU General Public License v3 can be found in
 /usr/share/common-licenses/GPL-3.
+
+
+The tests/ directory contains a complete copy of the source code for
+the pari-extra 3-1 package.  This is a dummy package containing only
+Debian metadata, by Bill Alombert, with a licence statement saying
+it's GPL (implicitly GPLv3 compatible).
diff --git a/tests/lib b/tests/lib
new file mode 100644 (file)
index 0000000..509989a
--- /dev/null
+++ b/tests/lib
@@ -0,0 +1,64 @@
+#
+
+exec 2>&1
+
+root=`pwd`
+troot=$root/tests
+testname="${0##*/}"
+
+tmp=$ADTTMP
+if [ x"$tmp" = x ]; then
+       mkdir -p tests/tmp
+       tmp=tests/tmp/$testname
+       rm -rf $tmp
+       mkdir $tmp
+fi
+cd $tmp
+tmp=`pwd`
+export DGIT_TEST_DUMMY_DIR=$tmp
+ln $troot/ssh ssh
+
+t-git () {
+       mkdir -p git
+       cp -al $troot/git-srcs/$1 git/.
+}
+
+t-archive () {
+       p=$1
+       mkdir -p aq mirror
+       local dscf=${p}_$2.dsc
+       ln $troot/pkg-srcs/${p}_${2%-*}* mirror/
+       echo sid >aq/suite.unstable
+       echo "$2 $dscf" >>aq/package.sid.${p}
+       mkdir extract
+       (set -e; cd extract; dpkg-source -x ../mirror/$dscf)
+}
+
+t-dgit () {
+       ${DGIT_TEST-dgit} --dget:-u -dtest-dummy "$@"
+}
+
+t-diff-nogit () {
+       diff --exclude=.git -ruN $*
+}
+
+t-output () {
+       printf "%s\n" "$1" >$tmp/t.want
+       shift
+       "$@" >$tmp/t.got
+       diff $tmp/t.want $tmp/t.got
+}
+
+t-clean-on-branch () {
+       t-output "## $1" git status -b --porcelain
+}
+
+t-refs-same () {
+       local f=$1
+       git rev-parse $f >$tmp/t.ref1
+       local g
+       for g in $*; do
+               git rev-parse $g >$tmp/t.refn
+               diff $tmp/t.ref1 $tmp/t.refn
+       done
+}
diff --git a/tests/pkg-srcs/pari-extra_3-1.diff.gz b/tests/pkg-srcs/pari-extra_3-1.diff.gz
new file mode 100644 (file)
index 0000000..81f7f2e
Binary files /dev/null and b/tests/pkg-srcs/pari-extra_3-1.diff.gz differ
diff --git a/tests/pkg-srcs/pari-extra_3-1.dsc b/tests/pkg-srcs/pari-extra_3-1.dsc
new file mode 100644 (file)
index 0000000..8d67ed0
--- /dev/null
@@ -0,0 +1,30 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA1
+
+Format: 1.0
+Source: pari-extra
+Binary: pari-extra
+Architecture: all
+Version: 3-1
+Maintainer: Bill Allombert <ballombe@debian.org>
+Standards-Version: 3.9.2.0
+Build-Depends: debhelper (>= 5)
+Package-List: 
+ pari-extra deb math optional
+Checksums-Sha1: 
+ ff281e103ab11681324b0c694dd3514d78436c51 121 pari-extra_3.orig.tar.gz
+ 080078dbc51e4194d209cb5abe57e2b25705fcaa 2358 pari-extra_3-1.diff.gz
+Checksums-Sha256: 
+ ac1ef39f9da80b582d1c0b2adfb09b041e3860ed20ddcf57a0e922e3305239df 121 pari-extra_3.orig.tar.gz
+ bf4672acd5302b9eebee2f3bf5269022279e531204d7172b8761bb10fae3517a 2358 pari-extra_3-1.diff.gz
+Files: 
+ 76bcf03be979d3331f9051aa88439b8b 121 pari-extra_3.orig.tar.gz
+ 02a39965adb84da9b3e6b5c5a0a4c378 2358 pari-extra_3-1.diff.gz
+
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.4.10 (GNU/Linux)
+
+iEYEARECAAYFAk5CvdoACgkQeDPs8bVESBX0mACeK3Yf9y22T2b6tw8eVQ8XSYxH
+ix4AoJJ3jrGJ4HXJNv/wbvmvBkkybvYJ
+=hkic
+-----END PGP SIGNATURE-----
diff --git a/tests/pkg-srcs/pari-extra_3.orig.tar.gz b/tests/pkg-srcs/pari-extra_3.orig.tar.gz
new file mode 100644 (file)
index 0000000..ff30279
Binary files /dev/null and b/tests/pkg-srcs/pari-extra_3.orig.tar.gz differ
diff --git a/tests/tests/clone-nogit b/tests/tests/clone-nogit
new file mode 100755 (executable)
index 0000000..746dc69
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/bash
+set -e
+. tests/lib
+
+t-git none
+t-archive pari-extra 3-1
+
+t-dgit clone $p
+
+t-diff-nogit extract/$p-3 $p
+cd $p
+t-clean-on-branch dgit/sid
+t-refs-same HEAD remotes/dgit/dgit/sid
+
+echo ok