From f5fb20f4c9fdec61cecfa8a2a7b49b5f5a2e62b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Buclin?= Date: Mon, 16 Mar 2015 18:16:53 +0100 Subject: Bug 1137669: 003safesys.t doesn't test any file due to a missing -T argument (and broken syntax in Support::Systemexec) r=dylan a=glob --- t/003safesys.t | 11 ++++++++++- t/Support/Systemexec.pm | 9 +++++---- 2 files changed, 15 insertions(+), 5 deletions(-) (limited to 't') diff --git a/t/003safesys.t b/t/003safesys.t index 2a257ffb9..443f96415 100644 --- a/t/003safesys.t +++ b/t/003safesys.t @@ -40,7 +40,16 @@ my $perlapp = "\"$^X\""; foreach my $file (@testitems) { $file =~ s/\s.*$//; # nuke everything after the first space (#comment) next if (!$file); # skip null entries - my $command = "$perlapp -c -It -MSupport::Systemexec $file 2>&1"; + + open(my $fh2, '<', $file); + my $bang = <$fh2>; + close $fh2; + + my $T = ""; + if ($bang =~ m/#!\S*perl\s+-.*T/) { + $T = "T"; + } + my $command = "$perlapp -c$T -It -MSupport::Systemexec $file 2>&1"; my $loginfo=`$command`; if ($loginfo =~ /arguments for Support::Systemexec::(system|exec)/im) { ok(0,"$file DOES NOT use proper system or exec calls"); diff --git a/t/Support/Systemexec.pm b/t/Support/Systemexec.pm index 65be229e3..e73763f8f 100644 --- a/t/Support/Systemexec.pm +++ b/t/Support/Systemexec.pm @@ -11,14 +11,15 @@ use 5.10.1; use strict; use warnings; -require Exporter; -@ISA = qw(Exporter); -@EXPORT = qw(system exec); -@EXPORT_OK = qw(); +use parent qw(Exporter); +@Support::Systemexec::EXPORT = qw(system exec); + sub system($$@) { 1; } + sub exec($$@) { 1; } + 1; -- cgit v1.2.1