Blast-Radius Aware AI Code Review for Business-Critical Systems
LiveReview LiveReview Explore LiveReview

Test2::Harness::Renderer - Base class for Test2::Harness event renderers.

Attributes

       These are set at construction time and cannot be changed.

       $settings = $renderer->settings
           Get the Test2::Harness::Settings reference.

       $int = $renderer->verbose
           Get the verbosity level.

       $bool = $renderer->progress
           True if progress indicators should be shown.

       $bool = $renderer->color
           True if color should be used.

Authors

       Chad Granum <exodist@cpan.org>

Description

Maintainers

       Chad Granum <exodist@cpan.org>

Methods

       $renderer->render_event($event)
           Called for every event. Return is ignored.

       $renderer->finish(%ARGS)
           Called once after testing is done.

           %ARGS:

       $renderer->signal($signal)
           Called  when the rendering process receives a signal. This is your chance to do any cleanup or report
           the signal. This is not an event, you can ignore it. Do not exit or throw any exceptions here please.

           settings => $settings
               Get the Test2::Harness::Settings reference.

           pass => $bool
               True if tests passed.

           tests_seen => $int
               Number of test files seen.

           asserts_seen => $int
               Number of assertions made.

           final_data => $final_data
               The final_data looks like this, note that some data may not be present if it is  not  applicable.
               The data structure can be as simple as "{ pass => $bool }".

                   {
                       pass => $pass,    # boolean, did the test run pass or fail?

                       failed => [       # Jobs that failed, and did not pass on a retry
                           [$job_id1, $file1],    # Failing job 1
                           [$job_id2, $file2],    # Failing job 2
                           ...
                       ],
                       retried => [               # Jobs that failed and were retried
                           [$job_id1, $times_run1, $file1, $passed_eventually1],    # Passed_eventually is a boolean
                           [$job_id2, $times_run2, $file2, $passed_eventually2],
                           ...
                       ],
                       hatled => [                                                  # Jobs that caused the entire test suite to halt
                           [$job_id1, $file1, $halt_reason1],                       # halt_reason is a human readible string
                           [$job_id2, $file2, $halt_reason2],
                       ],
                   }

Name

       Test2::Harness::Renderer - Base class for Test2::Harness event renderers.

Source

       The source code repository for Test2-Harness can be found at http://github.com/Test-More/Test2-Harness/.

See Also