use strict;
use base 'TAP::Harness';
-use File::Spec;
-use IPC::Open2 'open2';
+use File::Spec ();
+use IPC::Open3 'open3';
+use File::Temp ();
my $frivolous_test_map = {
# Test based on the extremely dep-heavy, *prone to failures* Test::CheckDeps
if ($skip_tests) {
- for (@$skip_tests) {
+ for my $tfn (@$skip_tests) {
- my $pid = open2(File::Spec->devnull, undef, $^X, qw(-I blib -I arch/lib), $_ )
- or die "Sub-proc failed: $!";
+ (my $tfn_flattened = $tfn) =~ s|/|_|g;
+
+ my $log_file = File::Temp->new(
+ DIR => '/tmp',
+ TEMPLATE => "AutoGenTest_${tfn_flattened}_XXXXX",
+ SUFFIX => '.txt',
+ );
+
+ # FIXME I have no idea why the fileno dance is necessary - will investigate later
+ # All I know is that if I pass in just $log_file - open3 ignores it >:(
+ my $pid = open3(undef, '>&'.fileno($log_file), undef, $^X, qw(-I blib -I arch/lib), $tfn );
waitpid ($pid, 0);
+ my $ex = $?;
+
+ if ($ex) {
+ # use qx as opposed to another open3 until I figure out the above
+ close $log_file or die "Unable to close $log_file: $!";
+ chomp( my $url = `/usr/bin/nopaste -q -s Shadowcat -d $log_file < $log_file` );
- $_ .= "[would NOT have passed: $?]" if $?;
+ $tfn .= "[would NOT have passed: $ex / $url]";
+ }
}
print STDERR "=== Skipping nonessential autogenerated tests: @$skip_tests\n";