ci: Do not shift if there are not enough arguments

This commit is contained in:
ZyX 2017-03-31 20:52:05 +03:00
parent 86f5b1276b
commit 6ddaace7ac

View File

@ -45,10 +45,10 @@ fail() {
run_test() {
local cmd="$1"
shift
test $# -gt 0 && shift
local test_name="$1"
: ${test_name:=$cmd}
shift
test $# -gt 0 && shift
if ! eval "$cmd" ; then
fail "${test_name}" "$@"
fi
@ -56,12 +56,12 @@ run_test() {
run_test_wd() {
local timeout="$1"
shift
test $# -gt 0 && shift
local cmd="$1"
shift
test $# -gt 0 && shift
local test_name="$1"
: ${test_name:=$cmd}
shift
test $# -gt 0 && shift
local output_file="$(mktemp)"
local status_file="$(mktemp)"
local restarts=5