Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add code coverage build support. #65

Merged
merged 4 commits into from
Feb 13, 2024

Conversation

ppt-adsk
Copy link
Collaborator

@ppt-adsk ppt-adsk commented Feb 9, 2024

Added support for code coverage using Clang.

A new build flag, --build-coverage, creates a new variant, called Coverage. The build therefore creates instrumented object files in the Coverage variant directory. The build flag must also be used to run the unit tests, which then produce profiling data.

llvm-profdata merge can then be used to combine the profiling data from each test run into a single file, which can then be used to produce HTML output using llvm-cov show.

@ppt-adsk ppt-adsk requested a review from debloip-adsk February 9, 2024 18:08
@ppt-adsk ppt-adsk self-assigned this Feb 9, 2024
@ppt-adsk
Copy link
Collaborator Author

ppt-adsk commented Feb 9, 2024

Most of the code changes are to implement workarounds to avoid crashes in the code coverage build, which have yet to be fully investigated:

  • Avoid directly calling _GetInputSceneIndex() for filtering scene indices, which crashes in the coverage build. Replaced by a workaround.
    
  • Leak scene indices at file new or process exit.  Proper scene index cleanup in this cases crashes in the coverage build, so leaking is the workaround.
    

@ppt-adsk ppt-adsk assigned ppt-adsk and unassigned ppt-adsk Feb 9, 2024
debloip-adsk
debloip-adsk previously approved these changes Feb 12, 2024
@ppt-adsk ppt-adsk added the ready-for-merge Development process is finished, PR is ready for merge label Feb 12, 2024
@ppt-adsk
Copy link
Collaborator Author

All tests pass in coverage build, even when run in parallel.

@roopavr-adsk roopavr-adsk merged commit b501edb into dev Feb 13, 2024
10 checks passed
@roopavr-adsk roopavr-adsk deleted the tremblp/HYDRA-589/add-coverage-variant branch February 13, 2024 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-merge Development process is finished, PR is ready for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants