summaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorFrédéric Buclin <LpSolit@gmail.com>2015-03-16 11:10:41 +0100
committerFrédéric Buclin <LpSolit@gmail.com>2015-03-16 11:10:41 +0100
commit56d130c40ca3f371c53c92426d8d27def45a24dc (patch)
tree3c18b2b6c0866c0fdb0edb9fde7ed43049d43b3a /t
parent2ccf81dec1fbe4e215ea47700a4e006420318621 (diff)
downloadbugzilla-56d130c40ca3f371c53c92426d8d27def45a24dc.tar.gz
bugzilla-56d130c40ca3f371c53c92426d8d27def45a24dc.tar.xz
Bug 1137674: Merge t/003safesys.t with t/001compile.t
r=dylan a=glob
Diffstat (limited to 't')
-rw-r--r--t/001compile.t6
-rw-r--r--t/003safesys.t53
2 files changed, 3 insertions, 56 deletions
diff --git a/t/001compile.t b/t/001compile.t
index 7097ad361..a546e40ad 100644
--- a/t/001compile.t
+++ b/t/001compile.t
@@ -49,12 +49,12 @@ sub compile_file {
$T = "T";
}
- my $libs = '';
+ my $libs = '-It ';
if ($ENV{PERL5LIB}) {
- $libs = join " ", map { "-I\"$_\"" } split /$Config{path_sep}/, $ENV{PERL5LIB};
+ $libs .= join " ", map { "-I\"$_\"" } split /$Config{path_sep}/, $ENV{PERL5LIB};
}
my $perl = qq{"$^X"};
- my $output = `$perl $libs -c$T $file 2>&1`;
+ my $output = `$perl $libs -c$T -MSupport::Systemexec $file 2>&1`;
chomp($output);
my $return_val = $?;
$output =~ s/^\Q$file\E syntax OK$//ms;
diff --git a/t/003safesys.t b/t/003safesys.t
deleted file mode 100644
index 2a257ffb9..000000000
--- a/t/003safesys.t
+++ /dev/null
@@ -1,53 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This Source Code Form is "Incompatible With Secondary Licenses", as
-# defined by the Mozilla Public License, v. 2.0.
-
-
-#################
-#Bugzilla Test 3#
-###Safesystem####
-
-use 5.10.1;
-use strict;
-use warnings;
-
-use lib 't';
-
-use Support::Files;
-
-use Test::More tests => scalar(@Support::Files::testitems);
-
-# Capture the TESTOUT from Test::More or Test::Builder for printing errors.
-# This will handle verbosity for us automatically.
-my $fh;
-{
- no warnings qw(unopened); # Don't complain about non-existent filehandles
- if (-e \*Test::More::TESTOUT) {
- $fh = \*Test::More::TESTOUT;
- } elsif (-e \*Test::Builder::TESTOUT) {
- $fh = \*Test::Builder::TESTOUT;
- } else {
- $fh = \*STDOUT;
- }
-}
-
-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 $command = "$perlapp -c -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");
- print $fh $loginfo;
- } else {
- ok(1,"$file uses proper system and exec calls");
- }
-}
-
-exit 0;