Skip to content
Snippets Groups Projects
Commit db3beb8e authored by Jens Georg's avatar Jens Georg
Browse files

cppcheck: Try to use project file

parent 5d02dc02
No related branches found
No related tags found
No related merge requests found
......@@ -258,6 +258,11 @@ EOF
"""
archiveArtifacts artifacts: "build-${JOB_NAME}-${label}-${buildType}.tgz", onlyIfSuccessful: false
}
// Copy the include database from Debug build for running cppcheck afterwards
if (buildType == "Debug") {
stash includes: "/scratch/*/compile_commands.json" name: "compile_commands.json"
}
}
/**********************************************************************************************************************/
......@@ -446,12 +451,14 @@ def doPublishBuildTestDeploy(ArrayList<String> builds) {
// Note: this part runs only once per project, not for each branch!
unstash name: "compile_commands.json"
// Run cppcheck and publish the result. Since this is a static analysis, we don't have to run it for each label
if(!env.DISABLE_CPPCHECK || env.DISABLE_CPPCHECK == '') {
sh """
pwd
mkdir -p build
cppcheck --enable=all --xml --xml-version=2 -ibuild . 2> ./build/cppcheck.xml
cppcheck --enable=all --xml --xml-version=2 --project=compile_commands.json 2> ./build/cppcheck.xml
"""
publishCppcheck pattern: 'build/cppcheck.xml'
}
......
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