summaryrefslogtreecommitdiff
path: root/scripts/t
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2017-10-29 18:40:54 +0100
committerGuillem Jover <guillem@debian.org>2018-01-16 10:55:30 +0100
commit33c866433dd4b186aae970e05c639b52ad5e7ece (patch)
treef079cecea2567db83fdd23d3ed5df1fe15a7ef16 /scripts/t
parentd6ba39af48a8c8eadc1b1542fcd6db0edf2dbe7f (diff)
downloaddpkg-33c866433dd4b186aae970e05c639b52ad5e7ece.tar.gz
test: Infer automatically the unit test data directory
We can easily know the name of the calling unit test, and can thus infer the pathname for the data directory, instead of having to duplicate the name, and potentially ending with it being out of sync.
Diffstat (limited to 'scripts/t')
-rw-r--r--scripts/t/Dpkg_Changelog.t2
-rw-r--r--scripts/t/Dpkg_Checksums.t2
-rw-r--r--scripts/t/Dpkg_Conf.t2
-rw-r--r--scripts/t/Dpkg_Control.t2
-rw-r--r--scripts/t/Dpkg_Control_Fields.t2
-rw-r--r--scripts/t/Dpkg_Control_Tests.t2
-rw-r--r--scripts/t/Dpkg_Dist_Files.t2
-rw-r--r--scripts/t/Dpkg_OpenPGP.t2
-rw-r--r--scripts/t/Dpkg_Shlibs.t2
-rw-r--r--scripts/t/Dpkg_Source_Patch.t2
-rw-r--r--scripts/t/Dpkg_Source_Quilt.t2
-rw-r--r--scripts/t/Dpkg_Substvars.t2
-rw-r--r--scripts/t/mk.t4
13 files changed, 15 insertions, 13 deletions
diff --git a/scripts/t/Dpkg_Changelog.t b/scripts/t/Dpkg_Changelog.t
index 1ca238acd..ed9f8a965 100644
--- a/scripts/t/Dpkg_Changelog.t
+++ b/scripts/t/Dpkg_Changelog.t
@@ -29,7 +29,7 @@ BEGIN {
use_ok('Dpkg::Vendor', qw(get_current_vendor));
};
-my $datadir = test_get_data_path('t/Dpkg_Changelog');
+my $datadir = test_get_data_path();
my $vendor = get_current_vendor();
diff --git a/scripts/t/Dpkg_Checksums.t b/scripts/t/Dpkg_Checksums.t
index e549e640e..82a45fe31 100644
--- a/scripts/t/Dpkg_Checksums.t
+++ b/scripts/t/Dpkg_Checksums.t
@@ -23,7 +23,7 @@ BEGIN {
use_ok('Dpkg::Checksums');
}
-my $datadir = test_get_data_path('t/Dpkg_Checksums');
+my $datadir = test_get_data_path();
my @data = (
{
diff --git a/scripts/t/Dpkg_Conf.t b/scripts/t/Dpkg_Conf.t
index 2e55e3d59..940d18dd7 100644
--- a/scripts/t/Dpkg_Conf.t
+++ b/scripts/t/Dpkg_Conf.t
@@ -23,7 +23,7 @@ BEGIN {
use_ok('Dpkg::Conf');
}
-my $datadir = test_get_data_path('t/Dpkg_Conf');
+my $datadir = test_get_data_path();
my ($conf, $count, @opts);
diff --git a/scripts/t/Dpkg_Control.t b/scripts/t/Dpkg_Control.t
index 0f808fbdc..057cb21b6 100644
--- a/scripts/t/Dpkg_Control.t
+++ b/scripts/t/Dpkg_Control.t
@@ -26,7 +26,7 @@ BEGIN {
use_ok('Dpkg::Control::Info');
}
-my $datadir = test_get_data_path('t/Dpkg_Control');
+my $datadir = test_get_data_path();
sub parse_dsc {
my $path = shift;
diff --git a/scripts/t/Dpkg_Control_Fields.t b/scripts/t/Dpkg_Control_Fields.t
index 7a6582287..c83efed96 100644
--- a/scripts/t/Dpkg_Control_Fields.t
+++ b/scripts/t/Dpkg_Control_Fields.t
@@ -26,7 +26,7 @@ BEGIN {
use_ok('Dpkg::Control::FieldsCore');
}
-#my $datadir = test_get_data_path('t/Dpkg_Control_Fields');
+#my $datadir = test_get_data_path();
my @src_dep_fields = qw(
Build-Depends Build-Depends-Arch Build-Depends-Indep
diff --git a/scripts/t/Dpkg_Control_Tests.t b/scripts/t/Dpkg_Control_Tests.t
index 9c14a2e4e..27042dcfc 100644
--- a/scripts/t/Dpkg_Control_Tests.t
+++ b/scripts/t/Dpkg_Control_Tests.t
@@ -23,7 +23,7 @@ BEGIN {
use_ok('Dpkg::Control::Tests');
}
-my $datadir = test_get_data_path('t/Dpkg_Control_Tests');
+my $datadir = test_get_data_path();
sub parse_tests {
my $path = shift;
diff --git a/scripts/t/Dpkg_Dist_Files.t b/scripts/t/Dpkg_Dist_Files.t
index b29973d38..44d42d058 100644
--- a/scripts/t/Dpkg_Dist_Files.t
+++ b/scripts/t/Dpkg_Dist_Files.t
@@ -21,7 +21,7 @@ use Test::Dpkg qw(:paths);
use_ok('Dpkg::Dist::Files');
-my $datadir = test_get_data_path('t/Dpkg_Dist_Files');
+my $datadir = test_get_data_path();
my $expected;
my %expected = (
diff --git a/scripts/t/Dpkg_OpenPGP.t b/scripts/t/Dpkg_OpenPGP.t
index 84b8401f3..0d2e4afef 100644
--- a/scripts/t/Dpkg_OpenPGP.t
+++ b/scripts/t/Dpkg_OpenPGP.t
@@ -31,7 +31,7 @@ use_ok('Dpkg::OpenPGP');
report_options(quiet_warnings => 1);
-my $datadir = test_get_data_path('t/Dpkg_OpenPGP');
+my $datadir = test_get_data_path();
my $tmpdir = 't.tmp/Dpkg_OpenPGP';
mkdir $tmpdir;
diff --git a/scripts/t/Dpkg_Shlibs.t b/scripts/t/Dpkg_Shlibs.t
index 39163d75b..2310f4f1c 100644
--- a/scripts/t/Dpkg_Shlibs.t
+++ b/scripts/t/Dpkg_Shlibs.t
@@ -31,7 +31,7 @@ my $tmp;
my @tmp;
my %tmp;
-my $datadir = test_get_data_path('t/Dpkg_Shlibs');
+my $datadir = test_get_data_path();
my @librarypaths;
diff --git a/scripts/t/Dpkg_Source_Patch.t b/scripts/t/Dpkg_Source_Patch.t
index d81a1a39d..d0e167dbd 100644
--- a/scripts/t/Dpkg_Source_Patch.t
+++ b/scripts/t/Dpkg_Source_Patch.t
@@ -25,7 +25,7 @@ BEGIN {
use_ok('Dpkg::Source::Patch');
}
-my $datadir = test_get_data_path('t/Dpkg_Source_Patch');
+my $datadir = test_get_data_path();
my $tmpdir = 't.tmp/Dpkg_Source_Patch';
sub test_patch_escape {
diff --git a/scripts/t/Dpkg_Source_Quilt.t b/scripts/t/Dpkg_Source_Quilt.t
index af0071dea..96c3be04d 100644
--- a/scripts/t/Dpkg_Source_Quilt.t
+++ b/scripts/t/Dpkg_Source_Quilt.t
@@ -23,7 +23,7 @@ BEGIN {
use_ok('Dpkg::Source::Quilt');
}
-my $datadir = test_get_data_path('t/Dpkg_Source_Quilt');
+my $datadir = test_get_data_path();
my $quilt;
my (@series_got, @series_exp);
diff --git a/scripts/t/Dpkg_Substvars.t b/scripts/t/Dpkg_Substvars.t
index ded25ddc8..bb8e14039 100644
--- a/scripts/t/Dpkg_Substvars.t
+++ b/scripts/t/Dpkg_Substvars.t
@@ -24,7 +24,7 @@ use Dpkg::Arch qw(get_host_arch);
use_ok('Dpkg::Substvars');
-my $datadir = test_get_data_path('t/Dpkg_Substvars');
+my $datadir = test_get_data_path();
my $expected;
diff --git a/scripts/t/mk.t b/scripts/t/mk.t
index e711270c7..7eaf40cc8 100644
--- a/scripts/t/mk.t
+++ b/scripts/t/mk.t
@@ -17,6 +17,8 @@ use strict;
use warnings;
use Test::More tests => 6;
+use Test::Dpkg qw(:paths);
+
use File::Spec::Functions qw(rel2abs);
use Dpkg ();
@@ -25,7 +27,7 @@ use Dpkg::IPC;
use Dpkg::Vendor;
my $srcdir = $ENV{srcdir} || '.';
-my $datadir = "$srcdir/t/mk";
+my $datadir = test_get_data_path();
# Turn these into absolute names so that we can safely switch to the test
# directory with «make -C».