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
fec0340c
Commit
fec0340c
authored
6 years ago
by
Grigoris Pavlakis
Committed by
kongr45gpen
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Split MISRA checking into its own job to avoid clutter
parent
4a8cc45f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitlab-ci.yml
+12
-0
12 additions, 0 deletions
.gitlab-ci.yml
ci/cppcheck-misra.sh
+28
-0
28 additions, 0 deletions
ci/cppcheck-misra.sh
ci/cppcheck.sh
+1
-19
1 addition, 19 deletions
ci/cppcheck.sh
with
41 additions
and
19 deletions
.gitlab-ci.yml
+
12
−
0
View file @
fec0340c
...
@@ -46,6 +46,18 @@ cppcheck:
...
@@ -46,6 +46,18 @@ cppcheck:
tags
:
tags
:
-
helit
-
helit
cppcheck-misra
:
stage
:
build
before_script
:
# install cppcheck from the sid repos in order to get the latest version
-
echo deb http://deb.debian.org/debian sid main > /etc/apt/sources.list
-
apt-get update -qq && apt-get -t sid install -y -qq cppcheck
-
cppcheck --version
script
:
-
ci/cppcheck-misra.sh
tags
:
-
helit
.vera
:
.vera
:
stage
:
build
stage
:
build
before_script
:
before_script
:
...
...
This diff is collapsed.
Click to expand it.
ci/cppcheck-misra.sh
0 → 100644
+
28
−
0
View file @
fec0340c
#!/usr/bin/env bash
#
# Static code analysis for MISRA C-2012 compliance using cppcheck
#
# Usage:
# $ ci/cppcheck-misra.sh
#
echo
-e
"
\0
33[0;34mStarting cppcheck...
\0
33[0m"
echo
-e
"
\0
33[0;34mRunning cppcheck with MISRA C(2012) rule compliance tests...
\0
33[0m"
# grab the MISRA addon and the cppcheck addon interface from github
curl https://raw.githubusercontent.com/danmar/cppcheck/f4b5b156d720c712f6ce99f6e01d8c1b3f800d52/addons/misra.py
>
misra.py
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
# run the MISRA checks against the dumps
for
file
in
$(
find inc/ src/
-type
f
-name
"*.dump"
)
do
python misra.py
$file
done
\ No newline at end of file
This diff is collapsed.
Click to expand it.
ci/cppcheck.sh
+
1
−
19
View file @
fec0340c
...
@@ -13,22 +13,4 @@ echo -e "\033[0;34mRunning cppcheck with default checklist...\033[0m"
...
@@ -13,22 +13,4 @@ echo -e "\033[0;34mRunning cppcheck with default checklist...\033[0m"
cd
"
$(
dirname
"
$0
"
)
/.."
cd
"
$(
dirname
"
$0
"
)
/.."
cppcheck
--enable
=
all
--inline-suppr
--suppress
=
unusedFunction
--suppress
=
missingIncludeSystem
\
cppcheck
--enable
=
all
--inline-suppr
--suppress
=
unusedFunction
--suppress
=
missingIncludeSystem
\
--suppress
=
noExplicitConstructor
--error-exitcode
=
1
-I
inc src
test
--suppress
=
noExplicitConstructor
--error-exitcode
=
1
-I
inc src
test
\ No newline at end of file
echo
-e
"
\0
33[33mRunning cppcheck with MISRA rule compliance tests...
\0
33[0m"
# grab the MISRA addon and the cppcheck addon interface from github
curl https://raw.githubusercontent.com/danmar/cppcheck/f4b5b156d720c712f6ce99f6e01d8c1b3f800d52/addons/misra.py
>
misra.py
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
# run the MISRA checks against the dumps
for
file
in
$(
find inc/ src/
-type
f
-name
"*.dump"
)
do
python misra.py
$file
done
\ No newline at end of file
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