summaryrefslogtreecommitdiff
path: root/scripts/t
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2017-02-11 20:01:14 +0100
committerGuillem Jover <guillem@debian.org>2017-02-26 23:40:22 +0100
commita390de3632925cf1271523a8672dfb642caa68eb (patch)
tree7f51be4b7014a62f3a0c41a41a3e5f52565041e1 /scripts/t
parent6acaea0708bd7f7c1e261fbb50e429b1efe10368 (diff)
downloaddpkg-a390de3632925cf1271523a8672dfb642caa68eb.tar.gz
test: Use the detected perl interpreter instead of a random one from PATH
We check for a specific version of perl and store that in the PERL variable. But the shebangs on several test scripts hardcode a specific perl that might not be present or might not be recent enough. Always invoke perl scripts explicitly with PERL, or implicitly by letting the currently running interpreter use itself.
Diffstat (limited to 'scripts/t')
-rw-r--r--scripts/t/dpkg_buildpackage.t3
-rw-r--r--scripts/t/dpkg_source.t2
-rw-r--r--scripts/t/merge_changelogs.t2
-rw-r--r--scripts/t/mk.t4
4 files changed, 6 insertions, 5 deletions
diff --git a/scripts/t/dpkg_buildpackage.t b/scripts/t/dpkg_buildpackage.t
index 5c3a5406b..faae2cba4 100644
--- a/scripts/t/dpkg_buildpackage.t
+++ b/scripts/t/dpkg_buildpackage.t
@@ -184,7 +184,8 @@ sub test_build
my $stderr;
chdir $dirname;
- spawn(exec => [ "$srcdir/dpkg-buildpackage.pl", '--host-arch=amd64',
+ spawn(exec => [ $ENV{PERL}, "$srcdir/dpkg-buildpackage.pl",
+ '--host-arch=amd64',
'--unsigned-source', '--unsigned-changes',
'--unsigned-buildinfo',
"--build=$typename", '--check-command=' ],
diff --git a/scripts/t/dpkg_source.t b/scripts/t/dpkg_source.t
index 2de0c0dbb..cdbedceb3 100644
--- a/scripts/t/dpkg_source.t
+++ b/scripts/t/dpkg_source.t
@@ -134,7 +134,7 @@ sub test_build_source
my ($name) = shift;
my $stderr;
- spawn(exec => [ "$srcdir/dpkg-source.pl", '--build', $name ],
+ spawn(exec => [ $ENV{PERL}, "$srcdir/dpkg-source.pl", '--build', $name ],
error_to_string => \$stderr,
wait_child => 1, nocheck => 1);
diff --git a/scripts/t/merge_changelogs.t b/scripts/t/merge_changelogs.t
index a9221c7ed..dfb7521b0 100644
--- a/scripts/t/merge_changelogs.t
+++ b/scripts/t/merge_changelogs.t
@@ -31,7 +31,7 @@ my $res;
sub test_merge {
my ($expected_file, @options) = @_;
my $fh = File::Temp->new();
- spawn(exec => ["$srcdir/dpkg-mergechangelogs.pl", @options],
+ spawn(exec => [ $ENV{PERL}, "$srcdir/dpkg-mergechangelogs.pl", @options ],
to_handle => $fh, error_to_file => '/dev/null',
wait_child => 1, nocheck => 1);
my $res = compare($expected_file, $fh->filename);
diff --git a/scripts/t/mk.t b/scripts/t/mk.t
index 62d6124ab..01ce0fa37 100644
--- a/scripts/t/mk.t
+++ b/scripts/t/mk.t
@@ -65,7 +65,7 @@ sub cmd_get_vars {
# Test makefiles.
-my %arch = cmd_get_vars("$srcdir/dpkg-architecture.pl", '-f');
+my %arch = cmd_get_vars($ENV{PERL}, "$srcdir/dpkg-architecture.pl", '-f');
delete $ENV{$_} foreach keys %arch;
$ENV{"TEST_$_"} = $arch{$_} foreach keys %arch;
@@ -73,7 +73,7 @@ test_makefile('architecture.mk');
$ENV{$_} = $arch{$_} foreach keys %arch;
test_makefile('architecture.mk');
-my %buildflag = cmd_get_vars("$srcdir/dpkg-buildflags.pl");
+my %buildflag = cmd_get_vars($ENV{PERL}, "$srcdir/dpkg-buildflags.pl");
delete $ENV{$_} foreach keys %buildflag;
$ENV{"TEST_$_"} = $buildflag{$_} foreach keys %buildflag;