Here is what I came up with to avoid the "Unable to find object method" error at the bottom of this answer:
#! /usr/bin/perl use strict; use warnings; use Test::More tests => 1; ok(int rand 2, 'this test randomly passes or fails'); my $FAILcount = 0; foreach my $detail (Test::Builder->details()) { if (${%$detail}{ok}==0) { $FAILcount++; } } if ($FAILcount == 0) { print "hooray!\n"; } else { print "aw... :(\n"; }
On Solaris 10 with Perl v5.8.4 (with 31 registered patches) I got the following
Can't locate object method "is_passing" via package "Test::Builder"
philant
source share