From 6c339d8aab380a191fe3fce7ca7dc7c09e252ebd Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Sun, 1 Jan 2023 15:48:43 +0100 Subject: Tests and coverage on gcc and clang --- tests/Makefile | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'tests/Makefile') diff --git a/tests/Makefile b/tests/Makefile index e36198b..94789f9 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -1,16 +1,16 @@ CXXFLAGS=-g -O0 +include ../common.mk + ifeq ($(CXX),clang++-14) CXXFLAGS+=-fprofile-instr-generate -fcoverage-mapping +LDFLAGS+=-fprofile-instr-generate -fcoverage-mapping else # GCC CXXFLAGS+=--coverage +LDFLAGS+=--coverage endif -include ../common.mk - -LDFLAGS+=-fprofile-instr-generate -fcoverage-mapping - UNITS=storage.cpp config.cpp file.cpp compiledsql.cpp qrcode.cpp whiteboard.cpp UNITTESTS=test-config.cpp \ @@ -29,6 +29,10 @@ ifeq ($(CXX),clang++-14) LLVM_PROFILE_FILE="unittests.profraw" ./unittests llvm-profdata-14 merge -sparse unittests.profraw -o unittests.profdata llvm-cov-14 report --ignore-filename-regex='google' --ignore-filename-regex='test-' --show-region-summary=0 -instr-profile unittests.profdata unittests +else + ./unittests + #gcov-12 storage.o + gcovr -r .. endif coverage: @@ -65,4 +69,4 @@ libgmock.a: ar -rv libgmock.a gmock-all.o gtest-all.o gmock_main.o clean: - -rm -f *.o *.a unittests *.gcno *.profraw *.profdata + -rm -f *.o *.a unittests *.gcda *.gcno *.profraw *.profdata *.gcov -- cgit v1.2.3