diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2010-12-09 16:48:24 +0100 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2010-12-10 03:04:06 +0100 |
commit | 5f6dd9a608271948bb1d4a1fb975e889db70512c (patch) | |
tree | 3e1893f7e08d00145c70de0e98ea6a97d220a426 /selftest | |
parent | 680a2fb5173a74b65fa23ac0027f516ddd908e9b (diff) | |
download | samba-5f6dd9a608271948bb1d4a1fb975e889db70512c.tar.gz samba-5f6dd9a608271948bb1d4a1fb975e889db70512c.tar.bz2 samba-5f6dd9a608271948bb1d4a1fb975e889db70512c.zip |
selftest: Check exit code when listing tests.
Diffstat (limited to 'selftest')
-rwxr-xr-x | selftest/selftest.pl | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/selftest/selftest.pl b/selftest/selftest.pl index d8640e0d1a..213954cfbf 100755 --- a/selftest/selftest.pl +++ b/selftest/selftest.pl @@ -959,6 +959,17 @@ $envvarstr $cmd =~ s/\$LISTOPT/--list/; system($cmd); + + if ($? == -1) { + die("Unable to run $cmd: $!"); + } elsif ($? & 127) { + die(snprintf("%s died with signal %d, %s coredump\n", $cmd, ($? & 127), ($? & 128) ? 'with' : 'without')); + } + + my $exitcode = $? >> 8; + if ($exitcode != 0) { + die("$cmd exited with exit code $exitcode"); + } } } else { foreach (@todo) { |