Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
E
ECSS Services
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AcubeSat-OBC
ECSS Services
Commits
428f0d3b
Commit
428f0d3b
authored
6 years ago
by
Grigoris Pavlakis
Committed by
kongr45gpen
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add machine-readable report capability
parent
814d8d7b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ci/cppcheck-misra.sh
+11
-8
11 additions, 8 deletions
ci/cppcheck-misra.sh
with
11 additions
and
8 deletions
ci/cppcheck-misra.sh
+
11
−
8
View file @
428f0d3b
...
...
@@ -7,8 +7,6 @@
# $ ci/cppcheck-misra.sh
#
echo
-e
"
\u
001b[34;1mStarting cppcheck...
\u
001b[0m"
echo
-e
"
\u
001b[34;1mRunning cppcheck with MISRA C(2012) rule compliance tests...
\u
001b[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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment