mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
ctdb-tests: Continue running if a testcase is not executable
At the moment the whole test run aborts without printing a summary of results but inexplicably succeeds. Instead, generate a clear failure for a non-executable testcase. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This commit is contained in:
parent
cda3b23337
commit
36e7043fb1
@ -29,6 +29,12 @@ die ()
|
||||
echo "$1" >&2 ; exit ${2:-1}
|
||||
}
|
||||
|
||||
# Print a message and return failure
|
||||
fail ()
|
||||
{
|
||||
echo "$1" >&2 ; return ${2:-1}
|
||||
}
|
||||
|
||||
######################################################################
|
||||
|
||||
with_summary=true
|
||||
@ -186,10 +192,13 @@ run_one_test ()
|
||||
{
|
||||
local f="$1"
|
||||
|
||||
[ -x "$f" ] || die "test \"$f\" is not executable"
|
||||
tests_total=$(($tests_total + 1))
|
||||
|
||||
ctdb_test_run "$f" | tee "$tf" | show_progress
|
||||
if [ -x "$f" ] ; then
|
||||
ctdb_test_run "$f" | tee "$tf" | show_progress
|
||||
else
|
||||
ctdb_test_run "$f" fail "TEST NOT EXECUTABLE"
|
||||
fi
|
||||
status=$?
|
||||
if [ $status -eq 0 ] ; then
|
||||
tests_passed=$(($tests_passed + 1))
|
||||
|
Loading…
Reference in New Issue
Block a user