From: Martin Schwenke Date: Mon, 9 Sep 2019 10:51:51 +0000 (+1000) Subject: ctdb-tests: Simplify ctdb_test_run() X-Git-Tag: talloc-2.3.1~488 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e7e6f4067e4a0de1ccfc8650fb0e87b8b6e0d620;p=thirdparty%2Fsamba.git ctdb-tests: Simplify ctdb_test_run() Only the test file name is ever passed. Reindent while touching many existing lines. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- diff --git a/ctdb/tests/run_tests.sh b/ctdb/tests/run_tests.sh index a2c124ed050..1d5b7f3318b 100755 --- a/ctdb/tests/run_tests.sh +++ b/ctdb/tests/run_tests.sh @@ -129,23 +129,21 @@ ctdb_test_end () ctdb_test_run () { - local name="$1" ; shift - - [ -n "$1" ] || set -- "$name" + local f="$1" - $no_header || ctdb_test_begin "$name" + $no_header || ctdb_test_begin "$f" - local status=0 - if [ -x "$1" ] ; then - timeout "$test_time_limit" "$@" || status=$? - else - echo "TEST IS NOT EXECUTABLE" - status=1 - fi + local status=0 + if [ -x "$f" ] ; then + timeout "$test_time_limit" "$f" || status=$? + else + echo "TEST IS NOT EXECUTABLE" + status=1 + fi - $no_header || ctdb_test_end "$name" "$status" "$*" + $no_header || ctdb_test_end "$f" "$status" - return $status + return $status } ######################################################################