diff --git a/.travis.yml b/.travis.yml index 14a5e000dedd..945684102357 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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: @@ -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: @@ -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'; diff --git a/Makefile b/Makefile index fda714f95a74..f64459636e87 100644 --- a/Makefile +++ b/Makefile @@ -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 @@ -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 # --------------------------------------------------------------------