10 # For shutting up Test::Harness.
11 package My::Dev::Null;
13 @My::Dev::Null::ISA = qw(Tie::StdHandle);
20 # Utility testing functions.
23 my($test, $name) = @_;
25 $okstring = "not " unless $test;
26 $okstring .= "ok $test_num";
27 $okstring .= " - $name" if defined $name;
34 return 0 unless keys %$a1 == keys %$a2;
37 foreach my $k (keys %$a1) {
38 $ok = $a1->{$k} eq $a2->{$k};
45 use vars qw($Total_tests %samples);
48 BEGIN { $| = 1; $^W = 1; }
49 END {print "not ok $test_num\n" unless $loaded;}
50 print "1..$Total_tests\n";
54 ######################### End of black magic.
182 $Total_tests = keys(%samples) + 1;
185 tie *NULL, 'My::Dev::Null' or die $!;
187 while (my($test, $expect) = each %samples) {
188 # _run_all_tests() runs the tests but skips the formatting.
189 my($totals, $failed);
191 select NULL; # _run_all_tests() isn't as quiet as it should be.
193 Test::Harness::_run_all_tests("lib/sample-tests/$test");
198 ok( eqhash( $expect, {map { $_=>$totals->{$_} } keys %$expect} ),
201 else { # special case for bailout
202 ok( ($test eq 'bailout' and $@ =~ /Further testing stopped: GERONI/i),