Skip to content

Commit

Permalink
Updated testing so that failures of the should fail tests will compile
Browse files Browse the repository at this point in the history
but will return 1 in testing if they actually built
  • Loading branch information
beached committed Nov 27, 2017
1 parent 524517b commit 748a1fd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
6 changes: 4 additions & 2 deletions compile_fail.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ shift 1
export BUILD_COMMAND=$@
echo "Build command: ${BUILD_COMMAND}"
eval ${BUILD_COMMAND} #>/dev/null 2>/dev/null

if [ $? -eq 0 ]; then
exit 1;
echo -ne "#!/bin/bash\nexit 1;" > ${TEST_BIN_NAME}
else
echo -ne "#!/bin/bash\nexit 0;" > ${TEST_BIN_NAME}
fi
echo "#!/bin/bash" > ${TEST_BIN_NAME}
chmod u+x ${TEST_BIN_NAME}
exit 0;

9 changes: 6 additions & 3 deletions test_fail.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
#!/bin/bash

if [[ -e $@ ]]; then
exit 1;
echo $1
eval $1

if [ $? -eq 0 ]; then
exit 0;
fi
exit 0;
exit 1;

0 comments on commit 748a1fd

Please sign in to comment.