Skip to content

Commit

Permalink
set exit code based on content of test result file
Browse files Browse the repository at this point in the history
  • Loading branch information
timhendriks93 committed Jan 20, 2024
1 parent 0973b71 commit 8ff5684
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions tests/test.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash

TESTSDIR=$(dirname "$0")
TESTFILE="$TESTSDIR/results.txt"

blender \
-noaudio \
Expand All @@ -11,8 +12,12 @@ blender \
--python $TESTSDIR/test.py \
> /dev/null 2>&1

blender_exit_code=$?
cat $TESTFILE

cat $TESTSDIR/results.txt
last_line=$(tail -n 1 "$TESTFILE")

exit $blender_exit_code
if [ "$last_line" == "OK" ]; then
exit 0
else
exit 1
fi

0 comments on commit 8ff5684

Please sign in to comment.