[cpanminus] 08/12: Replace ad-hoc test in debian/rules with a (patch that creates a) test script
gregor herrmann
gregoa at debian.org
Sat Dec 9 18:54:51 UTC 2017
This is an automated email from the git hooks/post-receive script.
gregoa pushed a commit to branch master
in repository cpanminus.
commit 3b1ac2595a29ad41a192b523ccd97e7ded97f0e3
Author: gregor herrmann <gregoa at debian.org>
Date: Sat Dec 9 19:44:19 2017 +0100
Replace ad-hoc test in debian/rules with a (patch that creates a) test script
which runs both during build and autopkgtest.
---
debian/patches/series | 1 +
debian/patches/test-run.patch | 21 +++++++++++++++++++++
debian/rules | 1 -
debian/tests/pkg-perl/smoke-env | 1 +
4 files changed, 23 insertions(+), 1 deletion(-)
diff --git a/debian/patches/series b/debian/patches/series
index 616b9f4..7ea41aa 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
fatpack.patch
test-load.patch
+test-run.patch
diff --git a/debian/patches/test-run.patch b/debian/patches/test-run.patch
new file mode 100644
index 0000000..a9072e7
--- /dev/null
+++ b/debian/patches/test-run.patch
@@ -0,0 +1,21 @@
+Description: add a test to run cpanm(1) during build and autopkgtest
+Origin: vendor
+Forwarded: not-needed
+Author: gregor herrmann <gregoa at debian.org>
+Last-Update: 2017-12-09
+
+--- /dev/null
++++ b/t/run.t
+@@ -0,0 +1,12 @@
++#!/usr/bin/perl
++
++use Test::More tests => 1;
++
++my $command;
++if ($ENV{ADTTMP}) {
++ $command = 'cpanm --version';
++} else {
++ $command = "$^X -I blib/lib blib/script/cpanm --version";
++}
++my $result = system($command);
++ok($result == 0, 'cpanm --version returned success');
diff --git a/debian/rules b/debian/rules
index b72b265..d51117e 100755
--- a/debian/rules
+++ b/debian/rules
@@ -19,4 +19,3 @@ override_dh_auto_configure:
override_dh_auto_test:
mkdir -p $(BUILDHOME)
HOME=$(BUILDHOME) dh_auto_test
- HOME=$(BUILDHOME) PERL5LIB=$(CURDIR)/blib/lib perl $(CURDIR)/blib/script/cpanm --version
diff --git a/debian/tests/pkg-perl/smoke-env b/debian/tests/pkg-perl/smoke-env
new file mode 100644
index 0000000..021d2e2
--- /dev/null
+++ b/debian/tests/pkg-perl/smoke-env
@@ -0,0 +1 @@
+HOME=${ADTTMP}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/cpanminus.git
More information about the Pkg-perl-cvs-commits
mailing list