Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • Have you consider using

          die_on_fail {
                # your tests go here.


    life is short
    • Actually, I've been thinking about putting a failure handler there. I think it's a better solution:

      use Test::Most
          tests   => 3,
          on_fail => sub {
              # whatever you want

      That gives end users maximum flexibility.

      Right now, though, I've discovered that the latest release, which incorporates Test::Deep, doesn't play well with Test::Class [].

      • But that only gives you a global handler, with little knowledge of the test that failed.

        The other suggestion is more local. And even lexical.

        life is short
        • Actually, I'd be passing in the same information the current die handler gets, so you would have complete knowledge of the test which failed (well, as much as Test::Harness has). And it would be file scoped, not global.