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

[lintian] 02/02: t: Support the same templates in upstream part of tests.



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

nthykier pushed a commit to branch master
in repository lintian.

commit 887c94d03dae7d24d937a0c74df2e641b407f0c0
Author: Niels Thykier <niels@thykier.net>
Date:   Sat Apr 9 10:24:01 2016 +0000

    t: Support the same templates in upstream part of tests.
    
    This enables us to use templates in cruft-empty-diff and there by keep
    its S-V up to date automatically.
    
    Signed-off-by: Niels Thykier <niels@thykier.net>
---
 t/runtests                                            | 14 +++++++++++++-
 t/tests/cruft-empty-diff/debian/debian/changelog      |  8 --------
 t/tests/cruft-empty-diff/debian/debian/changelog.in   |  8 ++++++++
 t/tests/cruft-empty-diff/debian/debian/control        | 15 ---------------
 t/tests/cruft-empty-diff/debian/debian/control.in     | 15 +++++++++++++++
 t/tests/cruft-empty-diff/pre_build                    |  9 ---------
 t/tests/cruft-empty-diff/upstream/debian/changelog    |  8 --------
 t/tests/cruft-empty-diff/upstream/debian/changelog.in |  8 ++++++++
 t/tests/cruft-empty-diff/upstream/debian/control      | 15 ---------------
 t/tests/cruft-empty-diff/upstream/debian/control.in   | 15 +++++++++++++++
 10 files changed, 59 insertions(+), 56 deletions(-)

