Skip to content
Snippets Groups Projects
Commit b81cda3c authored by Erwan Jahier's avatar Erwan Jahier
Browse files

Enhance the test coverage rule in src/Makefile (print the ratio

dead hits versus all hits).
parent cd475af2
No related branches found
No related tags found
No related merge requests found
...@@ -70,15 +70,19 @@ test/ocamlprof.dump: pbc test ...@@ -70,15 +70,19 @@ test/ocamlprof.dump: pbc test
prof: test/ocamlprof.dump prof: test/ocamlprof.dump
mkdir prof || rm prof/* mkdir prof || rm prof/*
for d in ${SOURCES}; do \ for d in ${SOURCES}; do \
ocamlprof -f test/ocamlprof.dump $$d > prof/$$d ;\ ocamlprof -F "ocamlprof: " -f test/ocamlprof.dump $$d > prof/$$d ;\
done done
grep: grep:
rm test/ocamlprof.dump || true rm test/ocamlprof.dump || true
make clean make clean
make prof make prof
grep -n -e "(\* 0 \*)" prof/*.ml | grep -v "assert false" > dead.grep grep -n -e "(\* ocamlprof: 0 \*)" prof/*.ml | grep -v "assert false" > dead.grep
wc dead.grep > untested_line_counter grep -n -e "(\* ocamlprof: " prof/*.ml | grep -v "assert false" > all.grep
DEAD_HITS=`wc -l dead.grep | cut -f 1 -d " "`;\
ALL_HITS=`wc -l all.grep | cut -f 1 -d " "`;\
SOL=`echo "scale=2 ; $$DEAD_HITS * 100 / $$ALL_HITS " | bc ` ;\
echo "$$DEAD_HITS / $$ALL_HITS = $$SOL %" > untested_line_counter
cat untested_line_counter cat untested_line_counter
##############################################################################" ##############################################################################"
......
This diff is collapsed.
402 4118 32317 dead.grep 402 / 1584 = 25.37 %
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment