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
Add a fuzz testing stub for ability to use external generators also
[apps/agl-service-can-low-level.git]
/
tests
/
Makefile
diff --git
a/tests/Makefile
b/tests/Makefile
index
35c6f97
..
cee6bf6
100644
(file)
--- a/
tests/Makefile
+++ b/
tests/Makefile
@@
-1,17
+1,21
@@
-CFLAGS=-ansi -Wall -Werror -I .. -g -O0
-DEPS=../pb_decode.c ../pb_decode.h ../pb.h person.h
-TESTS=test_decode1 decode_unittests
-
-all: $(TESTS)
+all:
+ scons
clean:
clean:
- rm -f test_decode1
+ scons -c
+
+coverage:
+ rm -rf build coverage
+
+ # LCOV does not like the newer gcov format
+ scons CC=gcc-4.6 CXX=gcc-4.6
-%: %.c $(DEPS)
- $(CC) $(CFLAGS) -o $@ $< ../pb_decode.c
+ # 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_unittes
ts
- ./decode_unittests
+
# Remove the test code from resul
ts
+ 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