summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnders Leino <aleino@nvidia.com>2025-03-03 18:17:04 +0200
committerGitHub <noreply@github.com>2025-03-03 11:17:04 -0500
commita99ee5538959909e2cb9e6eedb0194197a04bbe6 (patch)
tree642b7f3292e72e7a3147adc39988c0a7676cd7aa
parentb86925c1929186c122536b9a7ed75131faceddb7 (diff)
Document how unit tests are defined and run (#6448)
This closes issue #4771.
-rw-r--r--tools/slang-test/README.md20
1 files changed, 19 insertions, 1 deletions
diff --git a/tools/slang-test/README.md b/tools/slang-test/README.md
index 61829e728..1b9642b78 100644
--- a/tools/slang-test/README.md
+++ b/tools/slang-test/README.md
@@ -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-unit-test), and likewise defined using macros like `SLANG_UNIT_TEST(precompiledTargetModule2Vulkan)`.
## Test Categories