[PATCH 5 of 6] test-debian-packages: new test for testing construction of debian packages

Augie Fackler raf at durin42.com
Thu Aug 27 18:26:57 CDT 2015


# HG changeset patch
# User Augie Fackler <augie at google.com>
# Date 1440475709 14400
#      Tue Aug 25 00:08:29 2015 -0400
# Node ID 88da93c7840e6e65baca9941cba6d1190e66814f
# Parent  b484b73deeb3085dbe6a91449602e4d98710c576
test-debian-packages: new test for testing construction of debian packages

This test takes over a minute to run to completion on my workstation,
and far longer if the docker images have to be built for the first
time on a given host. As such, the entire test is tagged as slow.

The test does *not* require dpkg - it merely requires one of docker or
dpkg be available to usefully test. On a (say) fedora machine with
docker installed, it'l still test creating debian packages using
docker.

diff --git a/tests/test-debian-packages.t b/tests/test-debian-packages.t
new file mode 100644
--- /dev/null
+++ b/tests/test-debian-packages.t
@@ -0,0 +1,34 @@
+#require test-repo slow
+
+We check debian package contents with portable tools so that when
+we're on non-debian machines we can still test the packages that are
+built using docker.
+  $ checkdeb() {
+  >   ls *.deb
+  >   ar x mercurial*.deb
+  >   tar tf data.tar* | grep localrepo | sort
+  > }
+  $ OUTPUTDIR=`pwd`
+  $ export OUTPUTDIR
+
+#if docker
+  $ cd "$TESTDIR"/..
+  $ make docker-debian-jessie > $OUTPUTDIR/build.log 2>&1
+  $ cd $OUTPUTDIR
+  $ checkdeb
+  mercurial-*.deb (glob)
+  ./usr/lib/python2.7/site-packages/mercurial/localrepo.py
+  ./usr/lib/python2.7/site-packages/mercurial/localrepo.pyc
+  $ rm -f *.deb build.log
+#endif
+
+#if debhelper
+  $ cd "$TESTDIR"/..
+  $ make debian-jessie > $OUTPUTDIR/build.log 2>&1
+  $ cd $OUTPUTDIR
+  $ checkdeb
+  mercurial-*.deb (glob)
+  ./usr/lib/python2.7/site-packages/mercurial/localrepo.py
+  ./usr/lib/python2.7/site-packages/mercurial/localrepo.pyc
+  $ rm -f *.deb build.log
+#endif


More information about the Mercurial-devel mailing list