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

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

Expand Messages
  • Roger
    hmm....that s weird. I see the attachment in the sent mail. Anyhow I m attaching the file again. Thanks, Roger ________________________________ From: timothy
    Message 1 of 8 , Apr 18, 2012
      hmm....that's weird. I see the attachment in the sent mail. Anyhow I'm attaching the file again. Thanks, Roger



      ________________________________
      From: timothy adigun <2teezperl@...>
      To: perl-beginner@yahoogroups.com
      Sent: Wednesday, April 18, 2012 10:10 PM
      Subject: Re: [PBML] Displaying Summary Output in HTML page using "prove"

        >>>>> "Rog" == Roger <rfbits@...> wrote:
        Rog>    Hi PerlMonks,
        Rog>    I have a simple test file under t/. I want to display the summary
      after running all the tests. For some reason, the summary is displayed
      before the results of "04.pl" is displayed. How do I display the summary in
      the HTML page after running all the tests? Please refer the attached test.t
      file.

      There is no attached test.t file. Please check.

        Rog>    Thanks,
        Rog>    Roger
        Rog>    [Non-text portions of this message have been removed]
        Rog>   
        Rog>--
        Rog>Tim


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



      ------------------------------------

      Unsubscribing info is here: http://help.yahoo.com/help/us/groups/groups-32.htmlYahoo! Groups Links



      [Non-text portions of this message have been removed]
    • Roger
      hmm....that s weird. I see the attachment in the sent mail. Anyhow I m attaching the file again. Thanks, Roger ________________________________ From: timothy
      Message 2 of 8 , Apr 18, 2012
        hmm....that's weird. I see the attachment
        in the sent mail. Anyhow I'm attaching the file again. Thanks, Roger



        ________________________________
        From: timothy adigun <2teezperl@...>
        To: perl-beginner@yahoogroups.com
        Sent: Wednesday, April 18, 2012 10:10 PM
        Subject: Re: [PBML] Displaying Summary Output in HTML page using "prove"

          >>>>> "Rog" == Roger <rfbits@...> wrote:
          Rog>    Hi PerlMonks,
          Rog>    I have a simple test file under t/. I want to display the summary
        after running all the tests. For some reason, the summary is displayed
        before the results of "04.pl" is displayed. How do I display the summary in
        the HTML page after running all the tests? Please refer the attached test.t
        file.

        There is no attached test.t file. Please check.

          Rog>    Thanks,
          Rog>    Roger
          Rog>    [Non-text portions of this message have been removed]
          Rog>   
          Rog>--
          Rog>Tim


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



        ------------------------------------

        Unsubscribing info is here: http://help.yahoo.com/help/us/groups/groups-32.htmlYahoo! Groups Links



        [Non-text portions of this message have been removed]
      • Charles K. Clarkson
        ... [...] ... It looks like your attachment is being stripped. Try using Pastebin (http://pastebin.com/) or a similar service to share large blocks of code.
        Message 3 of 8 , Apr 19, 2012
          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
        • Roger
          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
          Message 4 of 8 , Apr 19, 2012
            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]
          • Jeremy Naylor
            ... Hey Roger and all, Charles is right - attachments are stripped from e-mails before they re sent to the e-mail list. Hope this helps. Cheers, Jeremy Naylor
            Message 5 of 8 , Apr 19, 2012
              At 18:33 19/04/2012, you wrote:
              >hmm....that's weird. I see the attachment in the sent mail. Anyhow
              >I'm attaching the file again. Thanks, Roger

              Hey Roger and all,

              Charles is right - attachments are stripped from e-mails before
              they're sent to the e-mail list.

              Hope this helps.

              Cheers,

              Jeremy Naylor (List moderator)
              p: +64 21 374 689
              e: jeremy.naylor@...
              w: http://www.r2.co.nz/~jeremy
              w: http://e-living.wellington.net.nz
            • Roger
              Resending the message..... ________________________________ From: Roger To: perl-beginner@yahoogroups.com
              Message 6 of 8 , Apr 22, 2012
                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.