9 # For shutting up Test::Harness.
10 package My::Dev::Null;
12 @ISA = qw(Tie::StdHandle);
19 # Utility testing functions.
22 my($test, $name) = @_;
23 print "not " unless $test;
25 print " - $name" if defined $name;
32 return 0 unless keys %$a1 == keys %$a2;
35 foreach my $k (keys %$a1) {
36 $ok = $a1->{$k} eq $a2->{$k};
45 BEGIN { $| = 1; $^W = 1; }
46 END {print "not ok $test_num\n" unless $loaded;}
47 print "1..$Total_tests\n";
51 ######################### End of black magic.
179 $Total_tests = keys(%samples) + 1;
182 tie *NULL, 'My::Dev::Null' or die $!;
184 while (my($test, $expect) = each %samples) {
185 # _runtests() runs the tests but skips the formatting.
186 my($totals, $failed);
188 select NULL; # _runtests() isn't as quiet as it should be.
190 Test::Harness::_runtests("lib/sample-tests/$test");
195 ok( eqhash( $expect, {map { $_=>$totals->{$_} } keys %$expect} ),
198 else { # special case for bailout
199 ok( ($test eq 'bailout' and $@ =~ /Further testing stopped: GERONI/i),