Code coverage: current status

Marco Castelluccio

Codecov.io

Overall navigable report of Linux + Windows code coverage:

https://codecov.io/gh/marco-c/gecko-dev

Code coverage addon

  • DXR integration, with coverage overlay;
  • Searchfox integration, with coverage overlay;
  • Bugzilla integration, with coverage information about landed patches.

List of patches and their coverage

https://firefox-code-coverage.herokuapp.com/

Zero coverage report

  • Which files are no longer tested because they are no longer used and can be removed?
  • Which files are completely untested but should be?

https://marco-c.github.io/code-coverage-reports/

With a short and random usage of the report Sylvestre and I were able to remove ~50 files with ~12000 lines of code.

How to build a local coverage build or a try coverage build

https://developer.mozilla.org/en-US/docs/Mozilla/Testing/Measuring_Code_Coverage_on_Firefox

Local coverage build on Linux


# Enable code coverage
ac_add_options --enable-coverage
export CFLAGS="--coverage"
export CXXFLAGS="--coverage"
export LDFLAGS="--coverage"

# Without debug mode, content processes terminate with "_exit",
# which doesn't update coverage counters.
ac_add_options --enable-debug
# With the sandbox, content processes can't write updated coverage
# counters in the gcda files.
ac_add_options --disable-sandbox
					

Local coverage build on Windows


# Enable code coverage
ac_add_options --enable-coverage
export CC="clang-cl.exe"
export CXX="clang-cl.exe"
export CFLAGS="--coverage"
export CXXFLAGS="--coverage"
# Currently need a custom Clang build
export LDFLAGS="PATH_TO_LLVM_BUILD_DIR/lib/clang/6.0.0/lib/windows/clang_rt.profile-x86_64.lib"

# Without debug mode, content processes terminate with "_exit",
# which doesn't update coverage counters.
ac_add_options --enable-debug
# With the sandbox, content processes can't write updated coverage
# counters in the gcda files.
ac_add_options --disable-sandbox
					

Try coverage build

Linux:

./mach try fuzzy -q 'linux64-ccov'
					
Windows:

./mach try fuzzy -q 'win64-ccov'