summaryrefslogtreecommitdiffstats
path: root/HACKING.md
diff options
context:
space:
mode:
authorNico Weber <thakis@chromium.org>2015-01-21 01:39:27 (GMT)
committerNico Weber <thakis@chromium.org>2015-01-21 01:39:27 (GMT)
commit4e6f7e16c31f398828fcd417b45ea6c722f74198 (patch)
tree1661a1abbdfd185b87bbc6b9bce3ac7488507575 /HACKING.md
parent7617494c1e0e66f6957f43822edca1759ca1303b (diff)
downloadNinja-4e6f7e16c31f398828fcd417b45ea6c722f74198.zip
Ninja-4e6f7e16c31f398828fcd417b45ea6c722f74198.tar.gz
Ninja-4e6f7e16c31f398828fcd417b45ea6c722f74198.tar.bz2
Document how to run gcov on ninja.
Diffstat (limited to 'HACKING.md')
-rw-r--r--HACKING.md16
1 files changed, 16 insertions, 0 deletions
diff --git a/HACKING.md b/HACKING.md
index 059a424..e3940ff 100644
--- a/HACKING.md
+++ b/HACKING.md
@@ -161,3 +161,19 @@ The trick is to install just the compilers, and not all of Visual Studio,
by following [these instructions][win7sdk].
[win7sdk]: http://www.kegel.com/wine/cl-howto-win7sdk.html
+
+### Using gcov
+
+Do a clean debug build with the right flags:
+
+ CFLAGS=-coverage LDFLAGS=-coverage ./configure.py --debug
+ ninja -t clean ninja_test && ninja ninja_test
+
+Run the test binary to generate `.gcda` and `.gcno` files in the build
+directory, then run gcov on the .o files to generate `.gcov` files in the
+root directory:
+
+ ./ninja_test
+ gcov build/*.o
+
+Look at the generated `.gcov` files directly, or use your favorit gcov viewer.