diff --git a/runtests b/runtests index 873b7cc8..acd377e1 100755 --- a/runtests +++ b/runtests @@ -10,6 +10,8 @@ TESTS_CLIENT="tests-client" TESTS_SERVER="tests-server" TEST_FILES="" SUB_FOLDERS="" +TEST_LIST_FILE="/tmp/tests" +OLD_IFS="" usage() { cat << _EOF @@ -100,6 +102,8 @@ runcmdfile() { local logfile=$2 local subfolder="" local file_type="" + local lines="" + local line="" if [[ "$cmdfile" == *"/"* ]]; then subfolder=${cmdfile%/*} @@ -107,13 +111,14 @@ runcmdfile() { echo "cmdfile:$cmdfile(no '/') is not in a subfolder!" fi - while read -r line; do - if grep -Eq "^#.*" <<< "$line" || grep -Eq "^$" <<< "$line"; then - continue - fi - + grep -v "^#.*" "$cmdfile" | grep -v "^$" > "$TEST_LIST_FILE" + lines=$(cat $TEST_LIST_FILE) + OLD_IFS="$IFS" + IFS=$'\n' + for line in $lines; do runtest "$line" "$logfile" "$subfolder" - done < "$cmdfile" + done + IFS="$OLD_IFS" } prepare_files_list() {