diff --git a/tests/misra/test_misra.sh b/tests/misra/test_misra.sh index 778271ad..fa1a051d 100755 --- a/tests/misra/test_misra.sh +++ b/tests/misra/test_misra.sh @@ -3,6 +3,7 @@ PANDA_DIR=../.. mkdir /tmp/misra || true +ERROR_CODE=0 # generate coverage matrix #python tests/misra/cppcheck/addons/misra.py -generate-table > tests/misra/coverage_table @@ -45,12 +46,12 @@ python /usr/share/cppcheck/addons/misra.py $PANDA_DIR/board/pedal/main.c.dump 2> cppcheck_pedal_output=$( cat /tmp/misra/cppcheck_pedal_output.txt | grep -v ": information: " ) || true misra_pedal_output=$( cat /tmp/misra/misra_pedal_output.txt | grep -v ": information: " ) || true -if [[ -n "$misra_output" ]] || [[ -n "$cppcheck_output" ]] +if [[ -n "$misra_f4_output" ]] || [[ -n "$cppcheck_f4_output" ]] then echo "Failed! found Misra violations in panda F4 code:" echo "$misra_f4_output" echo "$cppcheck_f4_output" - exit 1 + ERROR_CODE=1 fi if [[ -n "$misra_h7_output" ]] || [[ -n "$cppcheck_h7_output" ]] @@ -58,7 +59,7 @@ then echo "Failed! found Misra violations in panda H7 code:" echo "$misra_h7_output" echo "$cppcheck_h7_output" - exit 1 + ERROR_CODE=1 fi if [[ -n "$misra_pedal_output" ]] || [[ -n "$cppcheck_pedal_output" ]] @@ -66,6 +67,11 @@ then echo "Failed! found Misra violations in pedal code:" echo "$misra_pedal_output" echo "$cppcheck_pedal_output" + ERROR_CODE=1 +fi + +if [[ $ERROR_CODE > 0 ]] +then exit 1 fi