[debhelper-devel] [debhelper] 20/30: t: Split dh_missing test

Niels Thykier nthykier at moszumanska.debian.org
Mon Jul 3 14:40:37 UTC 2017


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

nthykier pushed a commit to branch master
in repository debhelper.

commit 664c63ae2b2c477d8be91eeb0fd38e49af098ae1
Author: Niels Thykier <niels at thykier.net>
Date:   Sun Jul 2 16:07:10 2017 +0000

    t: Split dh_missing test
    
    Signed-off-by: Niels Thykier <niels at thykier.net>
---
 t/dh_missing/01-no-missing.t                       | 33 ++++++++++++++++++++++
 .../{dh_missing.t => 02-fail-on-missing.t}         | 21 ++------------
 .../{dh_missing.t => 03-dh_install-redirection.t}  | 24 ++--------------
 t/dh_missing/{ => template}/Makefile               |  0
 t/dh_missing/{ => template}/debian/changelog       |  0
 t/dh_missing/{ => template}/debian/control         |  0
 t/dh_missing/{ => template}/debian/foo.install     |  0
 t/dh_missing/{ => template}/file-for-foo           |  0
 8 files changed, 37 insertions(+), 41 deletions(-)

diff --git a/t/dh_missing/01-no-missing.t b/t/dh_missing/01-no-missing.t
new file mode 100755
index 0000000..2528d2d
--- /dev/null
+++ b/t/dh_missing/01-no-missing.t
@@ -0,0 +1,33 @@
+#!/usr/bin/perl
+use strict;
+use warnings;
+use Test::More;
+
+use File::Basename qw(dirname);
+use lib dirname(dirname(__FILE__));
+use Test::DH;
+
+our $TEST_DH_FIXTURE_DIR = 'template';
+our @TEST_DH_EXTRA_TEMPLATE_FILES = (qw(
+    debian/changelog
+    debian/control
+    debian/foo.install
+    file-for-foo
+    Makefile
+));
+
+plan(tests => 1);
+
+each_compat_subtest {
+	# Verify dh_missing does not fail when all files are installed.
+	ok(run_dh_tool('dh_clean'));
+	is(system('make', 'install'), 0);
+	ok(run_dh_tool('dh_install', '--sourcedir', 'debian/tmp'));
+	ok(run_dh_tool('dh_missing', '--fail-missing'), 'dh_missing failed');
+};
+
+# Local Variables:
+# indent-tabs-mode: t
+# tab-width: 4
+# cperl-indent-level: 4
+# End:
diff --git a/t/dh_missing/dh_missing.t b/t/dh_missing/02-fail-on-missing.t
similarity index 52%
copy from t/dh_missing/dh_missing.t
copy to t/dh_missing/02-fail-on-missing.t
index 8d87f77..fa1a686 100755
--- a/t/dh_missing/dh_missing.t
+++ b/t/dh_missing/02-fail-on-missing.t
@@ -7,6 +7,7 @@ use File::Basename qw(dirname);
 use lib dirname(dirname(__FILE__));
 use Test::DH;
 
