Add cppcheck static analysis to travis build (#939)

This runs cppcheck static analysis as part of the travis-ci checks. The
current Travis version of cppcheck doesn't appear to support all the checks
we want, but for now should be sufficient. Identified issues that would cause
these checks to fail have been resolved in previous commits.

Thanks to @turol for doing the work to set this up.
This commit is contained in:
turol 2017-09-03 23:29:27 +03:00 committed by Simon Howard
parent a89a0e655d
commit 63141cfc0d
2 changed files with 16 additions and 1 deletions

10
.travis.sh Executable file
View file

@ -0,0 +1,10 @@
#!/bin/sh
set -e
if [ "$ANALYZE" = "true" ] ; then
cppcheck --error-exitcode=1 -j2 -UTESTING -Iopl -Isrc -Isrc/setup opl pcsound src textscreen > /dev/null
else
./autogen.sh
make
make install DESTDIR=/tmp/whatever
make dist
fi

View file

@ -7,16 +7,21 @@ compiler: gcc
sudo: required
dist: trusty
env:
- ANALYZE=false
- ANALYZE=true
addons:
apt:
packages:
- cppcheck
- libsdl2-dev
- libsdl2-mixer-dev
- libsdl2-net-dev
- libsdl2-image-dev
- libsamplerate0-dev
script: ./autogen.sh && make && make install DESTDIR=/tmp/whatever && make dist
script: ./.travis.sh
branches:
only: