in reply to Complex App testing w/ TAP::Harness (nesting/dividing?)

Rename t directory to tests so the default harness doesn't run, then from test.pl call your two independent programs, see Re^13: Do Pure Perl CPAN packages really need to use ExtUtils::Command::MM?

  • Comment on Re: Complex App testing w/ TAP::Harness (nesting/dividing?)

Replies are listed 'Best First'.
Re^2: Complex App testing w/ TAP::Harness (nesting/dividing?)
by Seba (Acolyte) on Jun 13, 2012 at 13:26 UTC

    Your solution will probably work too, but I've found a simpler solution - less changes in current code.

    I just iterate over all tests on my own using TAP::Parser and now top-level TAP::Harness is happy.

    #!/usr/bin/perl use strict; use warnings; use TAP::Harness; use TAP::Parser; use Test::More 'no_plan'; my $tap = TAP::Harness->new( { 'color' => 1, 'verbosity' => 1, 'lib' => ['lib', 'blib/lib', 'blib/arch'], 'timer' => 1 } ); my @tests = (glob('t/unit/**/*.t'), glob('t/unit/*.t')); foreach my $test (@tests) { my $parser = TAP::Parser->new({source => \$test}); while (my $result = $parser->next) { next unless $result->is_test; ok($result->is_ok, "[$test] " . $result->as_string); } } ok(1, "Unit tests run");