+our $TEST_DH_FIXTURE_DIR = 'template';
 our @TEST_DH_EXTRA_TEMPLATE_FILES = (qw(
     debian/changelog
     debian/control
@@ -15,15 +16,7 @@ our @TEST_DH_EXTRA_TEMPLATE_FILES = (qw(
     Makefile
 ));
 
-plan(tests => 3);
-
-each_compat_subtest {
-	# Verify dh_missing does not fail when all files are installed.
-	ok(run_dh_tool('dh_clean'));
-	is(system('make', 'install'), 0);
-	ok(run_dh_tool('dh_install', '--sourcedir', 'debian/tmp'));
-	ok(run_dh_tool('dh_missing', '--fail-missing'), 'dh_missing failed');
-};
+plan(tests => 1);
 
 each_compat_subtest {
 	# Verify dh_missing does fail when not all files are installed.
@@ -38,16 +31,6 @@ each_compat_subtest {
 	is($exitcode, 2, 'dh_missing exited with exit code 2');
 };
 
-each_compat_up_to_and_incl_subtest(10, sub {
-	# Verify that dh_install -X --fail-missing is passed through to dh_missing (#863447)
-	# dh_install -Xfile makes file-for-foo not be installed. Then we shouldn't
-	# complain about it not being missing.
-	ok(run_dh_tool('dh_clean'));
-	is(system('make', 'install'), 0);
-	ok(run_dh_tool({ 'quiet' => 1 }, 'dh_install', '--sourcedir', 'debian/tmp',
-				   '-X', 'more', '--exclude', 'lots', '--fail-missing'));
-});
-
 # Local Variables:
 # indent-tabs-mode: t
 # tab-width: 4
diff --git a/t/dh_missing/dh_missing.t b/t/dh_missing/03-dh_install-redirection.t
similarity index 51%
rename from t/dh_missing/dh_missing.t
rename to t/dh_missing/03-dh_install-redirection.t
index 8d87f77..ce56fec 100755
--- a/t/dh_missing/dh_missing.t
+++ b/t/dh_missing/03-dh_install-redirection.t
@@ -7,6 +7,7 @@ use File::Basename qw(dirname);
 use lib dirname(dirname(__FILE__));
 use Test::DH;
 
+our $TEST_DH_FIXTURE_DIR = 'template';
 our @TEST_DH_EXTRA_TEMPLATE_FILES = (qw(
     debian/changelog
     debian/control
@@ -15,28 +16,7 @@ our @TEST_DH_EXTRA_TEMPLATE_FILES = (qw(
     Makefile
 ));
 
-plan(tests => 3);
-
-each_compat_subtest {
-	# Verify dh_missing does not fail when all files are installed.
-	ok(run_dh_tool('dh_clean'));
-	is(system('make', 'install'), 0);
-	ok(run_dh_tool('dh_install', '--sourcedir', 'debian/tmp'));
-	ok(run_dh_tool('dh_missing', '--fail-missing'), 'dh_missing failed');
-};
-
-each_compat_subtest {
-	# Verify dh_missing does fail when not all files are installed.
-	ok(run_dh_tool('dh_clean'));
-	is(system('make', 'installmore'), 0);
-	ok(run_dh_tool('dh_install', '--sourcedir', 'debian/tmp'));
-	ok(!run_dh_tool({ 'quiet' => 1 }, 'dh_missing', '--fail-missing'));
-
-	isnt($?, -1, 'dh_missing was executed');
-	ok(! ($? & 127), 'dh_missing did not die due to a signal');
-	my $exitcode = ($? >> 8);
-	is($exitcode, 2, 'dh_missing exited with exit code 2');
-};
+plan(tests => 1);
 
 each_compat_up_to_and_incl_subtest(10, sub {
 	# Verify that dh_install -X --fail-missing is passed through to dh_missing (#863447)
diff --git a/t/dh_missing/Makefile b/t/dh_missing/template/Makefile
similarity index 100%
rename from t/dh_missing/Makefile
rename to t/dh_missing/template/Makefile
diff --git a/t/dh_missing/debian/changelog b/t/dh_missing/template/debian/changelog
similarity index 100%
rename from t/dh_missing/debian/changelog
rename to t/dh_missing/template/debian/changelog
diff --git a/t/dh_missing/debian/control b/t/dh_missing/template/debian/control
similarity index 100%
rename from t/dh_missing/debian/control
rename to t/dh_missing/template/debian/control
diff --git a/t/dh_missing/debian/foo.install b/t/dh_missing/template/debian/foo.install
similarity index 100%
rename from t/dh_missing/debian/foo.install
rename to t/dh_missing/template/debian/foo.install
diff --git a/t/dh_missing/file-for-foo b/t/dh_missing/template/file-for-foo
similarity index 100%
rename from t/dh_missing/file-for-foo
rename to t/dh_missing/template/file-for-foo

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




More information about the debhelper-devel mailing list