added cppcheck test

to Makefile and transitively to .travis.yml
This commit is contained in:
Yann Collet
2018-09-17 13:47:54 -07:00
parent b39d9be348
commit 79b52d94ba
2 changed files with 8 additions and 1 deletions

View File

@@ -7,3 +7,4 @@ before_install:
- sudo apt-get install -qq clang
- sudo apt-get install -qq g++-multilib
- sudo apt-get install -qq gcc-multilib
- sudo apt-get install -qq cppcheck

View File

@@ -190,10 +190,16 @@ usan: clean
@echo ---- check undefined behavior - sanitize ----
$(MAKE) clean test CC=$(CC) MOREFLAGS="-g -fsanitize=undefined -fno-sanitize-recover=all"
.PHONY: staticAnalyze
staticAnalyze: clean
@echo ---- static analyzer - scan-build ----
CFLAGS="-g -Werror" scan-build --status-bugs -v $(MAKE) all
.PHONY: cppcheck
cppcheck:
@echo ---- static analyzer - cppcheck ----
cppcheck . --force --enable=warning,portability,performance,style --error-exitcode=1 > /dev/null
namespaceTest:
$(CC) -c xxhash.c
$(CC) -DXXH_NAMESPACE=TEST_ -c xxhash.c -o xxhash2.o
@@ -213,7 +219,7 @@ preview-man: clean-man man
test: all namespaceTest check test-xxhsum-c c90test
test-all: test test32 armtest clangtest cxxtest usan listL120 trailingWhitespace staticAnalyze
test-all: test test32 armtest clangtest cxxtest usan listL120 trailingWhitespace staticAnalyze cppcheck
.PHONY: listL120
listL120: # extract lines >= 120 characters in *.{c,h}, by Takayuki Matsuoka (note : $$, for Makefile compatibility)