Skip to content
Snippets Groups Projects
Commit 428f0d3b authored by Grigoris Pavlakis's avatar Grigoris Pavlakis Committed by kongr45gpen
Browse files

Add machine-readable report capability

parent 814d8d7b
No related branches found
No related tags found
No related merge requests found
......@@ -7,8 +7,6 @@
# $ ci/cppcheck-misra.sh
#
echo -e "\u001b[34;1mStarting cppcheck...\u001b[0m"
echo -e "\u001b[34;1mRunning cppcheck with MISRA C(2012) rule compliance tests...\u001b[0m"
# grab the MISRA addon and the cppcheck addon interface from github
......@@ -16,13 +14,18 @@ curl https://raw.githubusercontent.com/danmar/cppcheck/f4b5b156d720c712f6ce99f6e
curl https://raw.githubusercontent.com/danmar/cppcheck/f4b5b156d720c712f6ce99f6e01d8c1b3f800d52/addons/cppcheckdata.py > cppcheckdata.py
# generate dump files (XML representations of AST etc.) for all headers, source files etc.
for file in $(find inc/ src/ -type f)
do
cppcheck --dump $file
done
#for file in $(find inc/ src/ -type f)
#do
# cppcheck --dump $file
#done
# run the MISRA checks against the dumps
# run the MISRA checks against the dumps and send the results to a file
for file in $(find inc/ src/ -type f -name "*.dump")
do
python misra.py $file
python misra.py $file >> ci/report.msr 2>&1
done
# clean up the report file from any useless info
sed -i -r 's/(.*Script.*)|(.*Checking.*)|(.*MISRA.*)//gm' ci/report.msr
sed -i -r '/(^$)/d' ci/report.msr
sed -i -r 's/(\s\(.*\)\s)//gm' ci/report.msr
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment