summaryrefslogtreecommitdiffstats
path: root/t/dh_installdocs/dh_installdocs.t
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-09 12:53:53 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-09 12:53:53 +0000
commit90169463f86997737ed5b9c0ea2b311cd3b056b7 (patch)
tree281a0f8d9850ea58cf2a3ddb8bf087fb52520925 /t/dh_installdocs/dh_installdocs.t
parentInitial commit. (diff)
downloaddebhelper-90169463f86997737ed5b9c0ea2b311cd3b056b7.tar.xz
debhelper-90169463f86997737ed5b9c0ea2b311cd3b056b7.zip
Adding upstream version 13.15.3.upstream/13.15.3
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 't/dh_installdocs/dh_installdocs.t')
-rwxr-xr-xt/dh_installdocs/dh_installdocs.t75
1 files changed, 75 insertions, 0 deletions
diff --git a/t/dh_installdocs/dh_installdocs.t b/t/dh_installdocs/dh_installdocs.t
new file mode 100755
index 0000000..64f1254
--- /dev/null
+++ b/t/dh_installdocs/dh_installdocs.t
@@ -0,0 +1,75 @@
+#!/usr/bin/perl
+use strict;
+use warnings;
+use Test::More;
+
+
+use File::Path qw(remove_tree);
+use File::Basename qw(dirname);
+use lib dirname(dirname(__FILE__));
+use Test::DH;
+
+our @TEST_DH_EXTRA_TEMPLATE_FILES = (qw(
+ debian/changelog
+ debian/control
+ debian/docfile
+ debian/copyright
+));
+
+plan(tests => 5);
+
+
+my $NODOC_PROFILE = {
+ 'env' => {
+ 'DEB_BUILD_PROFILES' => 'nodoc',
+ },
+};
+
+my $doc = "debian/docfile";
+
+each_compat_subtest {
+ ok(run_dh_tool('dh_installdocs', '-pbar', $doc));
+ ok(-e "debian/bar/usr/share/doc/bar/docfile");
+ remove_tree(qw(debian/foo debian/bar debian/baz));
+};
+
+each_compat_subtest {
+ #regression in debhelper 9.20160702 (#830309)
+ ok(run_dh_tool('dh_installdocs', '-pbaz', '--link-doc=foo', $doc));
+
+ ok(-l "debian/baz/usr/share/doc/baz");
+ ok(readlink("debian/baz/usr/share/doc/baz") eq 'foo');
+ ok(-e "debian/baz/usr/share/doc/foo/docfile");
+ remove_tree(qw(debian/foo debian/bar debian/baz));
+};
+
+each_compat_subtest {
+ ok(run_dh_tool('dh_installdocs', '-pfoo', '--link-doc=bar', $doc));
+
+ ok(-l "debian/foo/usr/share/doc/foo");
+ ok(readlink("debian/foo/usr/share/doc/foo") eq 'bar');
+ ok(-e "debian/foo/usr/share/doc/bar/docfile");
+ remove_tree(qw(debian/foo debian/bar debian/baz));
+};
+
+# ... and with nodoc
+
+each_compat_subtest {
+ # docs are ignored, but copyright file is still there
+ ok(run_dh_tool($NODOC_PROFILE, 'dh_installdocs', $doc));
+ for my $pkg (qw(foo bar baz)) {
+ ok(! -e "debian/$pkg/usr/share/doc/$pkg/docfile");
+ ok(-e "debian/$pkg/usr/share/doc/$pkg/copyright");
+ }
+ remove_tree(qw(debian/foo debian/bar debian/baz));
+};
+
+each_compat_subtest {
+ # docs are ignored, but symlinked doc dir is still there
+ ok(run_dh_tool($NODOC_PROFILE, 'dh_installdocs', '-pfoo', '--link-doc=bar', $doc));
+ ok(-l "debian/foo/usr/share/doc/foo");
+ ok(readlink("debian/foo/usr/share/doc/foo") eq 'bar');
+ ok(! -e "debian/foo/usr/share/doc/bar/docfile");
+ remove_tree(qw(debian/foo debian/bar debian/baz));
+};
+