mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-05-15 03:41:34 +00:00
[hlsl-writer][msl-writer] Enable generate tests.
This CL fixes and enables the generic generate tests for both the MSL and HLSL writers. Bug: tint:7 tint:8 Change-Id: I7a3e76196a7c50bd30dcd55940686dc8269786f1 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/28441 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: David Neto <dneto@google.com> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
This commit is contained in:
parent
d05f93fd8e
commit
2dbe9aa784
@ -28,18 +28,17 @@ namespace {
|
||||
|
||||
using HlslGeneratorImplTest = TestHelper;
|
||||
|
||||
TEST_F(HlslGeneratorImplTest, DISABLED_Generate) {
|
||||
TEST_F(HlslGeneratorImplTest, Generate) {
|
||||
ast::type::VoidType void_type;
|
||||
mod()->AddFunction(std::make_unique<ast::Function>(
|
||||
"my_func", ast::VariableList{}, &void_type));
|
||||
mod()->AddEntryPoint(std::make_unique<ast::EntryPoint>(
|
||||
ast::PipelineStage::kFragment, "my_func", ""));
|
||||
ast::PipelineStage::kFragment, "", "my_func"));
|
||||
|
||||
ASSERT_TRUE(gen().Generate(out())) << gen().error();
|
||||
EXPECT_EQ(result(), R"(#import <metal_lib>
|
||||
|
||||
void my_func() {
|
||||
EXPECT_EQ(result(), R"(void my_func() {
|
||||
}
|
||||
|
||||
)");
|
||||
}
|
||||
|
||||
|
@ -45,21 +45,22 @@ namespace {
|
||||
|
||||
using MslGeneratorImplTest = testing::Test;
|
||||
|
||||
TEST_F(MslGeneratorImplTest, DISABLED_Generate) {
|
||||
TEST_F(MslGeneratorImplTest, Generate) {
|
||||
ast::type::VoidType void_type;
|
||||
ast::Module m;
|
||||
m.AddFunction(std::make_unique<ast::Function>("my_func", ast::VariableList{},
|
||||
&void_type));
|
||||
m.AddEntryPoint(std::make_unique<ast::EntryPoint>(
|
||||
ast::PipelineStage::kCompute, "my_func", ""));
|
||||
ast::PipelineStage::kCompute, "", "my_func"));
|
||||
|
||||
GeneratorImpl g(&m);
|
||||
|
||||
ASSERT_TRUE(g.Generate()) << g.error();
|
||||
EXPECT_EQ(g.result(), R"(#import <metal_lib>
|
||||
EXPECT_EQ(g.result(), R"(#include <metal_stdlib>
|
||||
|
||||
compute void my_func() {
|
||||
kernel void my_func() {
|
||||
}
|
||||
|
||||
)");
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user