Skip to content

Commit

Permalink
Fixing code coverage for native tests
Browse files Browse the repository at this point in the history
  • Loading branch information
thirtytwobits committed Jan 5, 2025
1 parent 0e53f3e commit 427e644
Show file tree
Hide file tree
Showing 7 changed files with 151 additions and 140 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,14 @@ jobs:
working-directory: verification
run: |
cmake -DNUNAVUT_EXTRA_GENERATOR_ARGS="--enable-override-variable-array-capacity;--embed-auditing-info" --preset config-clang-native-cpp-20
cmake --build --preset build-clang-native-cpp-20-debugcov
cmake --build --preset build-clang-native-cpp-20-debugcov --target cov_all
cmake -DNUNAVUT_EXTRA_GENERATOR_ARGS="--enable-override-variable-array-capacity;--embed-auditing-info" --preset config-clang-native-c-11
cmake --build --preset build-clang-native-c-11-debugcov
cmake --build --preset build-clang-native-c-11-debugcov --target cov_all
- name: upload-verification-coverage-reports
uses: actions/upload-artifact@v4
with:
name: verification-coverage-reports
path: verification/build/DebugCov/coverage/*

language-verification-python:
runs-on: ubuntu-latest
Expand Down
10 changes: 9 additions & 1 deletion CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,15 @@ After configuring you can also use Ninja directly::
ninja -t targets

To obtain coverage information for the verification suite (not the Python code),
build the `cov_all` target and inspect the output under the `coverage` directory.
build the `cov_all` target and inspect the output under the `coverage` directory::

cmake --build --preset build-clang-native-c-11-debug --target cov_all

.. warning::

When switching between gcc and clang you must do a full clean of your repo if you previously ran the coverage
build. For example ``git clean -xdf`` or clone a new repo in a different folder. Each compiler suite leaves
different byproducts that may interfere with the coverage tools in the other suite.

While we strongly encourage you to use the cmake presets, the CMakeLists.txt for the verification suite is driven by
three variables you can set in your environment or pass into cmake if using cmake directly:
Expand Down
Loading

0 comments on commit 427e644

Please sign in to comment.