mirror of
https://github.com/samba-team/samba.git
synced 2025-01-25 06:04:04 +03:00
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)
This commit is contained in:
parent
38f9de8ae5
commit
249174cfc5
@ -179,31 +179,48 @@ my $test_output = {};
|
|||||||
sub buildfarm_start_msg($)
|
sub buildfarm_start_msg($)
|
||||||
{
|
{
|
||||||
my ($state) = @_;
|
my ($state) = @_;
|
||||||
|
my $out = "";
|
||||||
|
|
||||||
print "--==--==--==--==--==--==--==--==--==--==--\n";
|
$out .= "--==--==--==--==--==--==--==--==--==--==--\n";
|
||||||
print "Running test $state->{NAME} (level 0 stdout)\n";
|
$out .= "Running test $state->{NAME} (level 0 stdout)\n";
|
||||||
print "--==--==--==--==--==--==--==--==--==--==--\n";
|
$out .= "--==--==--==--==--==--==--==--==--==--==--\n";
|
||||||
system("date");
|
$out .= scalar(localtime())."\n";
|
||||||
|
$out .= "NAME: $state->{NAME}\n";
|
||||||
|
$out .= "CMD: $state->{CMD}\n";
|
||||||
|
|
||||||
|
$test_output->{$state->{NAME}} = "";
|
||||||
|
|
||||||
|
print $out;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub buildfarm_output_msg($$)
|
sub buildfarm_output_msg($$)
|
||||||
{
|
{
|
||||||
my ($state, $output) = @_;
|
my ($state, $output) = @_;
|
||||||
|
|
||||||
print $output;
|
$test_output->{$state->{NAME}} .= $output;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub buildfarm_end_msg($$$)
|
sub buildfarm_end_msg($$$)
|
||||||
{
|
{
|
||||||
my ($state, $expected_ret, $ret) = @_;
|
my ($state, $expected_ret, $ret) = @_;
|
||||||
|
my $out = "";
|
||||||
|
|
||||||
print "==========================================\n";
|
|
||||||
if ($ret == $expected_ret) {
|
if ($ret == $expected_ret) {
|
||||||
print "TEST PASSED: $state->{NAME}\n";
|
$out .= "ALL OK\n";
|
||||||
} else {
|
} 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 = {
|
my $buildfarm_msg_ops = {
|
||||||
@ -212,6 +229,8 @@ my $buildfarm_msg_ops = {
|
|||||||
end_msg => \&buildfarm_end_msg
|
end_msg => \&buildfarm_end_msg
|
||||||
};
|
};
|
||||||
|
|
||||||
|
sub plain_output_msg($$);
|
||||||
|
|
||||||
sub plain_start_msg($)
|
sub plain_start_msg($)
|
||||||
{
|
{
|
||||||
my ($state) = @_;
|
my ($state) = @_;
|
||||||
@ -223,6 +242,8 @@ sub plain_start_msg($)
|
|||||||
|
|
||||||
$test_output->{$state->{NAME}} = "" unless $opt_verbose;
|
$test_output->{$state->{NAME}} = "" unless $opt_verbose;
|
||||||
|
|
||||||
|
plain_output_msg($state, "CMD: $state->{CMD}\n");
|
||||||
|
|
||||||
print $out;
|
print $out;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -263,7 +284,6 @@ sub run_test($$$$$)
|
|||||||
START => time()
|
START => time()
|
||||||
};
|
};
|
||||||
$msg_ops->{start_msg}($msg_state);
|
$msg_ops->{start_msg}($msg_state);
|
||||||
$msg_ops->{output_msg}($msg_state, "COMMAND: $cmd\n");
|
|
||||||
open(RESULT, "$cmd 2>&1|");
|
open(RESULT, "$cmd 2>&1|");
|
||||||
my $expected_ret = 1;
|
my $expected_ret = 1;
|
||||||
my $open_tests = {};
|
my $open_tests = {};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user