throvolos has asked for the wisdom of the Perl Monks concerning the following question:
Hello-
Please be gentle, this is my first question. =) I consider myself to be a novice perl user.
I'm trying to convince TAP::Parser::Aggregator that it is ok to coallate all of the "ok" messages provided by Test::More within the script that is calling aggregator, but can't seem to figure out how to make this happen.
The script doesn't call individual tests; rather, it just loads some parameters. The script itself, is thus being tested (to ensure its functionality).
I don't understand classes or objects very well, thus my confusion, I'm sure.
Is this possible? Thanks!
use Test::More; use TAP::Harness; use TAP::Parser::Aggregator; my $mm_start_time = gettimeofday; my $harness = TAP::Harness->new({ verbosity => -2, merge => 1, }); my $aggregator = TAP::Parser::Aggregator->new; $aggregator->start(); my $mm_parser; ## Doesn't work: ## $aggregator->add( 'myself', $mm_parser ); BEGIN { use_ok( 'ACTH::Base::Load_test', "load_test" ) or die "Could not use module ACTH::Base::Load_test"; can_ok( 'ACTH::Base::Load_test', "load_test" ); # others... } # lots of other work, subroutines called, etc done_testing( ); $aggregator->stop(); my $summary = <<'END_SUMMARY'; Passed: %s Failed: %s Unexpectedly succeeded: %s To do: %s Skipped: %s Planned: %s END_SUMMARY printf STDERR $summary, scalar $aggregator->passed, scalar $aggregator->failed, scalar $aggregator->todo_passed, scalar $aggregator->todo , scalar $aggregator->todo_passed, scalar $aggregator->skipped, scalar $aggregator->planned; exit 0;
Provides output like this. I'd prefer to see none of the "ok" meessages except when debugging...
ok 1 - use ACTH::Base::Load_test; ok 2 - ACTH::Base::Load_test->can('load_test') ok 3 - use ACTH::Base::Sanity_test; ok 4 - ACTH::Base::Sanity_test->can('sanity_test') ## ..snip... ===================================================== ===================================================== 1..23 Passed: 0 Failed: 0 Unexpectedly succeeded: 0 To do: 0 Skipped: 0 Planned: 0
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Aggregating "ok" messages within an aggregating script
by Khen1950fx (Canon) on Jan 20, 2011 at 07:27 UTC | |
by throvolos (Initiate) on Jan 20, 2011 at 22:26 UTC | |
by remiah (Hermit) on Jan 21, 2011 at 03:12 UTC |