Skip to content

Commit c27c522

Browse files
committed
TOC and wording
1 parent a7d557f commit c27c522

File tree

1 file changed

+19
-9
lines changed

1 file changed

+19
-9
lines changed

doc/codeCoverageInstructions.md

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,24 @@
11
# Code Coverage For Windows
22

3-
Maya-hydra has support for obtaining code coverage on Windows platforms.
3+
## Table of contents
44

5-
The support uses two main tools: Clang for the compilation of maya-hydra and the LLVM toolset for the parsing of code coverage
6-
information and the generation of a code coverage report.
5+
- [Introduction](#introduction)
6+
- [Prerequisites](#prerequisites)
7+
- [Documentation References](#documentation-references)
8+
- [Building the Coverage Variant](#building-the-coverage-variant)
9+
- [Running Tests and Getting Raw Coverage Information](#running-tests-and-getting-raw-coverage-information)
10+
- [Parsing Coverage Information and Generating a Report](#parsing-coverage-information-and-generating-a-report)
11+
- [Viewing Results](#viewing-results)
12+
13+
## Introduction
14+
15+
maya-hydra has support for obtaining code coverage on Windows platforms.
16+
17+
The support uses two main tools: Clang for the compilation of maya-hydra and the LLVM toolset for the parsing of code coverage information and the generation of a code coverage report.
718

819
## Prerequisites
920

10-
To install Clang and the LLVM toolset, you can install an optional module with Visual Studio. Refer to these instructions: [Install Clang and LLVM Toolset](https://learn.microsoft.com/en-us/cpp/build/clang-support-msbuild?view=msvc-170)
21+
To install Clang and the LLVM toolset, you can install an optional module with Visual Studio. Refer to these instructions: [Install Clang and LLVM Toolset](https://learn.microsoft.com/en-us/cpp/build/clang-support-msbuild?view=msvc-170)
1122

1223
> Note: On Windows, all commands must be executed in a `x64 Native Tools Command Prompt for VS 2022` command line
1324
@@ -17,9 +28,9 @@ To install Clang and the LLVM toolset, you can install an optional module with V
1728

1829
## Building the Coverage Variant
1930

20-
The maya-hydra build has a Coverage variant that can be used with the following stages: clean,build,install,test (note that the test stage depends on the install stage). Clang is used with code coverage instrumentation flags enabled (-fprofile-instr-generate -fcoverage-mapping) so that when tests are run after a successful install stage, code coverage data files will be generated. Refer to the [build documentation](./build.md) for more details.
31+
The maya-hydra build has a Coverage variant that can be used with the following stages: `clean,build,install,test` (note that the `test` stage depends on the `install` stage). Clang is used with code coverage instrumentation flags enabled (`-fprofile-instr-generate -fcoverage-mapping`) so that when tests are run after a successful `install` stage, code coverage data files will be generated. Refer to the [build documentation](./build.md) for more details.
2132

22-
To build the coverage variant you can run:
33+
Here is the command to build the Coverage variant:
2334

2435
```
2536
python build.py
@@ -32,18 +43,17 @@ python build.py
3243
--build-args="-DPYTHON_INCLUDE_DIR=<python_include_dir>,-DPython_EXECUTABLE=<python_executable>,-DPYTHON_LIBRARIES=<python_libraries>,-DCMAKE_WANT_MATERIALX_BUILD=ON,-DCMAKE_PREFIX_PATH=<cmake_prefix_path>" ^
3344
<workspace_location>
3445
```
35-
3646
The `--build-coverage` flag indicates that the variant to be built is the Coverage variant.
3747

3848
At time of writing (February 26th, 2024), only the Ninja code generator is supported. In particular, the Visual Studio generator is known not to output code coverage data.
3949

4050
## Running Tests and Getting Raw Coverage Information
4151

42-
To run tests and generate code coverage information using the Coverage build, run the same command as in [the previous section](#building-the-coverage-variant), but replace `--stages=clean,configure,build,install` with `--stages=test`.
52+
To run tests and generate code coverage information using the Coverage build, run the same `build.py` command as in [the previous section](#building-the-coverage-variant), but replace `--stages=clean,configure,build,install` with `--stages=test`.
4353

4454
After running tests, the raw coverage information files will be generated in `<workspace_location>\build\Coverage\test\lib\mayaUsd\render\mayaToHydra\<test_subfolders>`. These files have a `.profraw` file extension.
4555

46-
## Parsing Coverage Information and Report
56+
## Parsing Coverage Information and Generating a Report
4757

4858
To parse the coverage information, two tools from the LLVM toolset are used: `llvm-profdata merge` and `llvm-cov show`.
4959
- `llvm-profdata merge`: Parses and merges all of the raw coverage information files (`.profraw`) into a single file with a `.profdata` extension.

0 commit comments

Comments
 (0)