svn commit: samba r22334 - in branches/SAMBA_4_0/source/script/tests: .

metze at samba.org metze at samba.org
Wed Apr 18 12:49:05 GMT 2007


Author: metze
Date: 2007-04-18 12:49:05 +0000 (Wed, 18 Apr 2007)
New Revision: 22334

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=22334

Log:
don't print the test output if the test passed
(in build-farm mode)

use scalar(localtime()) instead of system("date")

metze
Modified:
   branches/SAMBA_4_0/source/script/tests/selftest.pl


Changeset:
Modified: branches/SAMBA_4_0/source/script/tests/selftest.pl
===================================================================
--- branches/SAMBA_4_0/source/script/tests/selftest.pl	2007-04-18 12:17:53 UTC (rev 22333)
+++ branches/SAMBA_4_0/source/script/tests/selftest.pl	2007-04-18 12:49:05 UTC (rev 22334)
@@ -179,31 +179,48 @@
 sub buildfarm_start_msg($)
 {
 	my ($state) = @_;
+	my $out = "";
 
-	print "--==--==--==--==--==--==--==--==--==--==--\n";
-	print "Running test $state->{NAME} (level 0 stdout)\n";
-	print "--==--==--==--==--==--==--==--==--==--==--\n";
-	system("date");
+	$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";
+
+	$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 @@
 	end_msg		=> \&buildfarm_end_msg
 };
 
+sub plain_output_msg($$);
+
 sub plain_start_msg($)
 {
 	my ($state) = @_;
@@ -223,6 +242,8 @@
 
 	$test_output->{$state->{NAME}} = "" unless $opt_verbose;
 
+	plain_output_msg($state, "CMD: $state->{CMD}\n");
+
 	print $out;
 }
 
@@ -263,7 +284,6 @@
 		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 = {};



More information about the samba-cvs mailing list