# `processor : XX` line
export NUMTHREADS=$(( $(perl -0777 -n -e 'print (/ (?: .+ ^ processor \s+ : \s+ (\d+) ) (?! ^ processor ) /smx)' < /proc/cpuinfo) + 1 ))
+run_or_err "Installing App::Nopaste from APT" "sudo apt-get install --allow-unauthenticated -y libapp-nopaste-perl"
+# FIXME - the debian package is oddly broken - uses a bin/env based shebang
+# so nothing works under a brew. Fix here until #debian-perl patches it up
+sudo /usr/bin/perl -p -i -e 's|#!/usr/bin/env perl|#!/usr/bin/perl|' $(which nopaste)
+
if [[ "$CLEANTEST" != "true" ]]; then
### apt-get invocation - faster to grab everything at once
#
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";