yum-mirror/slang

Making it easier to work with shaders

git clone https://git.yummers.dev/yum-mirror/slang

yumfix compiler bug lolf8cb9c4d6

master
18 files

files

README.md6.0 KiB
directory-util.cpp1.1 KiB
directory-util.h2.0 KiB
filecheck.h1.3 KiB
options.cpp21.1 KiB
options.h5.6 KiB
parse-diagnostic-util.cpp17.1 KiB
parse-diagnostic-util.h4.8 KiB
slang-test-main.cpp166.8 KiB
slangc-tool.cpp2.4 KiB
slangc-tool.h514 B
slangi-tool-impl.h6.8 KiB
slangi-tool.cpp240 B
slangi-tool.h490 B
test-context.cpp8.8 KiB
test-context.h7.5 KiB
test-reporter.cpp22.4 KiB
test-reporter.h5.0 KiB

Slang Test

Slang Test (slang-test) is a command-line tool that coordinates and runs the Slang test suite. It acts as a test runner hub, executing various types of tests and collecting their results.

Basic Usage

slang-test [options] [test-prefix...]

If no test prefix is specified, all tests will be run. Test prefixes can be used to filter which tests to run, and include the path with directories separated by '/'.

Example:

slang-test -bindir path/to/bin -category full tests/compute/array-param

Command Line Options

Core Options

Test Selection and Categories

Available test categories:

A test may be in one or more categories. The categories are specified on top of a test, for example: //TEST(smoke,compute):COMPARE_COMPUTE:

API Control Options

API expression syntax:

Available APIs:

Test Execution Options

Output Options

Other Options

Test Types

Tests are identified by a special comment at the start of the test file: //TEST:<type>:

To ignore a test, use //DISABLE_TEST instead of //TEST.

Available test types:

Deprecated test types (do not create new tests of these kinds, and we need to slowly migrate existing tests to use SIMPLE, COMPARE_COMPUTE(_EX) or COMPARE_RENDER_COMPUTE instead):

Unit Tests

In addition to the above test tools, there are also slang-unit-test-tool and gfx-unit-test-tool, which are invoked as in the following examples; but note that the unit tests do get run as part of slang-test as well.

To ignore a unit test, use the SLANG_IGNORE_TEST macro:

SLANG_UNIT_TEST(foo)
{
    if (condition)
    {
        SLANG_IGNORE_TEST
    }

    // ...
}

slang-unit-test-tool

# Regular unit tests
slang-test slang-unit-test-tool/<test-name>
# e.g. run the `byteEncode` test.
slang-test slang-unit-test-tool/byteEncode

These tests are located in the tools/slang-unit-test directory, and defined with macros like SLANG_UNIT_TEST(byteEncode).

gfx-unit-test-tool

# Graphics unit tests
slang-test gfx-unit-test-tool/<test-name>

# e.g. run the `precompiledTargetModule2Vulkan` test.
slang-test gfx-unit-test-tool/precompiledTargetModule2Vulkan

These tests are located in tools/gfx-unit-test, and likewise defined using macros like SLANG_UNIT_TEST(precompiledTargetModule2Vulkan).