summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorNiels Thykier <niels@thykier.net>2017-07-02 16:07:10 +0000
committerNiels Thykier <niels@thykier.net>2017-07-03 14:34:26 +0000
commit664c63ae2b2c477d8be91eeb0fd38e49af098ae1 (patch)
tree7e44e79d1da20a4e8bc6abc754e6705897aca794 /t
parentfe310ea002955f2fd8300e9367199b867ba58247 (diff)
downloaddebhelper-664c63ae2b2c477d8be91eeb0fd38e49af098ae1.tar.gz
t: Split dh_missing test
Signed-off-by: Niels Thykier <niels@thykier.net>
Diffstat (limited to 't')
-rwxr-xr-xt/dh_missing/01-no-missing.t33
-rwxr-xr-xt/dh_missing/02-fail-on-missing.t (renamed from t/dh_missing/dh_missing.t)21
-rwxr-xr-xt/dh_missing/03-dh_install-redirection.t35
-rw-r--r--t/dh_missing/template/Makefile (renamed from t/dh_missing/Makefile)0
-rw-r--r--t/dh_missing/template/debian/changelog (renamed from t/dh_missing/debian/changelog)0
-rw-r--r--t/dh_missing/template/debian/control (renamed from t/dh_missing/debian/control)0
-rw-r--r--t/dh_missing/template/debian/foo.install (renamed from t/dh_missing/debian/foo.install)0
-rw-r--r--t/dh_missing/template/file-for-foo (renamed from t/dh_missing/file-for-foo)0
8 files changed, 70 insertions, 19 deletions
diff --git a/t/dh_missing/01-no-missing.t b/t/dh_missing/01-no-missing.t
new file mode 100755
index 00000000..2528d2d5
--- /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
index 8d87f77b..fa1a6869 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/03-dh_install-redirection.t b/t/dh_missing/03-dh_install-redirection.t
new file mode 100755
index 00000000..ce56fec1
--- /dev/null
+++ b/t/dh_missing/03-dh_install-redirection.t
@@ -0,0 +1,35 @@
+#!/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_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
+# cperl-indent-level: 4
+# End:
diff --git a/t/dh_missing/Makefile b/t/dh_missing/template/Makefile
index e33e1dfc..e33e1dfc 100644
--- a/t/dh_missing/Makefile
+++ b/t/dh_missing/template/Makefile
diff --git a/t/dh_missing/debian/changelog b/t/dh_missing/template/debian/changelog
index 5850f0e2..5850f0e2 100644
--- a/t/dh_missing/debian/changelog
+++ b/t/dh_missing/template/debian/changelog
diff --git a/t/dh_missing/debian/control b/t/dh_missing/template/debian/control
index 48d4de2f..48d4de2f 100644
--- a/t/dh_missing/debian/control
+++ b/t/dh_missing/template/debian/control
diff --git a/t/dh_missing/debian/foo.install b/t/dh_missing/template/debian/foo.install
index eddea57c..eddea57c 100644
--- a/t/dh_missing/debian/foo.install
+++ b/t/dh_missing/template/debian/foo.install
diff --git a/t/dh_missing/file-for-foo b/t/dh_missing/template/file-for-foo
index 8773f398..8773f398 100644
--- a/t/dh_missing/file-for-foo
+++ b/t/dh_missing/template/file-for-foo