Skip to content

Commit c83c383

Browse files
committed
Document how unit tests are defined and run
This closes issue #4771.
1 parent b86925c commit c83c383

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

tools/slang-test/README.md

+19-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,25 @@ The different APIs are
5656
* DirectD3D11 -dx11,d3d11
5757

5858

59-
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\".
59+
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\".
60+
61+
## Unit tests
62+
63+
In addition to the above test tools, there is also `slang-unit-test-tool`, which is invoked as in the following example.
64+
65+
```
66+
slang-test slang-unit-test-tool/byteEncode
67+
```
68+
69+
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)`.
70+
71+
There are also graphics unit tests, which are run as follows:
72+
73+
```
74+
slang-test gfx-unit-test-tool/precompiledTargetModule2Vulkan
75+
```
76+
77+
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)`.
6078

6179
## Test Categories
6280

0 commit comments

Comments
 (0)