Skip to content
Snippets Groups Projects
Commit 1fc8b75e authored by Vivek Dutta's avatar Vivek Dutta
Browse files

Added clang analysis using cppcheck

parent 8836ee16
No related branches found
No related tags found
No related merge requests found
This commit is part of merge request !26. Comments created here will be created in the context of that merge request.
......@@ -2,7 +2,7 @@
log()
{
echo "# $* ..."
echo "# $* #"
}
exec_cmd()
......@@ -33,9 +33,16 @@ generate_compilation_db()
run_cppcheck_validation()
{
if [ -f "compile_commands.json" ]; then
exec_cmd cppcheck --error-exitcode=1 --addon=threadsafety --addon=cert --inline-suppr ${CPPCHECK_OPTIONS} --project=compile_commands.json
exec_cmd cppcheck --error-exitcode=1 --addon=threadsafety --addon=cert -i ./test --inline-suppr ${CPPCHECK_OPTIONS} --project=compile_commands.json
else
exec_cmd cppcheck --error-exitcode=1 --addon=threadsafety --addon=cert --inline-suppr ${CPPCHECK_OPTIONS} ${SOURCE_FOLDER}
exec_cmd cppcheck --error-exitcode=1 --addon=threadsafety --addon=cert -i ./test --inline-suppr ${CPPCHECK_OPTIONS} ${SOURCE_FOLDER}
fi
}
run_cppcheck_clang_validation()
{
if [ -f "compile_commands.json" ]; then
exec_cmd cppcheck --error-exitcode=1 --clang -i ./test --inline-suppr ${CPPCHECK_OPTIONS} --project=compile_commands.json
fi
}
......@@ -53,6 +60,7 @@ main()
# Install pre-req if present/defined
if [ -f "./gitlab-ci/install-dependencies.sh" ]; then
log "Installing prerequisites for compilation"
exec_cmd ./gitlab-ci/install-dependencies.sh
fi
......@@ -60,11 +68,13 @@ main()
generate_compilation_db
# TODO: Run gcc fanalyzer analysis
# TODO: Run clag analysis
# Run cppcheck with compilation-db
run_cppcheck_validation
# Run clag analysis
run_cppcheck_clang_validation
# Run infer analysis
run_infer_analysis
}
......
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