Add DEP-8 tests based on the built-time test suite
authorNiels Thykier <niels@thykier.net>
Sat, 16 Feb 2013 18:51:21 +0000 (19:51 +0100)
committerNiels Thykier <niels@thykier.net>
Sat, 16 Feb 2013 18:51:21 +0000 (19:51 +0100)
Signed-off-by: Niels Thykier <niels@thykier.net>
debian/changelog
debian/control
debian/lintian.install
debian/tests/control [new file with mode: 0644]
debian/tests/testsuite [new file with mode: 0755]
debian/tests/testsuite-legacy [new file with mode: 0755]
private/runtests
t/runtests
testset/runtests

index 86ea262..58e243b 100644 (file)
@@ -151,8 +151,13 @@ lintian (2.5.12) UNRELEASED; urgency=low
   * debian/control:
     + [NT] Bump dependency on hardening-includes to avoid having
       to work around #677530.
+    + [NT] Add XS-Testsuite for autopkgtest tests.
+  * debian/lintian.install:
+    + [NT] Install Test::Lintian in /usr/share/lintian/lib.
   * debian/rules:
     + [NT] Include the new Tutorial pods in the "api-doc" target.
+  * debian/tests/{control,testsuite,testsuite-legacy}:
+    + [NT] New file.
 
   * doc/tutorial/Lintian/Tutorial{/WritingChecks}.pod:
     + [NT] Add POD tutorial on writing checks.
index e2bad92..353c40e 100644 (file)
@@ -60,6 +60,7 @@ Build-Depends: binutils,
 Standards-Version: 3.9.4
 Vcs-Git: git://anonscm.debian.org/lintian/lintian.git
 Vcs-Browser: http://anonscm.debian.org/gitweb/?p=lintian/lintian.git
+XS-Testsuite: autopkgtest
 
 Package: lintian
 Architecture: all
index bd316ad..4981058 100644 (file)
@@ -4,5 +4,6 @@ checks                  usr/share/lintian
 collection             usr/share/lintian
 data                   usr/share/lintian
 lib/Lintian            usr/share/perl5
+lib/Test               usr/share/lintian/lib
 profiles               usr/share/lintian
 vendors                usr/share/lintian
diff --git a/debian/tests/control b/debian/tests/control
new file mode 100644 (file)
index 0000000..89ae8c8
--- /dev/null
@@ -0,0 +1,25 @@
+Tests: testsuite testsuite-legacy
+Depends: @,
+         cdbs,
+         debhelper (>= 9),
+         default-jdk,
+         dpkg-dev (>= 1.16.1~),
+         fakeroot,
+         javahelper (>= 0.32~),
+         libhtml-parser-perl,
+         libtest-minimumversion-perl,
+         libtest-pod-coverage-perl,
+         libtest-pod-perl,
+         libtest-strict-perl,
+         libtest-synopsis-perl,
+         libtext-template-perl,
+         perl (>= 5.12) | libtest-simple-perl (>= 0.93),
+         python,
+         python-all-dev,
+         python-numpy,
+         quilt,
+         rsync,
+         unzip,
+         xz-utils,
+         xz-utils (>= 5.1.1alpha+20120614) | xz-lzma | lzma,
+         zip
diff --git a/debian/tests/testsuite b/debian/tests/testsuite
new file mode 100755 (executable)
index 0000000..8226c94
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+set -e
+WORKDIR="$ADTTMP/$(basename $0)"
+
+export LINTIAN_TEST_INSTALLED=yes
+
+rm -f runtests
+
+debian/rules TEST_WORK_DIR="$WORKDIR" runtests onlyrun="suite:changes,debs,source,tests"
+
diff --git a/debian/tests/testsuite-legacy b/debian/tests/testsuite-legacy
new file mode 100755 (executable)
index 0000000..d4d23ab
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+set -e
+WORKDIR="$ADTTMP/$(basename $0)"
+
+export LINTIAN_TEST_INSTALLED=yes
+
+rm -f runtests
+
+debian/rules TEST_WORK_DIR="$WORKDIR" runtests onlyrun="--legacy-only"
index f801c73..de51852 100755 (executable)
@@ -2,6 +2,14 @@
 
 set -e
 
+if [ "$LINTIAN_TEST_INSTALLED" = "yes" ]; then
+    LINTIAN_FRONTEND="/usr/bin/lintian"
+    LINTIAN_ROOT="/usr/share/lintian"
+else
+    unset LINTIAN_FRONTEND
+    LINTIAN_ROOT=""
+fi
+
 if [ "$1" = "-j" ] ; then
     NUMJOBS="$2"
     test "$NUMJOBS" -gt 0 || (
@@ -26,7 +34,6 @@ if [ "$1" ] ; then
 fi
 
 LC_ALL="C"
-LINTIAN_ROOT=""
 LINTIAN_PROFILE=debian
 NO_PKG_MANGLE=true
 unset MAKEFLAGS
@@ -36,6 +43,7 @@ unset HOME
 [ "$TEST_WORK_DIR" ] || TEST_WORK_DIR="debian/test-out"
 
 export LC_ALL
+export LINTIAN_FRONTEND
 export LINTIAN_ROOT
 export LINTIAN_PROFILE
 export NO_PKG_MANGLE
index 0227d0d..0854811 100755 (executable)
@@ -65,6 +65,9 @@ use Lintian::Util qw(delete_dir fail read_dpkg_control slurp_entire_file);
 our $LINTIAN_ROOT = $ENV{'LINTIAN_ROOT'};
 
 our $LINTIAN = $LINTIAN_ROOT . '/frontend/lintian';
+$LINTIAN = $ENV{'LINTIAN_FRONTEND'} if exists $ENV{'LINTIAN_FRONTEND'};
+$ENV{'LINTIAN_FRONTEND'} = $LINTIAN;
+
 our @DPKG_BUILDPACKAGE_CMD = (qw(dpkg-buildpackage -rfakeroot -us -uc -d),
     qw(-iNEVER_MATCH_ANYTHING -INEVER_MATCH_ANYTHING));
 if (`dpkg-source --help` =~ m,\s--commit\s,) {
index e6f96dd..467044c 100755 (executable)
@@ -120,9 +120,10 @@ my $lintian_options = '-I -E';
 my $lintian_info_options = '-I -E -i';
 my $dpkg_buildpackage_options = '-rfakeroot -us -uc -d -iNEVER_MATCH_ANYTHING'
     . ' -INEVER_MATCH_ANYTHING';
+my $testok = 1;
 my $lintian_path = $LINTIAN_ROOT . "/frontend/lintian";
+$lintian_path = $ENV{'LINTIAN_FRONTEND'} if exists $ENV{'LINTIAN_FRONTEND'};
 
-my $testok = 1;
 
 # --- Display output immediately
 $| = 1;