|
CXX= clang++
|
|
CXXFLAGS= --std=c++20 -O0 -g -pthread -DGP_TESTS -DFUZZ_STRENGTH=100 -DNO_BENCH=1 -pedantic \
|
|
-fprofile-instr-generate -fcoverage-mapping -Wno-unknown-attributes -fno-omit-frame-pointer \
|
|
-DCATCH_EXCEPTIONS=1
|
|
|
|
# -fsanitize=address -fsanitize-blacklist=blacklist.txt
|
|
|
|
EVERY_USEFUL_FILE= $(shell find include/ -name "*.hpp" -type "f")
|
|
EVERY_TEST_FILE= $(shell find tests/ -name "*.cpp" -type "f")
|
|
TEST_OBJECTS := $(EVERY_TEST_FILE:%.cpp=bin/obj/%.test.o)
|
|
all: tests
|
|
|
|
bin/obj/%.test.o: %.cpp $(EVERY_USEFUL_FILE)
|
|
@mkdir -p $(@D)
|
|
$(CXX) $(CXXFLAGS) -DUSE_CATCH -Itests -Iinclude -o $@ -c $<
|
|
|
|
docs: $(EVERY_USEFUL_FILE)
|
|
doxygen doxy.config
|
|
|
|
tests: bin/tests
|
|
LLVM_PROFILE_FILE="./bin/tests.profraw" ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer ./bin/tests
|
|
@llvm-profdata merge -sparse ./bin/tests.profraw -o ./bin/tests.profdata
|
|
@llvm-cov report ./bin/tests -instr-profile=./bin/tests.profdata $(EVERY_USEFUL_FILE)
|
|
@llvm-cov report ./bin/tests -instr-profile=./bin/tests.profdata $(EVERY_USEFUL_FILE) | tail -n 1 | tr -s " " | sed -e 's/ /,/g' -- | awk -F "," '{print $$9}' | sed -e 's/^/Untested lines: /g'
|
|
|
|
bin/tests: tests.cpp $(TEST_OBJECTS) $(EVERY_USEFUL_FILE) ./tests/test_scaffold.h
|
|
@mkdir -p $(@D)
|
|
$(CXX) $(CXXFLAGS) -Itests -Iinclude tests.cpp $(TEST_OBJECTS) -o $@
|
|
|
|
clean: ./bin
|
|
@rm -rf $<
|