Skip to content

Improve coverage #818

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

Merged
merged 10 commits into from
Apr 20, 2022
Merged

Improve coverage #818

merged 10 commits into from
Apr 20, 2022

Conversation

oleksandr-pavlyk
Copy link
Contributor

This PR changes generation of coverage of libDPCTLSyclInterface, building ctest executable and linking it against the library, as opposed to recompiling all the library together with test files into one executable.

Thanks to @diptorupd insight on how to generate coverage for code from shared object, it becomes possible to measure coverage of the DPCTLSyclInterface library generated by calls from Python API, specifically exercised by pytest.

llvm-cov is able to generate coverage for code in shared object library
so long of object files used to link it are passed with -object argument
to `llvm-cov report`.

These arguments are generated using CMake generator expression, specifically
TARGET_OBJECTS:DPCTLSyclInterface.
Decoupled llvm-genhtml and llvm-cov targets. Used object files in
llvm-genhtml as it was done in llvm-cov target.
@github-actions
Copy link

@coveralls
Copy link
Collaborator

coveralls commented Apr 20, 2022

Coverage Status

Coverage increased (+0.8%) to 82.72% when pulling ca01db1 on improve-coverage into 0232bed on master.

@diptorupd
Copy link
Contributor

@oleksandr-pavlyk do you see any cases for libsyclinterface where the profiling of the cython tests cases leads to a previously uncovered code line to be now covered?

1. Uses oneAPI

      python scripts/build_locally.py
      python scripts/build_locally.py --oneapi  # this still worsk

2. Use non-standard oneAPI installation

   # compiler_root/bin/ and compiler_root/bin-llvm should exist
   python scripts/build_locally --compiler-root=/path/to/compiler_root

3. Use open-source bundle

   python scripts/build_locally --c-compiler=clang --cxx-compiler=clang++ --compiler_root=/path/to/dpcpp_compiler
@oleksandr-pavlyk oleksandr-pavlyk force-pushed the improve-coverage branch 4 times, most recently from ce3fbe7 to c545ef4 Compare April 20, 2022 19:34
Convert two .lcov files from different runs into 2 json files,
combine them in Python and then use coveralls to merge the combined
result with coverage data and upload
Also removed setting of DPCTL_ENABLE_L0_PROGRAM_CREATION to default
value of ON.
Copy link
Contributor

@diptorupd diptorupd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The plan worked! All the other CMake clean ups are good. Most exciting is that we could boost libsyclinterface coverage using the Python package tests.

@oleksandr-pavlyk oleksandr-pavlyk merged commit 6ee76bc into master Apr 20, 2022
@github-actions
Copy link

Deleted rendered PR docs from intelpython.github.com/dpctl, latest should be updated shortly. 🤞

@oleksandr-pavlyk oleksandr-pavlyk deleted the improve-coverage branch April 20, 2022 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants