NSS/Generating a coverage report

From MozillaWiki
< NSS
Jump to navigation Jump to search
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 .