Use yath instead of prove.

$ cat example.t use Test::More; subtest foo => sub { ok 1; ok 2; ok 3; }; subtest bar => sub { ok 4; ok 5; }; done_testing; $ yath example.t ** Defaulting to the 'test' command ** ( PASSED ) job 1 example.t Yath Result Summary ---------------------------------------------------------------------- +------------- File Count: 1 Assertion Count: 7 Wall Time: 0.36 seconds CPU Time: 0.53 seconds (usr: 0.16s | sys: 0.01s | cusr: 0.31s | + csys: 0.05s) CPU Usage: 146% --> Result: PASSED <--

Note assertion count is seven: five individual assertions plus the two subtest blocks grouping them.

Yath is just a better test runner in so many ways. If you have a large test suite, you can set it to send a notification by email or by Slack when the test suite has finished running. You can add # HARNESS-DURATION-LONG comments to long-running tests then run yath --no-long to only run short/medium tests. You can create a JSON log of a test run, then run yath --rerun-failed to just re-run the tests that failed last time. And the default output is prettier.


In reply to Re: Count assertions by tobyink
in thread Count assertions by 1nickt

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.