From d85a019a84a5778c992c79a22abde8c625ec47ec Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Wed, 21 Sep 2016 10:15:19 +0200 Subject: [PATCH] add cppcheck --- Makefile | 8 +++++++- cppcheck.suppressions | 3 +++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 cppcheck.suppressions diff --git a/Makefile b/Makefile index efe8378..4f315ee 100644 --- a/Makefile +++ b/Makefile @@ -43,6 +43,8 @@ PHP_VERSION_MAJOR = $(firstword $(subst ., ,$(PHP))) PHP_VERSIONS_JSON = $(srcdir)/php-versions$(PHP_VERSION_MAJOR).json PHP_VERSION ?= $(shell test -e $(PHP_VERSIONS_JSON) && cat $(PHP_VERSIONS_JSON) | $(makdir)/php-version.php $(PHP)) +CPPCHECK ?= -v -j $(JOBS) --std=c89 --enable=warning,portability,style --error-exitcode=42 --suppressions-list=$(makdir)/cppcheck.suppressions -I. + .SUFFIXES: .PHONY: all @@ -140,9 +142,13 @@ ext-rm: pecl-rm ext: pecl-check pecl $(makdir)/check-packagexml.php package.xml -.PHONY: php +.PHONY: test test: php REPORT_EXIT_STATUS=1 $(bindir)/php run-tests.php -q -p $(bindir)/php --set-timeout 300 --show-diff tests +.PHONY: cppcheck +cppcheck: + cppcheck $(CPPCHECK) $$(awk -F= '/^CPPFLAGS|^INCLUDES/{print $$2}'