-
Notifications
You must be signed in to change notification settings - Fork 58
Expand file tree
/
Copy pathMakefile
More file actions
43 lines (32 loc) · 2.08 KB
/
Makefile
File metadata and controls
43 lines (32 loc) · 2.08 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
all: pubnub_parse_ipv6_addr_unit_test pubnub_dns_codec_unit_test
OS := $(shell uname)
# Coverage doesn't seem to work on MacOS for some reason, but, since
# we can get it on Linux, we don't want to spend time figuring it out,
# simply don't do it on MacOS.
ifeq ($(OS),Darwin)
GCOVR=echo
COVERAGE_FLAGS=
else
GCOVR=gcovr
COVERAGE_FLAGS=-fprofile-arcs -ftest-coverage
endif
generate_report: all
#$(GCOVR) -r . --html --html-details -o coverage.html
$(GCOVR) -r . --xml -o coverage.xml
CFLAGS +=-g -D PUBNUB_CALLBACK_API -D PUBNUB_LOG_LEVEL=PUBNUB_LOG_LEVEL_NONE -I. -I.. -I../core -I ../core/test -I../lib/base64 -I../lib/md5 -I../lib/miniz -I../cgreen/include
LDFLAGS=-L../cgreen/build/src
CGREEN_RUNNER=../cgreen/build/tools/cgreen-runner
PARSE_IPV6_ADDR_SOURCE_FILES = ../core/pubnub_assert_std.c
pubnub_parse_ipv6_addr_unit_test: pubnub_parse_ipv6_addr.c pubnub_parse_ipv6_addr_unit_test.c
gcc -o pubnub_parse_ipv6_addr_unit_test.so -shared $(CFLAGS) $(LDFLAGS) -Wall $(COVERAGE_FLAGS) -fPIC $(PARSE_IPV6_ADDR_SOURCE_FILES) pubnub_parse_ipv6_addr.c pubnub_parse_ipv6_addr_unit_test.c -lcgreen -lm
# gcc -o pubnub_parse_ipv6_addr_unit_testo $(CFLAGS) -Wall $(COVERAGE_FLAGS) $(PARSE_IPV6_ADDR_SOURCE_FILES) ../lib/pubnub_parse_ipv6_addr.c pubnub_parse_ipv6_addr_unit_test.c -lcgreen -lm
$(CGREEN_RUNNER) ./pubnub_parse_ipv6_addr_unit_test.so
$(GCOVR) -r . --html --html-details -o coverage.html
DNS_CODEC_SOURCE_FILES = ../core/pubnub_assert_std.c
pubnub_dns_codec_unit_test: pubnub_dns_codec.c pubnub_dns_codec_unit_test.c
gcc -o pubnub_dns_codec_unit_test.so -shared $(CFLAGS) -D PUBNUB_USE_IPV6=1 -D PUBNUB_USE_SSL=1 $(LDFLAGS) -Wall $(COVERAGE_FLAGS) -fPIC $(DNS_CODEC_SOURCE_FILES) pubnub_dns_codec.c pubnub_dns_codec_unit_test.c -lcgreen -lm
# gcc -o pubnub_dns_codec_unit_testo $(CFLAGS) -Wall $(COVERAGE_FLAGS) $(DNS_CODEC_SOURCE_FILES) ../lib/pubnub_dns_codec.c pubnub_dns_codec_unit_test.c -lcgreen -lm
$(CGREEN_RUNNER) ./pubnub_dns_codec_unit_test.so
$(GCOVR) -r . --html --html-details -o coverage.html
clean:
-rm pubnub_parse_ipv6_addr_unit_test.so pubnub_dns_codec_unit_test.so *.gcda *.gcno *.html