[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[lintian] 02/02: check if source package contains functional testsuite



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

nthykier pushed a commit to branch master
in repository lintian.

commit b21a61c0332ab0f37475825cd8db573d74e8544f
Author: Lucas Kanashiro <kanashiro@debian.org>
Date:   Mon Apr 3 17:18:11 2017 -0300

    check if source package contains functional testsuite
    
    Signed-off-by: Niels Thykier <niels@thykier.net>
---
 checks/testsuite.desc                                  | 18 ++++++++++++++++++
 checks/testsuite.pm                                    |  2 ++
 debian/changelog                                       |  4 ++++
 t/runtests                                             |  6 ++++--
 t/source/debian-symlink/tags                           |  1 +
 .../debian/debian/control.in                           | 15 +++++++++++++++
 t/tests/testsuite-autopkgtest-missing/desc             |  5 +++++
 t/tests/testsuite-autopkgtest-missing/pre_build        |  2 ++
 t/tests/testsuite-autopkgtest-missing/tags             |  1 +
 9 files changed, 52 insertions(+), 2 deletions(-)

diff --git a/checks/testsuite.desc b/checks/testsuite.desc
index 4a53278..febc250 100644
--- a/checks/testsuite.desc
+++ b/checks/testsuite.desc
@@ -128,3 +128,21 @@ Info: Lintian cannot parse the Depends field for the given autopkgtest.
  If Lintian complains about a new special "@"-dependency, please file
  a bug against Lintian and have it added to the whitelist.
 Ref: https://anonscm.debian.org/git/autopkgtest/autopkgtest.git/tree/doc/README.package-tests.rst
+
+Tag: testsuite-autopkgtest-missing
+Severity: wishlist
+Certainty: certain
+Info: This package does not declare a test suite. Having a test suite helps with
+ automated QA in response to changes in the archive. For example, if your
+ package has a test suite, it is possible to re-execute that test suite when
+ any of the package dependencies has a new version and check whether that
+ update caused problems for your package.
+ .
+ To declare a test suite in your package, you need to add a `Testsuite` field to
+ the source part of debian/control. This field will usually have a value of
+ `autopkgtest`, i.e.:
+ .
+	Testsuite: autopkgtest
+ .
+ For more information on how to add functional tests to your package, browse to
+ https://ci.debian.net/doc/.
diff --git a/checks/testsuite.pm b/checks/testsuite.pm
index 3839c39..60495da 100644
--- a/checks/testsuite.pm
+++ b/checks/testsuite.pm
@@ -78,6 +78,8 @@ sub run {
     my $control = $info->index('debian/tests/control');
     my $needs_control = 0;
 
+    tag 'testsuite-autopkgtest-missing' if ($testsuites !~ /autopkgtest/);
+
     for my $testsuite (split(m/\s*,\s*/o, $testsuites)) {
         if (not exists($KNOWN_TESTSUITES{$testsuite})) {
             tag 'unknown-testsuite', $testsuite;
diff --git a/debian/changelog b/debian/changelog
index 41416ff..96464fa 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -33,6 +33,10 @@ lintian (2.5.51) UNRELEASED; urgency=medium
       to version 1.1.
     + [NT] Apply patch from Laurent Bigonville to check desktop files
       for missing "Icon" field.  (Closes: #854132)
+  * checks/testsuite.{desc,pm}:
+    + [NT] Apply patch from Lucas Kanashiro to add a tag for recommending
+      packagers to create an autopkgtest for their package.
+      (Closes: #859467)
 
   * coll/debian-readme{,desc}:
     + [NT] Remove.  Merge what little functionality it offers into the
diff --git a/t/runtests b/t/runtests
index 0599692..91028ee 100755
--- a/t/runtests
+++ b/t/runtests
@@ -113,9 +113,11 @@ my $RUNNER_TS = (stat($0))[9];
 chomp $ARCHITECTURE;
 
 our %TEMPLATES = (
-    'tests'  => ['debian/changelog', 'debian/control', 'debian/compat', 'debian/tests'],
+    'tests'  =>
+      ['debian/changelog', 'debian/control', 'debian/compat', 'debian/tests'],
     'debs'   => ['changelog', 'control', 'Makefile'],
-    'source' => ['changelog', 'control', 'dsc.in', 'tests/control', 'tests/test'],
+    'source' =>
+      ['changelog', 'control', 'dsc.in', 'tests/control', 'tests/test'],
 );
 my $DATE = safe_qx(qw(date -R));
 chomp $DATE;
diff --git a/t/source/debian-symlink/tags b/t/source/debian-symlink/tags
index e69de29..e560c9a 100644
--- a/t/source/debian-symlink/tags
+++ b/t/source/debian-symlink/tags
@@ -0,0 +1 @@
+I: debian-symlink source: testsuite-autopkgtest-missing
diff --git a/t/tests/testsuite-autopkgtest-missing/debian/debian/control.in b/t/tests/testsuite-autopkgtest-missing/debian/debian/control.in
new file mode 100644
index 0000000..842d742
--- /dev/null
+++ b/t/tests/testsuite-autopkgtest-missing/debian/debian/control.in
@@ -0,0 +1,15 @@
+Source: {$source}
+Priority: extra
+Section: devel
+Maintainer: {$author}
+Standards-Version: {$standards_version}
+Build-Depends: {$build_depends}
+
+Package: {$source}
+Architecture: all
+Depends: $\{shlibs:Depends\}, $\{misc:Depends\}
+Description: {$description}
+ This is a test package designed to exercise some feature or tag of
+ Lintian.  It is part of the Lintian test suite and may do very odd
+ things.  It should not be installed like a regular package.  It may
+ be an empty package.
diff --git a/t/tests/testsuite-autopkgtest-missing/desc b/t/tests/testsuite-autopkgtest-missing/desc
new file mode 100644
index 0000000..ec5862e
--- /dev/null
+++ b/t/tests/testsuite-autopkgtest-missing/desc
@@ -0,0 +1,5 @@
+Testname: testsuite-autopkgtest-missing
+Version: 1.0
+Description: Verify if Testsuite field and autopkgtest are used
+Test-For:
+  testsuite-autopkgtest-missing
diff --git a/t/tests/testsuite-autopkgtest-missing/pre_build b/t/tests/testsuite-autopkgtest-missing/pre_build
new file mode 100755
index 0000000..5d97192
--- /dev/null
+++ b/t/tests/testsuite-autopkgtest-missing/pre_build
@@ -0,0 +1,2 @@
+#!/bin/bash
+rm -f "$1/debian/tests/control"
diff --git a/t/tests/testsuite-autopkgtest-missing/tags b/t/tests/testsuite-autopkgtest-missing/tags
new file mode 100644
index 0000000..cb51a66
--- /dev/null
+++ b/t/tests/testsuite-autopkgtest-missing/tags
@@ -0,0 +1 @@
+I: testsuite-autopkgtest-missing source: testsuite-autopkgtest-missing

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git


Reply to: