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

Document how unit tests are defined and run #6505

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion tools/slang-test/README.md
Original file line number Diff line number Diff line change
@@ -56,7 +56,25 @@ The different APIs are
* DirectD3D11 -dx11,d3d11


It may also be necessary to have the working directory the root directory of the slang distribution - in the example above this would be "E:\slang\".
It may also be necessary to have the working directory the root directory of the slang distribution - in the example above this would be "E:\slang\".

## Unit tests

In addition to the above test tools, there is also `slang-unit-test-tool`, which is invoked as in the following example.

```
slang-test slang-unit-test-tool/byteEncode
```

This will run the `byteEncode` test. The unit tests are located in the [tools/slang-unit-test](https://github.com/shader-slang/slang/tree/master/tools/slang-unit-test) directory, and defined with macros like `SLANG_UNIT_TEST(byteEncode)`.

There are also graphics unit tests, which are run as follows:

```
slang-test gfx-unit-test-tool/precompiledTargetModule2Vulkan
```

This will run the `precompiledTargetModule2Vulkan` test. These tests are located in [tools/gfx-unit-test](https://github.com/shader-slang/slang/tree/master/tools/gfx-slang-unit-test), and likewise defined using macros like `SLANG_UNIT_TEST(precompiledTargetModule2Vulkan)`.

## Test Categories

Loading