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