r25031: Use pointers to services rather than service numbers when possible.
[kai/samba.git] / source4 / selftest / output / plain.pm
index d3ffe228a7fc0b1c2660390122cbf4f0d27176ee..2cb510b7e806cd83ac73882170a943f53cfe4e57 100644 (file)
@@ -49,6 +49,13 @@ sub output_msg($$$)
        }
 }
 
+sub control_msg($$$)
+{
+       my ($self, $state, $output) = @_;
+
+       $self->output_msg($state, $output);
+}
+
 sub end_testsuite($$$$$)
 {
        my ($self, $state, $expected_ret, $ret, $envlog) = @_;
@@ -70,9 +77,15 @@ sub start_test($$)
        my ($state, $testname) = @_;
 }
 
-sub end_test($$$$)
+sub end_test($$$$$$)
 {
-       my ($state, $testname, $result, $unexpected) = @_;
+       my ($self, $state, $testname, $result, $unexpected, $reason) = @_;
+
+       if ($unexpected and $self->{immediate} and not $self->{verbose}) {
+               print "$testname: $result [ $reason ]\n";
+               print $self->{test_output}->{$state->{NAME}}."\n";
+       }
+       $self->{test_output}->{$state->{NAME}} = "";
 }
 
 sub summary($)
@@ -88,7 +101,13 @@ sub summary($)
                }
        }
 
-       print "FAILED ($self->{statistics}->{TESTS_UNEXPECTED_FAIL} failures and $self->{statistics}->{TESTS_ERROR} errors in $self->{statistics}->{SUITES_FAIL} testsuites)\n";
+       if ($self->{statistics}->{SUITES_FAIL} == 0) {
+               my $ok = $self->{statistics}->{TESTS_EXPECTED_OK} + 
+                                $self->{statistics}->{TESTS_EXPECTED_FAIL};
+               print "ALL OK ($ok tests in $self->{statistics}->{SUITES_OK} testsuites)\n";
+       } else {
+               print "FAILED ($self->{statistics}->{TESTS_UNEXPECTED_FAIL} failures and $self->{statistics}->{TESTS_ERROR} errors in $self->{statistics}->{SUITES_FAIL} testsuites)\n";
+       }
 }
 
 sub missing_env($$$)
@@ -98,11 +117,15 @@ sub missing_env($$$)
        print "FAIL: $name (ENV[$envname] not available!)\n";
 }
 
-sub skip_testsuite($$)
+sub skip_testsuite($$$)
 {
-       my ($self, $name) = @_;
+       my ($self, $envname, $name, $reason) = @_;
 
-       print "SKIPPED: $name\n";
+       if ($reason) {
+               print "SKIPPED: $name [$reason]\n";
+       } else {
+               print "SKIPPED: $name\n";
+       }
 }
 
 1;