mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-21 18:59:21 +00:00
Fill in some disabled tests
This CL completes a few of the DISABLED tests. Change-Id: I38806fb9381240d6e3da700f1fb2dac5f899ca6d Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/19000 Reviewed-by: Ryan Harrison <rharrison@chromium.org>
This commit is contained in:
@@ -28,12 +28,13 @@ TEST_F(ParserImplTest, Empty) {
|
||||
ASSERT_TRUE(p->Parse()) << p->error();
|
||||
}
|
||||
|
||||
TEST_F(ParserImplTest, DISABLED_Parses) {
|
||||
TEST_F(ParserImplTest, Parses) {
|
||||
auto p = parser(R"(
|
||||
import "GLSL.std.430" as glsl;
|
||||
|
||||
[[location 0]] var<out> gl_FragColor : vec4<f32>;
|
||||
|
||||
entry_point vertex = main;
|
||||
fn main() -> void {
|
||||
gl_FragColor = vec4<f32>(.4, .2, .3, 1);
|
||||
}
|
||||
@@ -42,11 +43,12 @@ fn main() -> void {
|
||||
|
||||
auto m = p->module();
|
||||
ASSERT_EQ(1, m.imports().size());
|
||||
|
||||
// TODO(dsinclair) check rest of AST ...
|
||||
ASSERT_EQ(1, m.entry_points().size());
|
||||
ASSERT_EQ(1, m.functions().size());
|
||||
ASSERT_EQ(1, m.global_variables().size());
|
||||
}
|
||||
|
||||
TEST_F(ParserImplTest, DISABLED_HandlesError) {
|
||||
TEST_F(ParserImplTest, HandlesError) {
|
||||
auto p = parser(R"(
|
||||
import "GLSL.std.430" as glsl;
|
||||
|
||||
@@ -56,7 +58,7 @@ fn main() -> { # missing return type
|
||||
|
||||
ASSERT_FALSE(p->Parse());
|
||||
ASSERT_TRUE(p->has_error());
|
||||
EXPECT_EQ(p->error(), "4:15: missing return type for function");
|
||||
EXPECT_EQ(p->error(), "4:15: unable to determine function return type");
|
||||
}
|
||||
|
||||
TEST_F(ParserImplTest, GetRegisteredType) {
|
||||
|
||||
@@ -30,7 +30,7 @@ TEST_F(ParserTest, Empty) {
|
||||
ASSERT_TRUE(p.Parse()) << p.error();
|
||||
}
|
||||
|
||||
TEST_F(ParserTest, DISABLED_Parses) {
|
||||
TEST_F(ParserTest, Parses) {
|
||||
Context ctx;
|
||||
|
||||
Parser p(&ctx, R"(
|
||||
@@ -38,6 +38,7 @@ import "GLSL.std.430" as glsl;
|
||||
|
||||
[[location 0]] var<out> gl_FragColor : vec4<f32>;
|
||||
|
||||
entry_point vertex = main;
|
||||
fn main() -> void {
|
||||
gl_FragColor = vec4<f32>(.4, .2, .3, 1);
|
||||
}
|
||||
@@ -46,11 +47,12 @@ fn main() -> void {
|
||||
|
||||
auto m = p.module();
|
||||
ASSERT_EQ(1, m.imports().size());
|
||||
|
||||
// TODO(dsinclair) check rest of AST ...
|
||||
ASSERT_EQ(1, m.entry_points().size());
|
||||
ASSERT_EQ(1, m.functions().size());
|
||||
ASSERT_EQ(1, m.global_variables().size());
|
||||
}
|
||||
|
||||
TEST_F(ParserTest, DISABLED_HandlesError) {
|
||||
TEST_F(ParserTest, HandlesError) {
|
||||
Context ctx;
|
||||
Parser p(&ctx, R"(
|
||||
import "GLSL.std.430" as glsl;
|
||||
@@ -61,7 +63,7 @@ fn main() -> { # missing return type
|
||||
|
||||
ASSERT_FALSE(p.Parse());
|
||||
ASSERT_TRUE(p.has_error());
|
||||
EXPECT_EQ(p.error(), "4:15: missing return type for function");
|
||||
EXPECT_EQ(p.error(), "4:15: unable to determine function return type");
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
Reference in New Issue
Block a user