From 0527dd3ddec3ad75ecb296ecdb55fbe4c2ad4418 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Thu, 5 Oct 2017 16:55:41 +0200 Subject: Use clang on travis-ci (#23) --- Makefile | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 441c2f1..2a99cf6 100644 --- a/Makefile +++ b/Makefile @@ -21,6 +21,13 @@ debug: ## compile a debug build coverage: ## compile snuffleugpaus, and run the testsuite with coverage cd src; phpize +ifeq ($(CC),clang) + cd src; CFLAGS="-fprofile-instr-generate -fcoverage-mapping" ./configure --enable-snuffleupagus + make -C src + LLVM_PROFILE_FILE="sp_%p_%m.profraw" TEST_PHP_ARGS='-q' REPORT_EXIT_STATUS=1 make -C src test + llvm-profdata-4.0 merge ./src/*.profraw -o ./src/sp.profdata + llvm-cov report -instr-profile=./src/sp.profdata ./src/modules/snuffleupagus.so +else cd src; ./configure --enable-snuffleupagus --enable-coverage make -C src rm -Rf src/COV.html @@ -28,6 +35,7 @@ coverage: ## compile snuffleugpaus, and run the testsuite with coverage lcov --base-directory ./src --directory ./src -c -o ./src/COV.info --rc lcov_branch_coverage=1 lcov --remove src/COV.info '/usr/*' --remove src/COV.info '*tweetnacl.c' -o src/COV.info --rc lcov_branch_coverage=1 genhtml -o src/COV.html ./src/COV.info --branch-coverage +endif bench: joomla ## run the benchmark -- cgit v1.3