diff --git a/t/runtests b/t/runtests
index 6f11d88..b040e17 100755
--- a/t/runtests
+++ b/t/runtests
@@ -345,6 +345,7 @@ sub test_package {
         my $is_native = ($testdata->{type} eq 'native');
         my $pkgdir = "$pkg-$testdata->{version}";
         my $targetdir = "$rundir/$pkgdir";
+        my %regen_template;
 
         # Strip the Debian revision off of the name of the target
         # directory and the *.orig.tar.gz file if the package is
@@ -364,6 +365,15 @@ sub test_package {
         unless ($is_native) {
             copy_template_dir("$tmpldir/${skel}.upstream",
                 "$origdir/upstream/",$targetdir);
+
+            foreach my $tfile (@{ $TEMPLATES{$suite} }) {
+                if (!-e "$targetdir/$tfile" and -f "$targetdir/${tfile}.in") {
+                    fill_in_tmpl("$targetdir/$tfile", $testdata);
+                    unlink("$targetdir/${tfile}.in");
+                    $regen_template{$tfile} = 1;
+                }
+            }
+
             unlink "$targetdir/.dummy" if -e "$targetdir/.dummy";
             if (-x "$origdir/pre_upstream") {
                 $test_state->progress('pre_upstream hook');
@@ -384,7 +394,9 @@ sub test_package {
             ['--exclude=debian/changelog']);
 
         foreach my $tfile (@{ $TEMPLATES{$suite} }) {
-            if (not -e "$targetdir/$tfile" and -f "$targetdir/${tfile}.in") {
+            my $may_fill = $regen_template{$tfile}
+              or not -e "$targetdir/$tfile";
+            if ($may_fill and -f "$targetdir/${tfile}.in") {
                 fill_in_tmpl("$targetdir/$tfile", $testdata);
                 unlink("$targetdir/${tfile}.in");
             }
diff --git a/t/tests/cruft-empty-diff/debian/debian/changelog b/t/tests/cruft-empty-diff/debian/debian/changelog
deleted file mode 100644
index 1e78a38..0000000
--- a/t/tests/cruft-empty-diff/debian/debian/changelog
+++ /dev/null
@@ -1,8 +0,0 @@
-cruft-empty-diff (1.0-1) unstable; urgency=low
-
-  * Lintian Test Suite.
-  * Test: basic
-
-  * Suppress "should close ITP bug" messages.  (Closes: #123456)
-
- -- Debian Lintian Maintainers <lintian-maint@debian.org>  Fri, 08 Apr 2016 07:00:00 +0000
diff --git a/t/tests/cruft-empty-diff/debian/debian/changelog.in b/t/tests/cruft-empty-diff/debian/debian/changelog.in
new file mode 100644
index 0000000..4626601
--- /dev/null
+++ b/t/tests/cruft-empty-diff/debian/debian/changelog.in
@@ -0,0 +1,8 @@
+{$source} ({$version}) {$distribution}; urgency=low
+
+  * Lintian Test Suite.
+  * Test: {$testname}
+
+  * Suppress "should close ITP bug" messages.  (Closes: #123456)
+
+ -- {$author}  {$date}
diff --git a/t/tests/cruft-empty-diff/debian/debian/control b/t/tests/cruft-empty-diff/debian/debian/control
deleted file mode 100644
index 436dc44..0000000
--- a/t/tests/cruft-empty-diff/debian/debian/control
+++ /dev/null
@@ -1,15 +0,0 @@
-Source: cruft-empty-diff
-Priority: extra
-Section: devel
-Maintainer: Debian Lintian Maintainers <lintian-maint@debian.org>
-Standards-Version: 3.9.8
-Build-Depends: debhelper (>= 7)
-
-Package: cruft-empty-diff
-Architecture: all
-Depends: ${shlibs:Depends}, ${misc:Depends}
-Description: Test an empty Debian diff
- 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/cruft-empty-diff/debian/debian/control.in b/t/tests/cruft-empty-diff/debian/debian/control.in
new file mode 100644
index 0000000..010382d
--- /dev/null
+++ b/t/tests/cruft-empty-diff/debian/debian/control.in
@@ -0,0 +1,15 @@
+Source: {$source}
+Priority: extra
+Section: {$section}
+Maintainer: {$author}
+Standards-Version: {$standards_version}
+Build-Depends: debhelper (>= 9)
+
+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/cruft-empty-diff/pre_build b/t/tests/cruft-empty-diff/pre_build
deleted file mode 100755
index 1d4817f..0000000
--- a/t/tests/cruft-empty-diff/pre_build
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-#
-# Remove files copied over from the skeleton but which aren't in the
-# upstream tarball so that we exactly match.
-
-set -e
-dir="$1"
-
-rm "${dir}"/debian/*.in
diff --git a/t/tests/cruft-empty-diff/upstream/debian/changelog b/t/tests/cruft-empty-diff/upstream/debian/changelog
deleted file mode 100644
index 1e78a38..0000000
--- a/t/tests/cruft-empty-diff/upstream/debian/changelog
+++ /dev/null
@@ -1,8 +0,0 @@
-cruft-empty-diff (1.0-1) unstable; urgency=low
-
-  * Lintian Test Suite.
-  * Test: basic
-
-  * Suppress "should close ITP bug" messages.  (Closes: #123456)
-
- -- Debian Lintian Maintainers <lintian-maint@debian.org>  Fri, 08 Apr 2016 07:00:00 +0000
diff --git a/t/tests/cruft-empty-diff/upstream/debian/changelog.in b/t/tests/cruft-empty-diff/upstream/debian/changelog.in
new file mode 100644
index 0000000..4626601
--- /dev/null
+++ b/t/tests/cruft-empty-diff/upstream/debian/changelog.in
@@ -0,0 +1,8 @@
+{$source} ({$version}) {$distribution}; urgency=low
+
+  * Lintian Test Suite.
+  * Test: {$testname}
+
+  * Suppress "should close ITP bug" messages.  (Closes: #123456)
+
+ -- {$author}  {$date}
diff --git a/t/tests/cruft-empty-diff/upstream/debian/control b/t/tests/cruft-empty-diff/upstream/debian/control
deleted file mode 100644
index 436dc44..0000000
--- a/t/tests/cruft-empty-diff/upstream/debian/control
+++ /dev/null
@@ -1,15 +0,0 @@
-Source: cruft-empty-diff
-Priority: extra
-Section: devel
-Maintainer: Debian Lintian Maintainers <lintian-maint@debian.org>
-Standards-Version: 3.9.8
-Build-Depends: debhelper (>= 7)
-
-Package: cruft-empty-diff
-Architecture: all
-Depends: ${shlibs:Depends}, ${misc:Depends}
-Description: Test an empty Debian diff
- 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/cruft-empty-diff/upstream/debian/control.in b/t/tests/cruft-empty-diff/upstream/debian/control.in
new file mode 100644
index 0000000..010382d
--- /dev/null
+++ b/t/tests/cruft-empty-diff/upstream/debian/control.in
@@ -0,0 +1,15 @@
+Source: {$source}
+Priority: extra
+Section: {$section}
+Maintainer: {$author}
+Standards-Version: {$standards_version}
+Build-Depends: debhelper (>= 9)
+
+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.

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


Reply to: