[libapache2-mod-perl2] 01/02: Add autopkgtest support

Niko Tyni ntyni at moszumanska.debian.org
Sun Oct 5 16:54:22 UTC 2014


This is an automated email from the git hooks/post-receive script.

ntyni pushed a commit to branch master
in repository libapache2-mod-perl2.

commit cde0cf6ccfd91926630dba28baf247b15cdd6a06
Author: Niko Tyni <ntyni at debian.org>
Date:   Fri Oct 3 23:25:14 2014 +0300

    Add autopkgtest support
    
    The default autopkgtest-pkg-perl tests don't really work with this package.
    The build system generates t/TEST, which uses ModPerl::TestRun to
    run the tests under t/ subdirectories. Also, compiling the .pm files
    shipped in this package will generally fail because they need to be
    used in an Apache environment.
    
    So we roll our own infrastructure and opt out of autopkgtest-pkg-perl.
    The 'mytest' script generates a minimal t/TEST and calls it with a
    few options that are apparently needed when we're not in a full build
    directory.
    
    Somewhat surprisingly, this works for now. It may need amending in the
    future, but mod_perl2 releases aren't too frequent nowadays.
---
 debian/source/lintian-overrides |  2 ++
 debian/tests/control            |  3 +++
 debian/tests/mysmoke            | 25 +++++++++++++++++++++++++
 3 files changed, 30 insertions(+)

diff --git a/debian/source/lintian-overrides b/debian/source/lintian-overrides
new file mode 100644
index 0000000..f575b6b
--- /dev/null
+++ b/debian/source/lintian-overrides
@@ -0,0 +1,2 @@
+# autopkgtest-pkg-perl doesn't work for us so we roll our own
+libapache2-mod-perl2: nonteam-testsuite-header
diff --git a/debian/tests/control b/debian/tests/control
new file mode 100644
index 0000000..b5e7e97
--- /dev/null
+++ b/debian/tests/control
@@ -0,0 +1,3 @@
+Tests: mysmoke
+Depends: @, @builddeps@
+Restrictions: allow-stderr
diff --git a/debian/tests/mysmoke b/debian/tests/mysmoke
new file mode 100644
index 0000000..1f51ca1
--- /dev/null
+++ b/debian/tests/mysmoke
@@ -0,0 +1,25 @@
+#!/bin/sh
+set -e
+T=$(mktemp -d)
+cp -a t/ $T
+cp debian/apache2.conf $T
+
+mkdir $T/t/logs
+
+# some tests use the top level Makefile as data, but we don't have it
+# so we cheat a bit...
+cp LICENSE $T/Makefile
+
+cat > $T/t/TEST <<EOF
+#!/usr/bin/perl
+use strict;
+use warnings FATAL => 'all';
+use lib "$T/t/lib";
+use ModPerl::TestRun ();
+ModPerl::TestRun->new->run(@ARGV);
+EOF
+chmod +x $T/t/TEST
+
+$T/t/TEST -httpd_conf $T/apache2.conf -apxs /usr/bin/apxs
+
+rm -rf $T

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libapache2-mod-perl2.git



More information about the Pkg-perl-cvs-commits mailing list