This is an archive of the discontinued LLVM Phabricator instance.

59559 Explain code coverage with Lit in docs/SourceBasedCodeCoverage.rst
ClosedPublic

Authored by FlashSheridan on Dec 28 2022, 8:45 AM.

Details

Summary

The documentation for code coverage in docs/SourceBasedCodeCoverage.rst omits a couple of crucial steps when using it with Lit. I’d suggest the following additions:
At the end of “Running the instrumented program”:

For a program such as the :doc:Lit <CommandGuide/lit> testing tool which
invokes other programs, it may be necessary to set LLVM_PROFILE_FILE for
each invocation. The pattern strings "%p" or "%Nm" may help to avoid
corruption due to concurrency.

18 lines later, after “code-block:: console”:

For an example of merging multiple profiles created by testing,
see the LLVM coverage build script https://github.com/llvm/llvm-zorg/blob/main/zorg/jenkins/jobs/jobs/llvm-coverage_.

Diff Detail

Event Timeline

FlashSheridan created this revision.Dec 28 2022, 8:45 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 28 2022, 8:45 AM
FlashSheridan requested review of this revision.Dec 28 2022, 8:45 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 28 2022, 8:45 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
FlashSheridan added inline comments.Jan 23 2023, 10:21 AM
clang/docs/SourceBasedCodeCoverage.rst
133
This revision is now accepted and ready to land.Jan 24 2023, 12:18 PM