mirror of
https://github.com/infiniteCable2/panda.git
synced 2026-02-18 09:13:52 +08:00
fix MISRA test bug and coverage (#743)
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user