Code Review
/
apps
/
agl-service-can-low-level.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Update changelog for 0.2.8
[apps/agl-service-can-low-level.git]
/
tests
/
Makefile
diff --git
a/tests/Makefile
b/tests/Makefile
index
4993297
..
3c4e0b0
100644
(file)
--- a/
tests/Makefile
+++ b/
tests/Makefile
@@
-1,22
+1,21
@@
-CFLAGS=-ansi -Wall -Werror -I .. -g -O0
-DEPS=../pb_decode.c ../pb_decode.h ../pb_encode.c ../pb_encode.h ../pb.h person.h unittests.h
-TESTS=test_decode1 test_encode1 decode_unittests encode_unittests
-
-all: $(TESTS) run_unittests
+all:
+ scons
clean:
clean:
- rm -f $(TESTS)
+ scons -c
+
+coverage:
+ rm -rf build coverage
-%: %.c $(DEPS)
- $(CC) $(CFLAGS) -o $@ $< ../pb_decode.c ../pb_encode.c
+ # LCOV does not like the newer gcov format
+ scons CC=gcc-4.6 CXX=gcc-4.6
-%.h: %.proto
- protoc -I. -I../generator -I/usr/include -operson.pb $<
- python ../generator/nanopb_generator.py person.pb
+ # We are only interested in pb_encode.o and pb_decode.o
+ find build -name '*.gcda' -and \! \( -name '*pb_encode*' -or -name '*pb_decode*' \) -exec rm '{}' \;
-run_unittests: decode_unittests encode_unittests
- ./decode_unittests
- ./encode_unittests
+ # Collect the data
+ mkdir build/coverage
+ lcov --base-directory . --directory build/ --gcov-tool gcov-4.6 -c -o build/coverage/nanopb.info
-run_fuzztest: test_decode1
- bash -c 'I=1; while cat /dev/urandom | ./test_decode1 > /dev/null; do I=$$(($$I+1)); echo -en "\r$$I"; done'
\ No newline at end of file
+ # Generate HTML
+ genhtml -o build/coverage build/coverage/nanopb.info