Blender
V5.3
source
blender
gpu
shader_tool
tests
metadata_test.cc
Go to the documentation of this file.
1
/* SPDX-FileCopyrightText: 2026 Blender Authors
2
*
3
* SPDX-License-Identifier: Apache-2.0 */
4
5
#include "
shader_tool_testing.hh
"
6
7
namespace
blender::gpu::tests
{
8
9
using namespace
shader::parser;
10
using namespace
shader;
11
using namespace
std;
12
13
TEST
(shader_tool, Include)
14
{
15
{
16
string
input = R
"(
17
#include "a.hh"
18
#include "b.glsl"
19
#if 0
20
# include "c.hh"
21
#else
22
# include "d.hh"
23
#endif
24
#if !defined(GPU_SHADER)
25
# include "e.hh"
26
#endif
27
)";
28
string
expect =
29
R
"(static void test(GPUSource &source, GPUFunctionDictionary *g_functions, GPUPrintFormatMap *g_formats) {
30
source.add_dependency("a.hh");
31
source.add_dependency("b.glsl");
32
source.add_dependency("d.hh");
33
UNUSED_VARS(source, g_functions, g_formats);
34
}
35
)";
36
auto
[
output
,
metadata
, error] = process_test_string(input);
37
EXPECT_EQ
(expect,
metadata
.serialize(
"test"
));
38
EXPECT_EQ
(error,
""
);
39
}
40
}
41
42
}
// namespace blender::gpu::tests
output
#define output
blender::gpu::shader::metadata
Definition
gpu/shader_tool/metadata.cc:11
blender::gpu::tests
Definition
expression_test.cc:9
blender::gpu::tests::TEST
TEST(shader_tool, ExpressionParser)
Definition
expression_test.cc:27
blender::EXPECT_EQ
EXPECT_EQ(BLI_expr_pylike_eval(expr, nullptr, 0, &result), EXPR_PYLIKE_INVALID)
shader_tool_testing.hh
Generated on
for Blender by
doxygen
1.18.0