diff options
author | Stefan Metzmacher <metze@samba.org> | 2007-04-18 12:49:05 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:51:04 -0500 |
commit | 249174cfc51427364336d0e1f04876bb1b93e14a (patch) | |
tree | 3bf5e03b1a48e10fa6a98b1bbf4518ecf7e0ac8d /source4 | |
parent | 38f9de8ae5231936f9aee01d75aaa481c2ecd425 (diff) | |
download | samba-249174cfc51427364336d0e1f04876bb1b93e14a.tar.gz samba-249174cfc51427364336d0e1f04876bb1b93e14a.tar.bz2 samba-249174cfc51427364336d0e1f04876bb1b93e14a.zip |
r22334: don't print the test output if the test passed
(in build-farm mode)
use scalar(localtime()) instead of system("date")
metze
(This used to be commit d1d485fd0c0b9ebc1c9d5635397ee44d7c7406bb)
Diffstat (limited to 'source4')
-rwxr-xr-x | source4/script/tests/selftest.pl | 40 |
1 files changed, 30 insertions, 10 deletions
diff --git a/source4/script/tests/selftest.pl b/source4/script/tests/selftest.pl index 7a8faa8870..d486c43c0b 100755 --- a/source4/script/tests/selftest.pl +++ b/source4/script/tests/selftest.pl @@ -179,31 +179,48 @@ my $test_output = {}; sub buildfarm_start_msg($) { my ($state) = @_; + my $out = ""; + + $out .= "--==--==--==--==--==--==--==--==--==--==--\n"; + $out .= "Running test $state->{NAME} (level 0 stdout)\n"; + $out .= "--==--==--==--==--==--==--==--==--==--==--\n"; + $out .= scalar(localtime())."\n"; + $out .= "NAME: $state->{NAME}\n"; + $out .= "CMD: $state->{CMD}\n"; - print "--==--==--==--==--==--==--==--==--==--==--\n"; - print "Running test $state->{NAME} (level 0 stdout)\n"; - print "--==--==--==--==--==--==--==--==--==--==--\n"; - system("date"); + $test_output->{$state->{NAME}} = ""; + + print $out; } sub buildfarm_output_msg($$) { my ($state, $output) = @_; - print $output; + $test_output->{$state->{NAME}} .= $output; } sub buildfarm_end_msg($$$) { my ($state, $expected_ret, $ret) = @_; + my $out = ""; - print "==========================================\n"; if ($ret == $expected_ret) { - print "TEST PASSED: $state->{NAME}\n"; + $out .= "ALL OK\n"; } else { - print "TEST FAILED: $state->{NAME} (status $ret)\n"; + $out .= "ERROR: $ret"; + $out .= $test_output->{$state->{NAME}}; } - print "==========================================\n"; + + $out .= "==========================================\n"; + if ($ret == $expected_ret) { + $out .= "TEST PASSED: $state->{NAME}\n"; + } else { + $out .= "TEST FAILED: $state->{NAME} (status $ret)\n"; + } + $out .= "==========================================\n"; + + print $out; } my $buildfarm_msg_ops = { @@ -212,6 +229,8 @@ my $buildfarm_msg_ops = { end_msg => \&buildfarm_end_msg }; +sub plain_output_msg($$); + sub plain_start_msg($) { my ($state) = @_; @@ -223,6 +242,8 @@ sub plain_start_msg($) $test_output->{$state->{NAME}} = "" unless $opt_verbose; + plain_output_msg($state, "CMD: $state->{CMD}\n"); + print $out; } @@ -263,7 +284,6 @@ sub run_test($$$$$) START => time() }; $msg_ops->{start_msg}($msg_state); - $msg_ops->{output_msg}($msg_state, "COMMAND: $cmd\n"); open(RESULT, "$cmd 2>&1|"); my $expected_ret = 1; my $open_tests = {}; |