summaryrefslogtreecommitdiff
path: root/source4/selftest/selftest.pl
diff options
context:
space:
mode:
Diffstat (limited to 'source4/selftest/selftest.pl')
-rwxr-xr-xsource4/selftest/selftest.pl18
1 files changed, 12 insertions, 6 deletions
diff --git a/source4/selftest/selftest.pl b/source4/selftest/selftest.pl
index 39a1b5a450..385d31bbfd 100755
--- a/source4/selftest/selftest.pl
+++ b/source4/selftest/selftest.pl
@@ -238,7 +238,13 @@ sub run_testsuite($$$$$$)
$msg_ops->start_test([], $name);
- open(RESULT, "$cmd 2>&1|");
+ unless (open(RESULT, "$cmd 2>&1|")) {
+ $statistics->{TESTS_ERROR}++;
+ $msg_ops->end_test([], $name, "error", 1, "Unable to run $cmd: $!");
+ $statistics->{SUITES_FAIL}++;
+ return 0;
+ }
+
my $expected_ret = parse_results(
$msg_ops, $statistics, *RESULT, \&expecting_failure, [$name]);
@@ -250,17 +256,17 @@ sub run_testsuite($$$$$$)
my $ret = close(RESULT);
$ret = 0 unless $ret == 1;
+ my $exitcode = $? >> 8;
+
if ($ret == 1) {
- $msg_ops->end_test([], $name, "success", $expected_ret != $ret, undef);
+ $msg_ops->end_test([], $name, "success", $expected_ret != $ret, undef);
} else {
- $msg_ops->end_test([], $name, "failure", $expected_ret != $ret,
- "Returned $ret");
+ $msg_ops->end_test([], $name, "failure", $expected_ret != $ret, "Exit code was $exitcode");
}
cleanup_pcap($pcap_file, $expected_ret, $ret);
- if (not $opt_socket_wrapper_keep_pcap and
- defined($pcap_file)) {
+ if (not $opt_socket_wrapper_keep_pcap and defined($pcap_file)) {
$msg_ops->output_msg("PCAP FILE: $pcap_file\n");
}