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
Allow using 8/16/32/64 as values in int_size setting
[apps/agl-service-can-low-level.git]
/
tests
/
Makefile
diff --git
a/tests/Makefile
b/tests/Makefile
index
caed5ba
..
cee6bf6
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
-person.h: person.proto
- protoc -I. -I../generator -I/usr/include -operson.pb $<
- python ../generator/nanopb_generator.py person.pb
+ # Collect the data
+ mkdir build/coverage
+ lcov --base-directory . --directory build/ --gcov-tool gcov-4.6 -c -o build/coverage/nanopb.info
-run_unittests: decode_unittests encode_unittests
- ./decode_unittests
- ./encode_unittests
+ # Remove the test code from results
+ lcov -r build/coverage/nanopb.info '*tests*' -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