From 4c2eeb064ad226eb30acc26183659a48d41e48c5 Mon Sep 17 00:00:00 2001 From: Dan Date: Wed, 29 Nov 2023 03:21:58 -0800 Subject: [PATCH] fixed --- VortexEngine/tests/record_test.sh | 12 ++++++++---- VortexEngine/tests/recordtests.sh | 4 +++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/VortexEngine/tests/record_test.sh b/VortexEngine/tests/record_test.sh index 03a35a9c83..d373dad005 100644 --- a/VortexEngine/tests/record_test.sh +++ b/VortexEngine/tests/record_test.sh @@ -27,7 +27,9 @@ ARGS="$(grep "Args=" $FILE | cut -d= -f2)" TESTNUM="$(echo $FILE | cut -d/ -f2 | cut -d_ -f1 | cut -d/ -f2)" TESTNUM=$((10#$TESTNUM)) -$QUIET || echo -e -n "\e[31mRecording $PROJECT ($TESTCOUNT/$NUMFILES) \e[33m[\e[97m$BRIEF\e[33m] \e[33m[\e[97m$ARGS\e[33m]...\e[0m" +if [ "$QUIET" -eq 0 ]; then + echo -e -n "\e[31mRecording $PROJECT ($TESTCOUNT/$NUMFILES) \e[33m[\e[97m$BRIEF\e[33m] \e[33m[\e[97m$ARGS\e[33m]...\e[0m" +fi TEMP_FILE="tmp/${FILE}.out" # Append the output of the $VORTEX command to the temp file # NOTE: When recording the tests we don't use valgrind because @@ -44,9 +46,11 @@ $VORTEX $ARGS --no-timestep --hex <<< $INPUT >> $TEMP_FILE sed -i 's/\r//g' $TEMP_FILE # Replace the original file with the modified temp file mv $TEMP_FILE $FILE -$QUIET || echo -e "\e[96mOK\e[0m" -$QUIET && echo -e "." -# print out colorful if in verbose +if [ "$QUIET" -eq 0 ]; then + echo -e "\e[96mOK\e[0m" +else + echo -e "." +fi if [ "$VALIDATE" -eq 1 ]; then $VORTEX $ARGS --no-timestep --color <<< $INPUT echo -e "\e[31mRecorded \e[33m[\e[97m$BRIEF\e[33m] \e[33m[\e[97m$ARGS\e[33m]\e[0m" diff --git a/VortexEngine/tests/recordtests.sh b/VortexEngine/tests/recordtests.sh index 1202d63941..8edfa4ab4f 100644 --- a/VortexEngine/tests/recordtests.sh +++ b/VortexEngine/tests/recordtests.sh @@ -123,7 +123,9 @@ function record_tests() { # Wait for all background jobs to finish wait - $QUIET && echo ". Complete" + if [ "$QUIET" -eq 1]; then + echo ". Complete" + fi echo "All tests recorded successfully!" #rm -rf tmp/$PROJECT }