summaryrefslogtreecommitdiffhomepage
path: root/tests/Makefile
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2023-01-01 15:48:43 +0100
committerRoland Reichwein <mail@reichwein.it>2023-01-01 15:48:43 +0100
commit6c339d8aab380a191fe3fce7ca7dc7c09e252ebd (patch)
treeca5a1288fcbc5299b5bf5cc28d012a5bd6147549 /tests/Makefile
parentcbf1ba38794ab6a323441dcc3b0e5e942f7ab386 (diff)
Tests and coverage on gcc and clang
Diffstat (limited to 'tests/Makefile')
-rw-r--r--tests/Makefile14
1 files changed, 9 insertions, 5 deletions
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