Loading ...
Sorry, an error occurred while loading the content.

Re: [PBML] Displaying Summary Output in HTML page using "prove"

Expand Messages
  • Roger
    Resending the message..... ________________________________ From: Roger To: perl-beginner@yahoogroups.com
    Message 1 of 8 , Apr 22, 2012
    • 0 Attachment
      Resending the message.....



      ________________________________
      From: Roger <rfbits@...>
      To: "perl-beginner@yahoogroups.com" <perl-beginner@yahoogroups.com>
      Cc: "cclarkson@..." <cclarkson@...>
      Sent: Thursday, April 19, 2012 3:19 PM
      Subject: Re: [PBML] Displaying Summary Output in HTML page using "prove"


      Here's the code and output:

      ======> test.t

      #!/usr/bin/perl

      use strict;
      use warnings;

      require "/home/mydir/perl5/lib/perl5/TAP/Harness.pm";
      require "/home/mydir/perl5/lib/perl5/TAP/Formatter/HTML.pm";
      require "/home/mydir/perl5/lib/perl5/TAP/Parser/Aggregator.pm";

      use Test::More;

      my @tests = qw[01.pl 02.pl 03.pl 04.pl];
      my $no_of_tests = scalar @tests;
      plan tests => $no_of_tests;

      my $f = TAP::Formatter::HTML->new;
      $f->verbosity(-1);
      $f->force_inline_css(0);

      my %args = (
              formatter => $f,
              merge => 1,
      );
      my $a =
      TAP::Parser::Aggregator->new;
      my $h = TAP::Harness->new(\%args);
      $a->start;
      $h->aggregate_tests($a, @tests);
      $a->stop;

      done_testing($no_of_tests);

      # Print Summary
      my $summary = <<'END_SUMMARY';
      Total Tests:    %s
      Passed:    %s
      Failed:    %s
      Unexpectedly succeeded: %s
      END_SUMMARY

      printf $summary,
      scalar $a->total,
      scalar $a->passed,
      scalar $a->failed,
      scalar $a->todo_passed;


      =======> I used "prove" to run the script:
      prove -m -Q t/*.pl --formatter TAP::Formatter::HTML > Out.html


      ========> HTML Output

          1..4
          not ok 1 - First
          ok 1 - Second
          ok 1 - Third
          Total Tests: 4
          Passed: 3
          Failed: 1
          Unexpectedly succeeded: 0
          ok 1 - Four 


      Thanks,

      Roger


      ________________________________
      From: Charles K. Clarkson <cclarkson@...>
      To: perl-beginner@yahoogroups.com
      Sent: Thursday, April 19, 2012 8:57 AM
      Subject: Re: [PBML] Displaying Summary Output in HTML page using "prove"


       
      On 4/19/2012 1:33 AM, Roger wrote:
      > hmm....that's weird. I see the attachment in the sent mail.
      > Anyhow I'm attaching the file again.

      [...]

      > [Non-text portions of this message have been removed]

      It looks like your attachment is being stripped. Try using
      Pastebin (http://pastebin.com/) or a similar service to share
      large blocks of code. Feel free to add a few lines of code in
      the message.

      HTH,

      Charles Clarkson
      --
      Free Market Advocate
      Mobile Home Investor
      Programmer

      I'm not really a smart person. I just play one on the Internet.

      Stephenville, TX
      http://twitter.com/CharlesClarkson
      +1 (254) 434-2733



      [Non-text portions of this message have been removed]
    Your message has been successfully submitted and would be delivered to recipients shortly.