1 package TAP::Harness::IgnoreNonessentialDzilAutogeneratedTests;
6 use base 'TAP::Harness';
8 use IPC::Open2 'open2';
10 my $frivolous_test_map = {
11 # Test based on the extremely dep-heavy, *prone to failures* Test::CheckDeps
13 't/00-check-deps.t' => [
14 qr|^\Q# this test was generated with Dist::Zilla::Plugin::Test::CheckDeps|m,
16 # older non-annotated versions
17 qr|use \s+ Test::CheckDeps .*? ^\Qcheck_dependencies('suggests')\E .*? \QBAIL_OUT("Missing dependencies") if !Test::More->builder->is_passing|smx,
20 # "does everything compile" tests are useless by definition - this is what the
21 # rest of the test suite is for
24 qr|^\Q# this test was generated with Dist::Zilla::Plugin::Test::Compile|m,
29 my ($self, $aggregate, @all_tests) = @_;
31 my ($run_tests, $skip_tests);
35 my $fn = File::Spec::Unix->catpath( File::Spec->splitpath( $_ ) );
37 if (my $REs = $frivolous_test_map->{$fn}) {
38 my $slurptest = do { local (@ARGV, $/) = $fn; <> };
39 $slurptest =~ $_ and push @$skip_tests, $fn and next TESTFILE for @$REs;
42 push @$run_tests, $fn;
49 my $pid = open2(File::Spec->devnull, undef, $^X, qw(-I blib -I arch/lib), $_ )
50 or die "Sub-proc failed: $!";
53 $_ .= "[would NOT have passed: $?]" if $?;
56 print STDERR "=== Skipping nonessential autogenerated tests: @$skip_tests\n";
59 return $self->SUPER::aggregate_tests($aggregate, @$run_tests);