Skip to content
Snippets Groups Projects
Commit 98541f28 authored by Nick Mathewson's avatar Nick Mathewson :game_die:
Browse files

Tweak coverage-html target

 - Don't try to rm -rf the directory before we start: somebody might
   have set it to ~, which would be quite sad.

 - Always quote the directory name

 - Use 'make reset-gcov' before running tests.

 - Use 'make check', not ./src/test/test
parent eed942ae
No related branches found
No related tags found
No related merge requests found
......@@ -76,11 +76,11 @@ reset-gcov:
HTML_COVER_DIR=./coverage_html
coverage-html: all
test -d $(HTML_COVER_DIR) && rm -rf $(HTML_COVER_DIR) || true
test -e `which lcov` || (echo "lcov must be installed. See <http://ltp.sourceforge.net/coverage/lcov.php>." && false)
mkdir -p $(HTML_COVER_DIR)
test -e "`which lcov`" || (echo "lcov must be installed. See <http://ltp.sourceforge.net/coverage/lcov.php>." && false)
test -d "$(HTML_COVER_DIR)" || mkdir -p "$(HTML_COVER_DIR)"
lcov --rc lcov_branch_coverage=1 --directory ./src --zerocounters
./src/test/test
$(MAKE) reset-gcov
$(MAKE) check
lcov --capture --rc lcov_branch_coverage=1 --no-external --directory . --output-file "$(HTML_COVER_DIR)/lcov.tmp"
lcov --remove "$(HTML_COVER_DIR)/lcov.tmp" --rc lcov_branch_coverage=1 'test/*' 'ext/tinytest*' '/usr/*' --output-file "$(HTML_COVER_DIR)/lcov.info"
genhtml --branch-coverage -o "$(HTML_COVER_DIR)" "$(HTML_COVER_DIR)/lcov.info"
......
o Minor features (testing):
- Add a "coverage-html" make target to generate HTML-visualized
coverage results when building with --enable-coverage. (Requires lcov.)
Patch from Kevin Murray.
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