]>
git.saurik.com Git - apple/security.git/blob - Security/regressions/t/security.pl
3 # Copyright (c) 2006-2007,2012 Apple Inc. All Rights Reserved.
9 return unless $$ == $pid;
10 rm_test
($_) for @TOCLEAN;
20 plan skip_all
=> "security not installed";
29 return unless $$ == $pid;
30 $SIG{__WARN__
} = sub { 1 };
31 cleanup_test
($_) for @TOCLEAN;
37 my $xd = "/tmp/test-$pid";
38 my $security = 'security';
40 push @TOCLEAN, [$xd, $security];
41 return ($xd, $security);
45 my ($xd, $security) = @{+shift};
50 return unless $ENV{TEST_VERBOSE
};
51 my ($xd, $security) = @{+shift};
55 my ($security, $cmd, $arg, $expected, $test) = @_;
57 run3
([$security, $cmd, @$arg], \
undef, \
$output, \
$output);
58 # open(STDOUT, ">&STDERR") || die "couldn't dup strerr: $!";
59 # open(my $out, '-|', $security, $cmd, @$arg);
60 # while (<$out>) { $output .= $_; }
62 my $cmp = (grep {ref ($_) eq 'Regexp'} @$expected)
63 ? \
&is_deeply_like
: \
&is_deeply
;
64 @_ = ([sort split (/\r?\n/, $output)], [sort @$expected], $test || join(' ', $cmd, @$arg));