Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3348776
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T01:35:02+00:00 2026-05-18T01:35:02+00:00

I run some TAP Tests using TAP::Formatter::HTML. This CPAN module generates beautiful dynamic HTML

  • 0

I run some TAP Tests using TAP::Formatter::HTML.

This CPAN module generates beautiful dynamic HTML Reports, but I want to use the number of passed tests, failed tests etc – to insert them into a database after all tests completed.

The code below does not work. It prints nothing to the console. I admit, for lines 10 and after, I just have slapped together some code from the POD descriptions of the TAP::* classes.

Before I dive into the source code of Aggregator, Harmess or Formatter classes and subclasses, I better ask:

does anyone here know how to make this code work?

    my $cons = TAP::Formatter::Console->new();
    my $fmt = TAP::Formatter::HTML->new;

    $fmt->css_uris( \@css_uris )->inline_css($my_css)->js_uris($js_uris)->inline_js($inline_js);

    my $harness = TAP::Harness->new( { formatter => $fmt, merge => 1 } );

    $fmt->output_file($outfile);
    $harness->test_args(["--browser=$browser", "--config=$config"]);
    my $aggregator = TAP::Parser::Aggregator->new;
    $aggregator->start();
    $harness->runtests(@tests);


#    $harness->aggregate_tests( $aggregator, @tests );
   $aggregator->stop();
#    print $fmt->summary($aggregator);
    my $txt = $cons->summary( $aggregator ); 
    my $summary = <<'END_SUMMARY';
    Passed:  %s
    Failed:  %s
    Unexpectedly succeeded: %s
END_SUMMARY
    printf $summary,
           scalar $aggregator->passed,
           scalar $aggregator->failed,
           scalar $aggregator->todo_passed;

    #$failcount = sprintf("%03d", $harness->failures());
    print "summary: $txt\n";
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T01:35:02+00:00Added an answer on May 18, 2026 at 1:35 am

    Why not get the test data from the same source TAP::Formatter::HTML does? It is probably inspecting the Test::Builder object and getting the test statistics from there. The Test::Builder object is a singleton, so it is pretty easy to request a copy of it after your tests have been done and extract the data from it for DB insertion, at about the same time the pretty HTML reports are generated.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using selenium to run some functional tests on the UI for our current
I'm trying to run some commands in paralel, in background, using bash. Here's what
I am trying to run some unit tests in a C# Windows Forms application
I'd like to run some small private/home applications on a local machine, but I
I need to run some precompile steps before I build my project using FlexBuilder.
I'm looking to run some un-verified scripts (written in a yet-to-be-determined language, but needs
I am modifying a Nant build script to run some unit tests. I have
I'm trying to run some queries to get rid of XSS in our database
I'm trying to run some python code under Apache 2.2 / mod_python 3.2.8. Eventually
Is there a way to run some custom Javascript whenever a client-side ASP.NET validator

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.