ADD file via upload

This commit is contained in:
xinkong 2025-06-02 11:14:39 +08:00
parent d98b495641
commit 2947dae605
1 changed files with 25 additions and 0 deletions

25
Makefile Normal file
View File

@ -0,0 +1,25 @@
CC = clang
CXX = clang++
CFLAGS = -fprofile-instr-generate -fcoverage-mapping -fcoverage-mcdc
CXXFLAGS = -std=c++17 -isystem /usr/include/gtest -pthread -fprofile-instr-generate -fcoverage-mapping
LDFLAGS = -pthread
LIBS = /usr/local/lib/libgtest.a /usr/local/lib/libgtest_main.a
all: html
clean:
rm -rf test default.profraw math_functions.o test.profdata output
html: test
./test
llvm-profdata merge -sparse default.profraw -o test.profdata
llvm-cov report ./test -instr-profile=test.profdata -show-mcdc-summary
llvm-cov show ./test -instr-profile=test.profdata -show-mcdc-summary -format=html -output-dir=./output
test: math_functions.o test.cpp
$(CXX) $(CXXFLAGS) $^ $(LDFLAGS) $(LIBS) -o $@
math_functions.o: math_functions.c math_functions.h
$(CC) $(CFLAGS) -c $< -o $@
.PHONY: all clean html