Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
mantidproject
mantid
Commits
59660e77
Commit
59660e77
authored
Aug 05, 2021
by
Peterson, Peter
Browse files
Get cppcheck changes from master
parent
2148d793
Changes
1
Hide whitespace changes
Inline
Side-by-side
buildconfig/Jenkins/cppcheck.sh
View file @
59660e77
#!/bin/bash -ex
SCRIPT_DIR
=
$(
dirname
"
$0
"
)
# If errors slip through to master this can be used to set a non-zero
# allowed count while those errors are dealt with. This avoids breaking all
# builds for all developers
ALLOWED_ERRORS_COUNT
=
288
if
[[
${
JOB_NAME
}
==
*
pull_requests
*
]]
;
then
# This relies on the fact pull requests use pull/$PR-NAME
...
...
@@ -32,3 +36,17 @@ cmake ${CMAKE_GENERATOR} -DCMAKE_BUILD_TYPE=Debug -DCPPCHECK_GENERATE_XML=TRUE -
# run cppcheck
cmake
--build
.
--target
cppcheck
# Generate HTML report
cppcheck-htmlreport
--file
=
cppcheck.xml
--title
=
Embedded
--report-dir
=
cppcheck-report
# Mark build as passed or failed
errors_count
=
$(
grep
-c
'</error>'
$1
)
if
[
$errors_count
-gt
${
ALLOWED_ERRORS_COUNT
}
]
;
then
echo
"CppCheck found
${
ALLOWED_ERRORS_COUNT
}
errors."
echo
"See CppCheck link on the job page for more detail."
exit
1
else
echo
"CppCheck found no errors"
exit
0
fi
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment