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 #6448

Merged
Merged
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
Expand Up @@ -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.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would you also give instructions to run a single gfx-unit-test-tool test? For example,

.\build\Release\bin\slang-test.exe gfx-unit-test-tool/precompiledTargetModule2Vulkan

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done


```
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-unit-test), and likewise defined using macros like `SLANG_UNIT_TEST(precompiledTargetModule2Vulkan)`.

## Test Categories

Expand Down
Loading