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

Added clang analysis using cppcheck

parent 8836ee16
Branches
Tags
1 merge request!26Added infer and minor cleanup
...@@ -245,7 +245,7 @@ RUN cd /opt/dev && \ ...@@ -245,7 +245,7 @@ RUN cd /opt/dev && \
ENV PATH /infer/bin:${PATH} ENV PATH /infer/bin:${PATH}
# Install python ubus module and valgrind-ci # Install python ubus module and valgrind-ci
RUN pip3 install ubus ValgrindCI RUN pip3 install ubus ValgrindCI codechecker
WORKDIR /builds/iopsys/ WORKDIR /builds/iopsys/
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
log() log()
{ {
echo "# $* ..." echo "# $* #"
} }
exec_cmd() exec_cmd()
...@@ -33,9 +33,16 @@ generate_compilation_db() ...@@ -33,9 +33,16 @@ generate_compilation_db()
run_cppcheck_validation() run_cppcheck_validation()
{ {
if [ -f "compile_commands.json" ]; then 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 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 fi
} }
...@@ -53,6 +60,7 @@ main() ...@@ -53,6 +60,7 @@ main()
# Install pre-req if present/defined # Install pre-req if present/defined
if [ -f "./gitlab-ci/install-dependencies.sh" ]; then if [ -f "./gitlab-ci/install-dependencies.sh" ]; then
log "Installing prerequisites for compilation"
exec_cmd ./gitlab-ci/install-dependencies.sh exec_cmd ./gitlab-ci/install-dependencies.sh
fi fi
...@@ -60,11 +68,13 @@ main() ...@@ -60,11 +68,13 @@ main()
generate_compilation_db generate_compilation_db
# TODO: Run gcc fanalyzer analysis # TODO: Run gcc fanalyzer analysis
# TODO: Run clag analysis
# Run cppcheck with compilation-db # Run cppcheck with compilation-db
run_cppcheck_validation run_cppcheck_validation
# Run clag analysis
run_cppcheck_clang_validation
# Run infer analysis # Run infer analysis
run_infer_analysis run_infer_analysis
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment