Skip to content

Commit

Permalink
Merge branch 'master' into orbit
Browse files Browse the repository at this point in the history
  • Loading branch information
Unreal-Dan committed Nov 30, 2023
2 parents 7fdc570 + c7ae108 commit 458e10b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 6 deletions.
12 changes: 9 additions & 3 deletions VortexEngine/tests/record_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ FILE=$1
VALIDATE=$2
TESTCOUNT=$3
NUMFILES=$4
QUIET=$5

if [ "$FILE" == "" ]; then
echo "$0 <test file> <validate> <total tests>"
Expand All @@ -26,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))

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
Expand All @@ -43,8 +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
echo -e "\e[96mOK\e[0m"
# print out colorful if in verbose
if [ "$QUIET" -eq 0 ]; then
echo -e "\e[96mOK\e[0m"
else
echo -n "."
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"
Expand Down
18 changes: 15 additions & 3 deletions VortexEngine/tests/recordtests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ VALGRIND="valgrind --quiet --leak-check=full --show-leak-kinds=all"
VORTEX="../vortex"

VALIDATE=0
QUIET=0
TODO=

declare -a REPOS
Expand All @@ -16,8 +17,11 @@ for folder in tests_*/; do
REPOS+=("$folder_name")
done

for arg in "$@"
do
for arg in "$@"; do
# -q for quiet
if [ "$arg" == "-q" ]; then
QUIET=1
fi
# -v for validate
if [ "$arg" == "-v" ]; then
VALIDATE=1
Expand Down Expand Up @@ -112,11 +116,19 @@ function record_tests() {
TESTCOUNT=0

for FILE in $FILES; do
./record_test.sh $FILE $VALIDATE $TESTCOUNT $NUMFILES &
./record_test.sh $FILE $VALIDATE $TESTCOUNT $NUMFILES $QUIET &
TESTCOUNT=$((TESTCOUNT + 1))
done

# Wait for all background jobs to finish
wait

if [ "$QUIET" -eq 1 ]; then
echo ". Complete"
fi
echo "All tests recorded successfully!"
#rm -rf tmp/$PROJECT
}

record_tests $TARGETREPO

0 comments on commit 458e10b

Please sign in to comment.