Skip to content

Commit

Permalink
travis-ci add cppcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
dagar committed Jun 2, 2017
1 parent 560bfd2 commit 2e0ed3b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
11 changes: 9 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ matrix:
services:
- docker
env: BUILD_TARGET=scan-build
- os: linux
sudo: required
services:
- docker
env: BUILD_TARGET=cppcheck PX4_DOCKER_REPO=px4io/px4-dev-base:ubuntu17.04
- os: linux
sudo: required
services:
Expand Down Expand Up @@ -77,8 +82,6 @@ script:
./Tools/docker_run.sh 'make px4_metadata';
elif [[ "${BUILD_TARGET}" = "clang-tidy" ]]; then
./Tools/docker_run.sh 'make clang-tidy-quiet';
elif [[ "${BUILD_TARGET}" = "scan-build" ]]; then
./Tools/docker_run.sh 'make scan-build';
fi

after_success:
Expand All @@ -90,6 +93,10 @@ after_success:
- if [[ "${BUILD_TARGET}" = "scan-build" && "${TRAVIS_PULL_REQUEST}" = "false" && "${TRAVIS_BRANCH}" = "master" ]]; then
./Tools/docker_run.sh 'make s3put_scan-build AWS_S3_BUCKET="px4-travis/scan-build"';
fi
# s3 upload cppcheck output for master branch
- if [[ "${BUILD_TARGET}" = "cppcheck" && "${TRAVIS_PULL_REQUEST}" = "false" && "${TRAVIS_BRANCH}" = "master" ]]; then
./Tools/docker_run.sh 'make s3put_cppcheck AWS_S3_BUCKET="px4-travis/cppcheck"';
fi
# coveralls code coverage report
- if [[ "${BUILD_TARGET}" = "tests_coverage" && "${TRAVIS_PULL_REQUEST}" = "false" ]]; then
./Tools/docker_run.sh 'cpp-coveralls -l coverage.info';
Expand Down
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,9 @@ s3put_px4_metadata: px4_metadata
s3put_scan-build: scan-build
$(SRC_DIR)/Tools/s3put.sh `find build_scan-build -mindepth 1 -maxdepth 1 -type d`/

s3put_cppcheck: cppcheck
$(SRC_DIR)/Tools/s3put.sh build_cppcheck-htmlreport/

# Astyle
# --------------------------------------------------------------------
.PHONY: check_format format
Expand Down Expand Up @@ -353,9 +356,9 @@ clang-tidy-fix: posix_sitl_default-clang
clang-tidy-quiet: posix_sitl_default-clang
@cd build_posix_sitl_default-clang && $(SRC_DIR)/Tools/run-clang-tidy.py -header-filter=".*\.hpp" -j$(j) -p .

cppcheck: posix_sitl_default-clang
@cppcheck --enable=all --project=build_posix_sitl_default-clang/compile_commands.json --xml-version=2 2> cppcheck-result.xml
@cppcheck-htmlreport --file=cppcheck-result.xml --report-dir=build_cppcheck-htmlreport --source-dir=$(SRC_DIR)/src/
cppcheck: posix_sitl_default
@cppcheck --enable=all --std=c++11 --std=c99 --std=posix --project=build_posix_sitl_default/compile_commands.json --xml-version=2 2> cppcheck-result.xml
@cppcheck-htmlreport --source-encoding=ascii --file=cppcheck-result.xml --report-dir=build_cppcheck-htmlreport --source-dir=$(SRC_DIR)/src/

# Cleanup
# --------------------------------------------------------------------
Expand Down

0 comments on commit 2e0ed3b

Please sign in to comment.