forked from sourcesimian/uICAL
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
51 lines (33 loc) · 1.11 KB
/
Copy pathMakefile
File metadata and controls
51 lines (33 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
CXX := c++
CXX_FLAGS := -Wall -Wextra -std=c++11 -g #-DUICAL_LOG_LEVEL=5
CXX_GCOV := -fprofile-arcs -ftest-coverage
BIN := build/bin
SRC := src
INCLUDE := src
.PHONY: coverage
test-cpp: $(BIN)/test
./$(BIN)/test
test-python:
python3 ./setup.py build
pytest ./test/python/
test-all: test-cpp test-python
$(BIN)/test: $(SRC)/*.cpp $(INCLUDE)/uICAL/*.h test/cpp/*.cpp
mkdir -p $(BIN)
$(CXX) $(CXX_FLAGS) -I$(INCLUDE)/ $(SRC)/*.cpp test/cpp/*.cpp -o $@
$(BIN)/cov: $(SRC)/*.cpp $(INCLUDE)/uICAL/*.h test/cpp/*.cpp
mkdir -p $(BIN)
$(CXX) $(CXX_FLAGS) $(CXX_GCOV) -I$(INCLUDE)/ $(SRC)/*.cpp test/cpp/*.cpp -o $@
coverage: $(BIN)/cov
./$(BIN)/cov
gcov -dump *.gcno *.gcda >/dev/null 2>/dev/null
rm -f *.gcno *.gcda
mkdir -p build/coverage/
rm -f build/coverage/*
mv *.gcov build/coverage/
ls build/coverage/*.gcov | grep -v -e ".cpp" -e ".h" | xargs rm
grep "####" build/coverage/src*.cpp.gcov | grep -v "\-:" | awk '{print $$1}' | sed -e 's|build/coverage/src#||' -e 's|\.gcov:||' | uniq -c
memory: $(BIN)/test
valgrind --leak-check=full -s ./$(BIN)/test
clean:
rm -rf ./$(BIN)/*
rm -rf ./build/*