in reply to Re^2: TAP question
in thread TAP question

I wasn't suggesting manually parsing them. If you just look for "not ok", for instance, you lose the ability to have TODO tests. I was suggesting having a single .t file that uses TAP::Harness to run the existing .t files and give a per-file ok or not ok result (that your outer framework interprets).

Replies are listed 'Best First'.
Re^4: TAP question
by emalossi (Novice) on Feb 27, 2008 at 15:45 UTC
    Hmm I guess I'm confused then. The only way I've generated TAP in the past is by using Test:More either ok() or is() or something to test values. Given that the existing .t files don't return predictable values, the only thing I could test for would be the TAP output that the test cases contained within are producing.

    How would running all of the .t files using TAP::Harness from within a .t file, rather than from the main script give me any different output?

    The only way I can imagine getting a different output would be to run it something like this:

    set SDTOUT to a file for each .t file run .t parse output file for each line do either: is(1,1,testcasename) or is(1,0,testcasename) next file

    What is is that you're suggesting?

      Something like this:
      use strict; use warnings; use Test::More; use TAP::Harness; my $harness = TAP::Harness->new({verbosity => -9}); my $agg_results = $harness->runtests(glob "suite_foo/*.t"); my @tests = $agg_results->descriptions; plan(tests => scalar(@tests)); for my $test (@tests) { my ($parser) = $agg_results->parsers($test); ok(! $parser->has_problems, $test); }
      Note that the new TAP::* modules have some documentation infelicities: TAP::Parser's has_problems says it complains about passed TODO tests but it doesn't (and shouldn't), and TAP::Harness verbosity < -2 (silent) isn't documented.