NSS/Generating a coverage report: Difference between revisions
(Add initial version of coverage docs) |
m (Add minor point) |
||
Line 21: | Line 21: | ||
<code>$ wget https://raw.githubusercontent.com/llvm-mirror/llvm/master/tools/sancov/coverage-report-server.py</code> | <code>$ wget https://raw.githubusercontent.com/llvm-mirror/llvm/master/tools/sancov/coverage-report-server.py</code> | ||
Finally, launch the HTTP server and pass it the <i>ssl_gtest.symcov</i> file generated above. | Finally, from inside the NSS checkout, launch the HTTP server and pass it the <i>ssl_gtest.symcov</i> file generated above. | ||
<code>$ python3 coverage-report-server.py --symcov /tmp/tmp1D6wyt/ssl_gtest.symcov --srcpath .</code> | <code>$ python3 coverage-report-server.py --symcov /tmp/tmp1D6wyt/ssl_gtest.symcov --srcpath .</code> |
Latest revision as of 09:40, 14 May 2018
Install dependencies
Clang's coverage sanitizers (sancov) will be used to generate coverage reports.
Make sure to have the latest available LLVM installed, along with tools like clang, clang++, and sancov.
NOTE: You need to run Linux as long as sancov isn't supported on macOS. (Windows with clang-cl might just work.)
Generate a symbolized report
Run the following command inside your NSS working copy to build NSS and then generate a coverage report for the SSL GTest suite.
$ mach coverage ssl_gtests
After a while the command will finish and point to a ssl_gtest.symcov file.
Browse coverage report
First, download LLVM's coverage report server.
$ wget https://raw.githubusercontent.com/llvm-mirror/llvm/master/tools/sancov/coverage-report-server.py
Finally, from inside the NSS checkout, launch the HTTP server and pass it the ssl_gtest.symcov file generated above.
$ python3 coverage-report-server.py --symcov /tmp/tmp1D6wyt/ssl_gtest.symcov --srcpath .