Test::...GplArt(3pm)

πŸ“¦
version 0.0306 Β· 2 versions
, in fedora 43

πŸ’– Test::...GplArt(3pm) πŸ’–

okay bestie, so this page is filed under Test::...GplArt(3pm) in the User Contributed Perl Documentation, and the actual module it's yelling about is called Test::Run::Straps. buckle up, because this one is a museum piece and we're gonna read the plaque together. πŸŽ€


⚠️ WARNING ⚠️

bestie. listen. πŸ’€

This module contains nothing but old (and possibly out of date) documentation. Like, literally nothing else. All the code-wise functionality got moved to the MIT X11-licensed Test::Run::Straps and other modules.

So β€” don't use this module. 🚫 But you may wish to consult its documentation for reference. it's giving "old diary in the attic" energy, iykyk.


✨ SYNOPSIS ✨

  use Test::Run::Straps;

  my $strap = Test::Run::Straps->new;

  # Various ways to interpret a test
  my $results = $strap->analyze($name, \@test_output);
  my $results = $strap->analyze_fh($name, $test_filehandle);
  my $results = $strap->analyze_file($test_file);

  # UNIMPLEMENTED
  my %total = $strap->total_results;

  # Altering the behavior of the strap  UNIMPLEMENTED
  my $verbose_output = $strap->dump_verbose();
  $strap->dump_verbose_fh($output_filehandle);
heads up: total_results, dump_verbose and dump_verbose_fh are marked UNIMPLEMENTED in the source, so don't come for them, they are not coming for you. πŸ™ˆ

🌸 DESCRIPTION 🌸

THIS IS ALPHA SOFTWARE in that the interface is subject to change in incompatible ways. (translation: the vibes are stable but the API might glow up and break your code πŸ’…). It is otherwise stable.

So here's the lore: Test::Run is limited to printing out its results. Which, ngl, makes analysis of the test results difficult for anything but a human. 😭 To make it easier for programs to work with test results, we provide Test::Run::Straps. Instead of printing the results, straps provide them as raw data. You can also configure how the tests are to be run. main character behavior honestly.

The interface is currently incomplete. Please contact the author if you'd like a feature added or something changed or you just have comments. they want the feedback fr fr 🫢


πŸ” ANALYSIS πŸ”

🌈 Parsing 🌈

Methods for identifying what sort of line you're looking at. (yes that's the whole bit, it's shy)

πŸ’œ Results πŸ’œ

The %results returned from analyze() contain the following information:

  • passing β€” true if the whole test is considered a pass (or skipped), false if its a failure
  • exit β€” the exit code of the test run, if from a file
  • wait β€” the wait code of the test run, if from a file
  • max β€” total tests which should have been run
  • seen β€” total tests actually seen
  • skip_all β€” if the whole test was skipped, this will contain the reason.
  • ok β€” number of tests which passed (including todo and skips)
  • todo β€” number of todo tests seen
  • bonus β€” number of todo tests which unexpectedly passed
  • skip β€” number of tests skipped

So a successful test should have max == seen == ok. periodt. πŸ’š

There is one final item, the details.

  • details β€” an array ref reporting the result of each test, looks like this:
  $results{details}[$test_num - 1] =
          { ok          => is the test considered ok?
            actual_ok   => did it literally say 'ok'?
            name        => name of the test (if any)
            diagnostics => test diagnostics (if any)
            type        => 'skip' or 'todo' (if any)
            reason      => reason for the above (if any)
          };

Element 0 of the details is test #1. The author tried it with element 1 being #1 and 0 being empty, and says this is less awkward. iconic decision-making tbh πŸ‘‘


πŸ¦‹ EXAMPLES πŸ¦‹

See examples/mini_harness.plx for an example of use. go peek bestie, it's right there πŸ“


πŸ‘‘ AUTHOR πŸ‘‘

Michael G Schwern "<schwern@pobox.com>", later maintained by Andy Lester "<andy@petdance.com>".

Converted to Test::Run::Straps by Shlomi Fish, <http://www.shlomifish.org/> .


πŸ“œ LICENSE πŸ“œ

This file is distributed under the same terms as perl. (GPL2 or Later + Artistic 1).


🌟 SEE ALSO 🌟

  • Test::Run
  • Test::Run::Straps

and that's the whole page, bestie!! πŸ’… this was perl v5.42.0, dated 2025-07-25, and it lives under Test::...GplArt(3pm) in the User Contributed Perl Documentation. slay, go read Test::Run::Straps instead, mwah πŸ«Άβœ¨πŸŽ€

πŸ“¦ where this page comes from