Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

skip tainting tests if perl was built without taint support #39

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion t/07_taint.t
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
#!/usr/bin/perl -wT
use strict;
use Test::More tests => 13;
use Test::More;
use Scalar::Util qw(tainted);
use Config;

if (exists($Config{taint_support}) && not $Config{taint_support}) {
plan skip_all => "your perl was built without taint support";
}
else {
plan tests => 13;
}

my $perl_path = $Config{perlpath};

if ($^O ne 'VMS') {
Expand Down
22 changes: 14 additions & 8 deletions t/10_formatting.t
Original file line number Diff line number Diff line change
@@ -1,24 +1,30 @@
#!/usr/bin/perl -wT
use strict;
use Test::More tests => 5;
use Config;

use_ok("IPC::System::Simple","run");

# A formatting bug caused ISS to mention its name twice in
# diagnostics. These tests make sure it's fixed.

SKIP: {
if (exists($Config{taint_support}) && not $Config{taint_support}) {
skip("your perl was built without taint support", 2);
}

eval {
run($^X);
};
eval {
run($^X);
};

like($@,qr{^IPC::System::Simple::run called with tainted argument},"Taint pkg only once");
like($@,qr{^IPC::System::Simple::run called with tainted argument},"Taint pkg only once");

eval {
run(1);
};
eval {
run(1);
};

like($@,qr{^IPC::System::Simple::run called with tainted environment},"Taint env only once");
like($@,qr{^IPC::System::Simple::run called with tainted environment},"Taint env only once");
}

# Delete everything in %ENV so we can't get taint errors.

Expand Down