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

[lintian] 02/02: Warn if we see an unnecessary "Testsuite" header in debian/control.



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

lamby pushed a commit to branch master
in repository lintian.

commit 7c1a32e91b5f9ad674a6f3f66a6a374028942556
Author: Chris Lamb <lamby@debian.org>
Date:   Sat Jul 29 22:05:38 2017 +0100

    Warn if we see an unnecessary "Testsuite" header in debian/control.
---
 checks/testsuite.desc                                    |  9 +++++++++
 checks/testsuite.pm                                      |  3 +++
 debian/changelog                                         |  2 ++
 t/tests/testsuite-general/desc                           |  2 ++
 .../debian/debian/control.in                             | 16 ++++++++++++++++
 .../debian/debian/tests/control                          |  1 +
 .../debian/debian/tests/test-1                           |  2 ++
 t/tests/testsuite-unnecessary-testsuite-header/desc      |  5 +++++
 t/tests/testsuite-unnecessary-testsuite-header/tags      |  1 +
 9 files changed, 41 insertions(+)

diff --git a/checks/testsuite.desc b/checks/testsuite.desc
index 189378d..c9a2454 100644
--- a/checks/testsuite.desc
+++ b/checks/testsuite.desc
@@ -139,3 +139,12 @@ Info: This package does not declare a test suite. Having a test suite helps with
  .
  For more information on how to add functional tests to your package, browse to
  https://ci.debian.net/doc/.
+
+Tag: unnecessary-testsuite-header
+Severity: normal
+Certainty: certain
+Info: You do not need to specify a <tt>Testsuite</tt> field if a
+ <tt>debian/tests/control</tt> file exists. It is automatically added by
+ dpkg-source(1) since dpkg 1.17.1.
+ .
+ Please remove this line from your <tt>debian/control</tt> file.
diff --git a/checks/testsuite.pm b/checks/testsuite.pm
index b25b024..cd71aba 100644
--- a/checks/testsuite.pm
+++ b/checks/testsuite.pm
@@ -103,6 +103,9 @@ sub run {
             }
             check_control_contents($info, $path);
         }
+
+        tag 'unnecessary-testsuite-header'
+          if defined($info->source_field('testsuite'));
     }
     return;
 }
diff --git a/debian/changelog b/debian/changelog
index a2675a2..74e1413 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -26,6 +26,8 @@ lintian (2.5.53) UNRELEASED; urgency=medium
     + [CL] Remove recommendations to add a "Testsuite: autopkgtest" field
       to debian/control as it is added when needed by dpkg-source(1)
       since dpkg 1.17.1.  (Closes: #865531)
+    + [CL] Warn if we see an unnecessary "Testsuite" header in
+      debian/control.
 
   * commands/lintian.pm:
     + [CL] Apply patch from Maia Everett to avoid British spelling when
diff --git a/t/tests/testsuite-general/desc b/t/tests/testsuite-general/desc
index 800df1c..07ddc78 100644
--- a/t/tests/testsuite-general/desc
+++ b/t/tests/testsuite-general/desc
@@ -3,6 +3,8 @@ Version: 1.0
 Description: General tests of the autopkgtest control file
 Options: -I -E --pedantic
 Skeleton: pedantic
+Test-Against:
+ unnecessary-testsuite-header
 Test-For:
  debian-tests-control-uses-national-encoding
  exclusive-runtime-tests-field
diff --git a/t/tests/testsuite-unnecessary-testsuite-header/debian/debian/control.in b/t/tests/testsuite-unnecessary-testsuite-header/debian/debian/control.in
new file mode 100644
index 0000000..cf3bee0
--- /dev/null
+++ b/t/tests/testsuite-unnecessary-testsuite-header/debian/debian/control.in
@@ -0,0 +1,16 @@
+Source: {$source}
+Priority: extra
+Section: {$section}
+Maintainer: {$author}
+Standards-Version: {$standards_version}
+Build-Depends: {$build_depends}
+Testsuite: autopkgtest
+
+Package: {$source}
+Architecture: {$architecture}
+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-unnecessary-testsuite-header/debian/debian/tests/control b/t/tests/testsuite-unnecessary-testsuite-header/debian/debian/tests/control
new file mode 100644
index 0000000..19e2aee
--- /dev/null
+++ b/t/tests/testsuite-unnecessary-testsuite-header/debian/debian/tests/control
@@ -0,0 +1 @@
+Tests: test-1
diff --git a/t/tests/testsuite-unnecessary-testsuite-header/debian/debian/tests/test-1 b/t/tests/testsuite-unnecessary-testsuite-header/debian/debian/tests/test-1
new file mode 100644
index 0000000..039e4d0
--- /dev/null
+++ b/t/tests/testsuite-unnecessary-testsuite-header/debian/debian/tests/test-1
@@ -0,0 +1,2 @@
+#!/bin/sh
+exit 0
diff --git a/t/tests/testsuite-unnecessary-testsuite-header/desc b/t/tests/testsuite-unnecessary-testsuite-header/desc
new file mode 100644
index 0000000..e3f2e5a
--- /dev/null
+++ b/t/tests/testsuite-unnecessary-testsuite-header/desc
@@ -0,0 +1,5 @@
+Testname: testsuite-unnecessary-testsuite-header
+Version: 1.0
+Description: Tests for unnecessary Testsuite header in debian/control
+Test-For:
+ unnecessary-testsuite-header
diff --git a/t/tests/testsuite-unnecessary-testsuite-header/tags b/t/tests/testsuite-unnecessary-testsuite-header/tags
new file mode 100644
index 0000000..d6afae6
--- /dev/null
+++ b/t/tests/testsuite-unnecessary-testsuite-header/tags
@@ -0,0 +1 @@
+W: testsuite-unnecessary-testsuite-header source: unnecessary-testsuite-header

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


Reply to: