Skip to content

Commit

Permalink
fix and improve test
Browse files Browse the repository at this point in the history
  • Loading branch information
andystanton committed Nov 5, 2021
1 parent 289751c commit de9b148
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions test/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,17 @@ make dockerbuild

echo "Running tests..."

makefile_output=$(make docker 2>dev/null)
expected_output="Hello world"
makefile_output=$(make docker 2>/dev/null)

echo "Test results..."

exit_code=1
if [ $? = 0 ] && echo "$makefile_output" | egrep -q '^Hello world$'; then
printf "[\x1b[32m✔\x1b[0m] Test: Hello world\n"
if [ $? = 0 ] && echo "$makefile_output" | egrep -q '^'"${expected_output}"'$'; then
printf "[\x1b[32m✔\x1b[0m] Test: ${makefile_output}\n"
exit_code=0
else
printf "[\x1b[31m✘\x1b[0m] Test: Hello world\n"
printf "[\x1b[31m✘\x1b[0m] Test: Expected: ${expected_output}, Actual: ${makefile_output}\n"
fi

echo "Cleaning up Docker image"
Expand Down

0 comments on commit de9b148

Please sign in to comment.