mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-05-13 19:01:24 +00:00
Update the script to check coverage generation is enabled, and provide a sensible error message if it is not. Change-Id: I42f2b97d18bb3be2d081200cb682ea310476943f Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/70520 Kokoro: Kokoro <noreply+kokoro@google.com> Commit-Queue: Ben Clayton <bclayton@chromium.org> Reviewed-by: David Neto <dneto@google.com>
1.1 KiB
1.1 KiB
Generating and viewing Tint code-coverage
Requirements:
- Host running Linux or macOS
- Clang toolchain on the
PATH
environment variable
Building Tint with coverage generation enabled
Follow the steps to build Tint with CMake, but include the additional -DTINT_EMIT_COVERAGE=1
CMake flag.
Generate coverage information
Use the <tint>/tools/tint-generate-coverage
script to run the tint executable or unit tests and generate the coverage information.
The script takes the executable to invoke as the first command line argument, followed by additional arguments to pass to the executable.
For example, to see the code coverage for all unit tests, run:
<tint>/tools/tint-generate-coverage <build>/tint_unittests --gtest_brief
The script will emit two files at the root of the tint directory:
coverage.summary
- A text file giving a coverage summary for all Tint source files.lcov.info
- A binary coverage file that can be consumed with the VSCode Coverage Gutters extension.