]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1137669: 003safesys.t doesn't test any file due to a missing -T argument (and...
authorFrédéric Buclin <LpSolit@gmail.com>
Mon, 16 Mar 2015 17:16:53 +0000 (18:16 +0100)
committerFrédéric Buclin <LpSolit@gmail.com>
Mon, 16 Mar 2015 17:16:53 +0000 (18:16 +0100)
r=dylan a=glob

t/003safesys.t
t/Support/Systemexec.pm

index 2a257ffb9a2f7f68a17e750ea36f12d916300856..443f96415871c6a2219d2029bea881c95e8d6ad4 100644 (file)
@@ -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");
index 65be229e3c5840a7ceac926f4307f5f59597be99..e73763f8f01183b073ee6933056be76161ffd339 100644 (file)
@@ -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;