From 53af86d19c6e75e68e1822cd66b864e509f391d6 Mon Sep 17 00:00:00 2001 From: Gervase Markham Date: Tue, 12 May 2015 15:57:56 +0100 Subject: Bug 1116118: 003safesys.t shouldn't compile all files by default. r=glob --- t/003safesys.t | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 't') diff --git a/t/003safesys.t b/t/003safesys.t index b4f41f61c..a69500b7a 100644 --- a/t/003safesys.t +++ b/t/003safesys.t @@ -29,6 +29,7 @@ use strict; use lib 't'; use Support::Files; +use File::Slurp; use Test::More tests => scalar(@Support::Files::testitems); @@ -46,12 +47,19 @@ my $fh; } } -my @testitems = @Support::Files::testitems; +my @testitems = @Support::Files::testitems; my $perlapp = "\"$^X\""; foreach my $file (@testitems) { $file =~ s/\s.*$//; # nuke everything after the first space (#comment) next if (!$file); # skip null entries + + my $contents = read_file($file); + if ($contents !~ /\b(system|exec)\b/) { + ok(1,"$file does not contain any system or exec calls"); + next; + } + my $command = "$perlapp -c -It -MSupport::Systemexec $file 2>&1"; my $loginfo=`$command`; if ($loginfo =~ /arguments for Support::Systemexec::(system|exec)/im) { -- cgit v1.2.3-24-g4f1b