-
-
Notifications
You must be signed in to change notification settings - Fork 53
/
Copy pathMakefile.cpputest
44 lines (35 loc) · 1.65 KB
/
Makefile.cpputest
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
.PHONY: unittest check clean_unittest
CPPUTEST_HOME ?= /usr/local
CXXFLAGS += -I$(CPPUTEST_HOME)/include -DCPPUTEST_MEM_LEAK_DETECTION_DISABLED
OBJ_UNIT_TEST = \
unittest/helpers/fake_wire.o \
unittest/helpers/fake_connection.o \
unittest/helpers/fake_endpoint.o \
unittest/helpers/tiny_base_helper.o \
unittest/helpers/tiny_hdlc_helper.o \
unittest/helpers/tiny_light_helper.o \
unittest/helpers/tiny_fd_helper.o \
unittest/main.o \
unittest/hal_tests.o \
unittest/packet_tests.o \
unittest/hdlc_tests.o \
unittest/light_tests.o \
unittest/fd_tests.o \
unittest/fd_multidrop_tests.o \
unittest: $(OBJ_UNIT_TEST) library
$(CXX) $(CPPFLAGS) -o $(BLD)/unit_test $(OBJ_UNIT_TEST) -L$(BLD) -L$(CPPUTEST_HOME)/lib -lm -pthread -ltinyprotocol -lCppUTest -lCppUTestExt
check: unittest
$(BLD)/unit_test
clean: clean_unittest
clean_unittest:
rm -rf $(OBJ_UNIT_TEST) $(OBJ_UNIT_TEST:.o=.gcno) $(OBJ_UNIT_TEST:.o=.gcda) $(OBJ_UNIT_TEST:.o=.*.gcov)
coverage:
$(MAKE) ARCH=linux EXTRA_CPPFLAGS="--coverage" check
COVERALLS_REPO_TOKEN=4Ia7t9YDo22zQcFEnMYLh1tiWCRlBJlhk coveralls -b . \
--exclude docs --exclude extra --exclude unittest --exclude bld --exclude tools --exclude examples \
--gcov-options '\-lp' --dryrun
lcov --base-directory . --directory . -c -o lcov.info
lcov --remove lcov.info "*unittest*" -o lcov.info # remove output for external libraries
lcov --remove lcov.info "/usr/include*" -o lcov.info # remove output for external libraries
# -rm -rf test_coverage
# genhtml -o test_coverage -t "tinyproto test coverage" --num-spaces 4 lcov.info