ast/type: Have all tests derive from new TestHelper
It doesn't actually do anything (yet), but will hold the context and a helper for constructing AST nodes. Bug: tint:322 Change-Id: I265093f2ef38040c77a34fb0c23d7fc33757466f Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/32665 Reviewed-by: dan sinclair <dsinclair@chromium.org> Commit-Queue: Ben Clayton <bclayton@google.com>
This commit is contained in:
parent
c7c8f58f17
commit
4f7c2955ab
|
@ -17,12 +17,12 @@
|
|||
#include <memory>
|
||||
#include <utility>
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
#include "src/ast/storage_class.h"
|
||||
#include "src/ast/stride_decoration.h"
|
||||
#include "src/ast/struct_member.h"
|
||||
#include "src/ast/struct_member_decoration.h"
|
||||
#include "src/ast/struct_member_offset_decoration.h"
|
||||
#include "src/ast/test_helper.h"
|
||||
#include "src/ast/type/array_type.h"
|
||||
#include "src/ast/type/i32_type.h"
|
||||
#include "src/ast/type/pointer_type.h"
|
||||
|
@ -34,7 +34,7 @@ namespace ast {
|
|||
namespace type {
|
||||
namespace {
|
||||
|
||||
using AccessControlTypeTest = testing::Test;
|
||||
using AccessControlTypeTest = TestHelper;
|
||||
|
||||
TEST_F(AccessControlTypeTest, Create) {
|
||||
U32Type u32;
|
||||
|
|
|
@ -17,12 +17,12 @@
|
|||
#include <memory>
|
||||
#include <utility>
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
#include "src/ast/storage_class.h"
|
||||
#include "src/ast/stride_decoration.h"
|
||||
#include "src/ast/struct_member.h"
|
||||
#include "src/ast/struct_member_decoration.h"
|
||||
#include "src/ast/struct_member_offset_decoration.h"
|
||||
#include "src/ast/test_helper.h"
|
||||
#include "src/ast/type/access_control_type.h"
|
||||
#include "src/ast/type/array_type.h"
|
||||
#include "src/ast/type/i32_type.h"
|
||||
|
@ -35,7 +35,7 @@ namespace ast {
|
|||
namespace type {
|
||||
namespace {
|
||||
|
||||
using AliasTypeTest = testing::Test;
|
||||
using AliasTypeTest = TestHelper;
|
||||
|
||||
TEST_F(AliasTypeTest, Create) {
|
||||
U32Type u32;
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
#include <memory>
|
||||
#include <utility>
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
#include "src/ast/stride_decoration.h"
|
||||
#include "src/ast/test_helper.h"
|
||||
#include "src/ast/type/i32_type.h"
|
||||
#include "src/ast/type/u32_type.h"
|
||||
|
||||
|
@ -27,7 +27,7 @@ namespace ast {
|
|||
namespace type {
|
||||
namespace {
|
||||
|
||||
using ArrayTypeTest = testing::Test;
|
||||
using ArrayTypeTest = TestHelper;
|
||||
|
||||
TEST_F(ArrayTypeTest, CreateSizedArray) {
|
||||
U32Type u32;
|
||||
|
|
|
@ -14,14 +14,14 @@
|
|||
|
||||
#include "src/ast/type/bool_type.h"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
#include "src/ast/test_helper.h"
|
||||
|
||||
namespace tint {
|
||||
namespace ast {
|
||||
namespace type {
|
||||
namespace {
|
||||
|
||||
using BoolTypeTest = testing::Test;
|
||||
using BoolTypeTest = TestHelper;
|
||||
|
||||
TEST_F(BoolTypeTest, Is) {
|
||||
BoolType b;
|
||||
|
|
|
@ -14,14 +14,14 @@
|
|||
|
||||
#include "src/ast/type/depth_texture_type.h"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
#include "src/ast/test_helper.h"
|
||||
|
||||
namespace tint {
|
||||
namespace ast {
|
||||
namespace type {
|
||||
namespace {
|
||||
|
||||
using DepthTextureTypeTest = testing::Test;
|
||||
using DepthTextureTypeTest = TestHelper;
|
||||
|
||||
TEST_F(DepthTextureTypeTest, Is) {
|
||||
DepthTextureType d(TextureDimension::kCube);
|
||||
|
|
|
@ -14,14 +14,14 @@
|
|||
|
||||
#include "src/ast/type/f32_type.h"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
#include "src/ast/test_helper.h"
|
||||
|
||||
namespace tint {
|
||||
namespace ast {
|
||||
namespace type {
|
||||
namespace {
|
||||
|
||||
using F32TypeTest = testing::Test;
|
||||
using F32TypeTest = TestHelper;
|
||||
|
||||
TEST_F(F32TypeTest, Is) {
|
||||
F32Type f;
|
||||
|
|
|
@ -14,14 +14,14 @@
|
|||
|
||||
#include "src/ast/type/i32_type.h"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
#include "src/ast/test_helper.h"
|
||||
|
||||
namespace tint {
|
||||
namespace ast {
|
||||
namespace type {
|
||||
namespace {
|
||||
|
||||
using I32TypeTest = testing::Test;
|
||||
using I32TypeTest = TestHelper;
|
||||
|
||||
TEST_F(I32TypeTest, Is) {
|
||||
I32Type i;
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
#include "src/ast/type/matrix_type.h"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
#include "src/ast/test_helper.h"
|
||||
#include "src/ast/type/i32_type.h"
|
||||
|
||||
namespace tint {
|
||||
|
@ -22,7 +22,7 @@ namespace ast {
|
|||
namespace type {
|
||||
namespace {
|
||||
|
||||
using MatrixTypeTest = testing::Test;
|
||||
using MatrixTypeTest = TestHelper;
|
||||
|
||||
TEST_F(MatrixTypeTest, Creation) {
|
||||
I32Type i32;
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
#include "src/ast/type/multisampled_texture_type.h"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
#include "src/ast/test_helper.h"
|
||||
#include "src/ast/type/f32_type.h"
|
||||
|
||||
namespace tint {
|
||||
|
@ -22,7 +22,7 @@ namespace ast {
|
|||
namespace type {
|
||||
namespace {
|
||||
|
||||
using MultisampledTextureTypeTest = testing::Test;
|
||||
using MultisampledTextureTypeTest = TestHelper;
|
||||
|
||||
TEST_F(MultisampledTextureTypeTest, Is) {
|
||||
F32Type f32;
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
#include "src/ast/type/pointer_type.h"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
#include "src/ast/test_helper.h"
|
||||
#include "src/ast/type/i32_type.h"
|
||||
|
||||
namespace tint {
|
||||
|
@ -22,7 +22,7 @@ namespace ast {
|
|||
namespace type {
|
||||
namespace {
|
||||
|
||||
using PointerTypeTest = testing::Test;
|
||||
using PointerTypeTest = TestHelper;
|
||||
|
||||
TEST_F(PointerTypeTest, Creation) {
|
||||
I32Type i32;
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
#include "src/ast/type/sampled_texture_type.h"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
#include "src/ast/test_helper.h"
|
||||
#include "src/ast/type/f32_type.h"
|
||||
|
||||
namespace tint {
|
||||
|
@ -22,7 +22,7 @@ namespace ast {
|
|||
namespace type {
|
||||
namespace {
|
||||
|
||||
using SampledTextureTypeTest = testing::Test;
|
||||
using SampledTextureTypeTest = TestHelper;
|
||||
|
||||
TEST_F(SampledTextureTypeTest, Is) {
|
||||
F32Type f32;
|
||||
|
|
|
@ -14,14 +14,14 @@
|
|||
|
||||
#include "src/ast/type/sampler_type.h"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
#include "src/ast/test_helper.h"
|
||||
|
||||
namespace tint {
|
||||
namespace ast {
|
||||
namespace type {
|
||||
namespace {
|
||||
|
||||
using SamplerTypeTest = testing::Test;
|
||||
using SamplerTypeTest = TestHelper;
|
||||
|
||||
TEST_F(SamplerTypeTest, Creation) {
|
||||
SamplerType s{SamplerKind::kSampler};
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
|
||||
#include <memory>
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
#include "src/ast/identifier_expression.h"
|
||||
#include "src/ast/test_helper.h"
|
||||
#include "src/type_determiner.h"
|
||||
|
||||
namespace tint {
|
||||
|
@ -25,7 +25,7 @@ namespace ast {
|
|||
namespace type {
|
||||
namespace {
|
||||
|
||||
using StorageTextureTypeTest = testing::Test;
|
||||
using StorageTextureTypeTest = TestHelper;
|
||||
|
||||
TEST_F(StorageTextureTypeTest, Is) {
|
||||
StorageTextureType s(TextureDimension::k2dArray, AccessControl::kReadOnly,
|
||||
|
|
|
@ -16,11 +16,11 @@
|
|||
|
||||
#include <utility>
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
#include "src/ast/stride_decoration.h"
|
||||
#include "src/ast/struct_member.h"
|
||||
#include "src/ast/struct_member_decoration.h"
|
||||
#include "src/ast/struct_member_offset_decoration.h"
|
||||
#include "src/ast/test_helper.h"
|
||||
#include "src/ast/type/array_type.h"
|
||||
#include "src/ast/type/i32_type.h"
|
||||
#include "src/ast/type/u32_type.h"
|
||||
|
@ -31,7 +31,7 @@ namespace ast {
|
|||
namespace type {
|
||||
namespace {
|
||||
|
||||
using StructTypeTest = testing::Test;
|
||||
using StructTypeTest = TestHelper;
|
||||
|
||||
TEST_F(StructTypeTest, Creation) {
|
||||
auto impl = std::make_unique<Struct>();
|
||||
|
|
|
@ -14,14 +14,14 @@
|
|||
|
||||
#include "src/ast/type/u32_type.h"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
#include "src/ast/test_helper.h"
|
||||
|
||||
namespace tint {
|
||||
namespace ast {
|
||||
namespace type {
|
||||
namespace {
|
||||
|
||||
using U32TypeTest = testing::Test;
|
||||
using U32TypeTest = TestHelper;
|
||||
|
||||
TEST_F(U32TypeTest, Is) {
|
||||
U32Type u;
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
#include "src/ast/type/vector_type.h"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
#include "src/ast/test_helper.h"
|
||||
#include "src/ast/type/i32_type.h"
|
||||
|
||||
namespace tint {
|
||||
|
@ -22,7 +22,7 @@ namespace ast {
|
|||
namespace type {
|
||||
namespace {
|
||||
|
||||
using VectorTypeTest = testing::Test;
|
||||
using VectorTypeTest = TestHelper;
|
||||
|
||||
TEST_F(VectorTypeTest, Creation) {
|
||||
I32Type i32;
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
#include "src/type_manager.h"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
#include "src/ast/test_helper.h"
|
||||
#include "src/ast/type/i32_type.h"
|
||||
#include "src/ast/type/u32_type.h"
|
||||
|
||||
|
|
Loading…
Reference in New Issue