diff options
author | Nick Mathewson <nickm@torproject.org> | 2014-07-16 06:01:18 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-07-16 06:04:55 -0400 |
commit | 98541f2892335a5a512a6c01b2f2227bde1d649e (patch) | |
tree | b9ea77cf217b25279552b82b787a3d183807899e | |
parent | eed942aed9175971b510f0f720274171f1895d01 (diff) | |
download | tor-98541f2892335a5a512a6c01b2f2227bde1d649e.tar.gz tor-98541f2892335a5a512a6c01b2f2227bde1d649e.zip |
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
-rw-r--r-- | Makefile.am | 8 | ||||
-rw-r--r-- | changes/coverage-html | 5 |
2 files changed, 9 insertions, 4 deletions
diff --git a/Makefile.am b/Makefile.am index ab0caf008a..910cb12005 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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" diff --git a/changes/coverage-html b/changes/coverage-html new file mode 100644 index 0000000000..1c38c76fa6 --- /dev/null +++ b/changes/coverage-html @@ -0,0 +1,5 @@ + 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. |