Skip to content

Commit

Permalink
runtests: ensure all list cases are not cleared before testing
Browse files Browse the repository at this point in the history
Shell read command will be cleared in the vm test, ensure all the test TODO list
are not cleared before testing, improve the TODO list way.

Signed-off-by: Pengfei Xu <[email protected]>
  • Loading branch information
xupengfe committed Sep 27, 2023
1 parent dd8c243 commit a3fc6cd
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions runtests
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -100,20 +102,23 @@ runcmdfile() {
local logfile=$2
local subfolder=""
local file_type=""
local lines=""
local line=""

if [[ "$cmdfile" == *"/"* ]]; then
subfolder=${cmdfile%/*}
else
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() {
Expand Down

0 comments on commit a3fc6cd

Please sign in to comment.