From efe1883d9b278d97715cdc62cc50a105b2e455b2 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 19 Apr 2007 01:23:09 +0000 Subject: r22356: Simple refactoring. (This used to be commit 913aa17b0278e0861f2662768453e436a3d71e1e) --- source4/script/tests/selftest.pl | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'source4') diff --git a/source4/script/tests/selftest.pl b/source4/script/tests/selftest.pl index e991d0a3d6..747f0d100a 100755 --- a/source4/script/tests/selftest.pl +++ b/source4/script/tests/selftest.pl @@ -672,6 +672,12 @@ sub teardown_env($) delete $running_envs{$envname}; } +my $msg_ops; +if ($from_build_farm) { + $msg_ops = $buildfarm_msg_ops; +} else { + $msg_ops = $plain_msg_ops; +} if ($opt_testenv) { my $testenv_vars = setup_env("dc"); @@ -708,12 +714,8 @@ NETBIOSNAME=\$NETBIOSNAME\" && bash'"); my $pcap_file = "$pcap_dir/$shname.cap"; SocketWrapper::setup_pcap($pcap_file) if ($opt_socket_wrapper_pcap); - my $result; - if ($from_build_farm) { - $result = run_test($envname, $name, $cmd, $i, $suitestotal, $buildfarm_msg_ops); - } else { - $result = run_test($envname, $name, $cmd, $i, $suitestotal, $plain_msg_ops); - } + my $result = run_test($envname, $name, $cmd, $i, $suitestotal, + $msg_ops); if ($opt_socket_wrapper_pcap and $result and not $opt_socket_wrapper_keep_pcap) { @@ -738,7 +740,8 @@ my $end = time(); my $duration = ($end-$start); my $numfailed = $#$suitesfailed+1; if ($numfailed == 0) { - my $ok = $statistics->{TESTS_EXPECTED_OK} + $statistics->{TESTS_EXPECTED_FAIL}; + my $ok = $statistics->{TESTS_EXPECTED_OK} + + $statistics->{TESTS_EXPECTED_FAIL}; print "ALL OK ($ok tests in $statistics->{SUITES_OK} testsuites)\n"; } else { unless ($from_build_farm) { -- cgit