summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--debian/changelog1
-rw-r--r--debian/copyright6
-rw-r--r--tests/lib64
-rw-r--r--tests/pkg-srcs/pari-extra_3-1.diff.gzbin0 -> 2358 bytes
-rw-r--r--tests/pkg-srcs/pari-extra_3-1.dsc30
-rw-r--r--tests/pkg-srcs/pari-extra_3.orig.tar.gzbin0 -> 121 bytes
-rwxr-xr-xtests/tests/clone-nogit15
8 files changed, 117 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index 1632e2a..737875f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,5 @@
*~
+tests/tmp
debian/dgit
debian/files
debian/*.substvars
diff --git a/debian/changelog b/debian/changelog
index ff334e4..f2b6126 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -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.
--
diff --git a/debian/copyright b/debian/copyright
index 461cbfd..081ff31 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -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
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
index 0000000..81f7f2e
--- /dev/null
+++ b/tests/pkg-srcs/pari-extra_3-1.diff.gz
Binary files 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
index 0000000..8d67ed0
--- /dev/null
+++ b/tests/pkg-srcs/pari-extra_3-1.dsc
@@ -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
index 0000000..ff30279
--- /dev/null
+++ b/tests/pkg-srcs/pari-extra_3.orig.tar.gz
Binary files differ
diff --git a/tests/tests/clone-nogit b/tests/tests/clone-nogit
new file mode 100755
index 0000000..746dc69
--- /dev/null
+++ b/tests/tests/clone-nogit
@@ -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