From 15606861702134134703f1fa76e25def4249b5a4 Mon Sep 17 00:00:00 2001 From: Anton Lindqvist Date: Tue, 18 Jul 2017 21:04:37 +0200 Subject: [PATCH] Run cppcheck(1) on Travis --- .travis.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index ff7f87a5..9a8471ec 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,10 +16,16 @@ matrix: - os: osx compiler: clang env: BUILD_TYPE=default CFLAGS=-fsanitize=address + - os: linux + env: BUILD_TYPE=cppcheck - os: osx - compiler: clang env: BUILD_TYPE=mandoc install: + - | + if [ $BUILD_TYPE = cppcheck ]; then + sudo apt-get -qq update + sudo apt-get install -y cppcheck + fi - | if [ $BUILD_TYPE = mandoc ]; then brew install mandoc @@ -32,6 +38,10 @@ script: make || exit 1 make distcheck || (find . -name test-suite.log | xargs -t cat; exit 1) fi + - | + if [ $BUILD_TYPE = cppcheck ]; then + git ls-files | grep '\.c$' | cppcheck --quiet --error-exitcode=1 --file-list=- + fi - | if [ $BUILD_TYPE = mandoc ]; then mandoc -Tlint pick.1