-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMinimalShaderTest.cpp
More file actions
39 lines (34 loc) · 1.28 KB
/
MinimalShaderTest.cpp
File metadata and controls
39 lines (34 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include <D3D12/Shader/ShaderEnums.h>
#include <Framework/ShaderTestFixture.h>
#include <string>
#include <catch2/catch_test_macros.hpp>
SCENARIO("MinimalShaderTestExample")
{
stf::ShaderTestFixture fixture(stf::ShaderTestFixture::FixtureDesc{});
// RunTest takes a desc that describes the test setup
// In this case we give the HLSL source code, entry function name and thread group count.
REQUIRE(fixture.RunTest(
stf::ShaderTestFixture::RuntimeTestDesc
{
.CompilationEnv
{
// The HLSL source can either be:
// 1. a std::filesystem::path that points to the HLSL file under test
// 2. a std::string containing the HLSL code under test.
.Source = std::string{
R"(
// Include the test framework
#include "/Test/STF/ShaderTestFramework.hlsli"
[numthreads(1, 1, 1)]
void MinimalTestEntryFunction()
{
ASSERT(AreEqual, 42, 42);
}
)"
}
},
.TestName = "MinimalTestEntryFunction",
.ThreadGroupCount{ 1, 1, 1 }
})
);
}