]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
doc: update the instructions for generating a coverage report
authorPádraig Brady <P@draigBrady.com>
Sun, 30 Apr 2017 03:53:16 +0000 (20:53 -0700)
committerPádraig Brady <P@draigBrady.com>
Sun, 30 Apr 2017 03:56:10 +0000 (20:56 -0700)
* HACKING: Change from explicit instructions to using gnulib
provided coverage testing targets.  Also include instructions
for adding root only tests to the report.
Fixes http://bugs.gnu.org/26709

HACKING

diff --git a/HACKING b/HACKING
index a42e102ea5f7ad786bd44ba72f25c1849b0d7758..4cf86540c1087dfb6242fe2a880ba455ce364703 100644 (file)
--- a/HACKING
+++ b/HACKING
@@ -601,22 +601,20 @@ option is always to improve tests.  You never know what you might
 uncover when you improve test coverage, and even if you don't find
 any bugs your contribution is sure to be appreciated.
 
-A good way to quickly assess current test coverage is to use "lcov"
-to generate HTML coverage reports.  Follow these steps:
-
-  # configure with coverage information
-  ./configure CFLAGS="-g -fprofile-arcs -ftest-coverage"
-  make
-  # run whatever tests you want, i.e.:
-  make check
-  # run lcov
-  lcov -t coreutils -q -d lib -b `pwd` -o lib.lcov -c
-  lcov -t coreutils -q -d src -b `pwd` -o src.lcov -c
-  # generate HTML from the output
-  genhtml -p `pwd` -t coreutils -q --output-directory lcov-html *.lcov
-
-Then just open the index.html file (in the generated lcov-html directory)
-in your favorite web browser.
+A good way to quickly assess current test coverage for standard
+and root only tests is to follow test steps (requires lcov to be installed):
+
+  # Do a standard run as the current user
+  make -j$(nproc) coverage
+
+  # Add the root only tests
+  sudo make -j$(nproc) build-coverage NON_ROOT_USERNAME=$USER SUBDIRS=.
+
+  # Generate the report with the combined results
+  make gen-coverage
+
+  # view the HTML report:
+  xdg-open doc/coverage/index.html
 
 ========================================================================
 Copyright (C) 2009-2017 Free Software Foundation, Inc.