summaryrefslogtreecommitdiffstatshomepage
path: root/unix
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2015-01-29 14:54:38 +0000
committerDamien George <damien.p.george@gmail.com>2015-01-29 14:54:38 +0000
commit598af3a7d6bab1f106f6969ebab2d6f4e11ee963 (patch)
treeb42dad09c5fc472e007eb1dbb12d9c957b5ce0c1 /unix
parent827b0f747b2aa4870ef8de90cb0c3a4151e5ce71 (diff)
downloadmicropython-598af3a7d6bab1f106f6969ebab2d6f4e11ee963.tar.gz
micropython-598af3a7d6bab1f106f6969ebab2d6f4e11ee963.zip
unix: Add "coverage" target to do coverage testing using gcov.
Diffstat (limited to 'unix')
-rw-r--r--unix/Makefile8
1 files changed, 8 insertions, 0 deletions
diff --git a/unix/Makefile b/unix/Makefile
index 3a8604da88..509c48ddfd 100644
--- a/unix/Makefile
+++ b/unix/Makefile
@@ -131,3 +131,11 @@ fast:
minimal:
@echo Make sure to run make -B
$(MAKE) COPT="-Os -DNDEBUG" CFLAGS_EXTRA='-DMP_CONFIGFILE="<mpconfigport_minimal.h>"' BUILD=build-minimal PROG=micropython_minimal MICROPY_PY_TIME=0 MICROPY_PY_TERMIOS=0 MICROPY_PY_SOCKET=0 MICROPY_PY_FFI=0
+
+# build an interpreter for coverage testing and do the testing
+coverage:
+ @echo Make sure to run make -B
+ $(MAKE) COPT="-O0" CFLAGS_EXTRA='-fprofile-arcs -ftest-coverage' LDFLAGS_EXTRA='-fprofile-arcs -ftest-coverage' BUILD=build-coverage PROG=micropython_coverage
+ $(eval DIRNAME=$(notdir $(CURDIR)))
+ cd ../tests && MICROPY_MICROPYTHON=../$(DIRNAME)/micropython_coverage ./run-tests
+ gcov -o build-coverage/py ../py/*.c