Commit 75cf9b11 authored by Dafydd Harries's avatar Dafydd Harries

add makefile/script for generating lcov report

darcs-hash:20070124105053-c9803-38b34a6da597017d4640707adb574e00d5d14c44.gz
parent 00d46b7b
# ccache breaks -fprofile-arcs
export CCACHE_DISABLE=1
OUT=lcov
lcov-clean:
$(MAKE) clean
find -name "*.gcno" -o -name "*.gcda" -exec rm '{}' ';'
rm -rf $(OUT)
lcov-build:
$(MAKE) CFLAGS="-O0 -fprofile-arcs -ftest-coverage" LDFLAGS="-lgcov" check
lcov-report:
# hack: move gcov file from libraries back to source directory
for dir in `find -name .libs`; do \
(cd `dirname $$dir`; mv .libs/*.gc?? . || true) 2>/dev/null; \
done
mkdir -p $(OUT)
lcov -d . -c >$(OUT)/lcov.info 2>/dev/null
lcov -l $(OUT)/lcov.info 2>/dev/null |\
egrep '(^/usr|/test.*\.c)' |\
cut -d: -f1 >$(OUT)/lcov.remove
lcov -r $(OUT)/lcov.info `cat $(OUT)/lcov.remove` 2>/dev/null >$(OUT)/lcov.info.clean
genhtml -o lcov $(OUT)/lcov.info.clean
#!/bin/sh
make -f scripts/lcov.mk lcov-clean && \
make -f scripts/lcov.mk lcov-build && \
make -f scripts/lcov.mk lcov-report
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment