File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ CXX := clang++
2+ COVFLAGS := -fprofile-instr-generate -fcoverage-mapping
3+ CXXFLAGS := -std=c++23 -Wall -Wextra $(COVFLAGS ) -O0 -g
4+ AR := llvm-ar
5+ ARFLAGS := rc
6+ LDFLAGS := $(COVFLAGS )
7+
8+ all : coverage
9+
10+ solver.o : solver.cpp
11+ $(CXX ) $(CXXFLAGS ) -c $< -o $@
12+
13+ libsolver.a : solver.o
14+ $(AR ) $(ARFLAGS ) $@ $<
15+
16+ test : test.cpp libsolver.a
17+ $(CXX ) $(CXXFLAGS ) $^ -lgtest -o $@
18+
19+ run : test
20+ ./test
21+
22+ coverage : run
23+ llvm-profdata merge -sparse -o default.profdata default.profraw
24+ llvm-cov report libsolver.a -instr-profile=default.profdata
25+
26+ # llvm-cov show libsolver.a -instr-profile=default.profdata -show-line-counts-or-regions -output-dir=coverage-report -format=html
27+ # llvm-cov export libsolver.a -instr-profile=default.profdata > coverage.json
28+
29+ clean :
30+ rm -v * .o * .a test default.profdata default.profraw
31+
32+ .PHONY : all clean coverage run
You can’t perform that action at this time.
0 commit comments