ast: 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: Ic7ba92bf39abf64ff2ac51d81c8a6338f5eff608
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/32663
Reviewed-by: dan sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
diff --git a/BUILD.gn b/BUILD.gn
index 60f3b85..b53cc1f 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -769,6 +769,7 @@
     "src/ast/struct_member_test.cc",
     "src/ast/struct_test.cc",
     "src/ast/switch_statement_test.cc",
+    "src/ast/test_helper.h",
     "src/ast/type/access_control_type_test.cc",
     "src/ast/type/alias_type_test.cc",
     "src/ast/type/array_type_test.cc",
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 630828d..cfd02d1 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -379,6 +379,7 @@
   ast/struct_member_offset_decoration_test.cc
   ast/struct_test.cc
   ast/switch_statement_test.cc
+  ast/test_helper.h
   ast/type/access_control_type_test.cc
   ast/type/alias_type_test.cc
   ast/type/array_type_test.cc
diff --git a/src/ast/array_accessor_expression_test.cc b/src/ast/array_accessor_expression_test.cc
index a43b6b2..2893797 100644
--- a/src/ast/array_accessor_expression_test.cc
+++ b/src/ast/array_accessor_expression_test.cc
@@ -14,14 +14,14 @@
 
 #include "src/ast/array_accessor_expression.h"
 
-#include "gtest/gtest.h"
 #include "src/ast/identifier_expression.h"
+#include "src/ast/test_helper.h"
 
 namespace tint {
 namespace ast {
 namespace {
 
-using ArrayAccessorExpressionTest = testing::Test;
+using ArrayAccessorExpressionTest = TestHelper;
 
 TEST_F(ArrayAccessorExpressionTest, Create) {
   auto ary = std::make_unique<IdentifierExpression>("ary");
diff --git a/src/ast/assignment_statement_test.cc b/src/ast/assignment_statement_test.cc
index 681b41b..8ac74a9 100644
--- a/src/ast/assignment_statement_test.cc
+++ b/src/ast/assignment_statement_test.cc
@@ -14,14 +14,14 @@
 
 #include "src/ast/assignment_statement.h"
 
-#include "gtest/gtest.h"
 #include "src/ast/identifier_expression.h"
+#include "src/ast/test_helper.h"
 
 namespace tint {
 namespace ast {
 namespace {
 
-using AssignmentStatementTest = testing::Test;
+using AssignmentStatementTest = TestHelper;
 
 TEST_F(AssignmentStatementTest, Creation) {
   auto lhs = std::make_unique<ast::IdentifierExpression>("lhs");
diff --git a/src/ast/binary_expression_test.cc b/src/ast/binary_expression_test.cc
index 9140b7e..4daf6ce 100644
--- a/src/ast/binary_expression_test.cc
+++ b/src/ast/binary_expression_test.cc
@@ -16,14 +16,14 @@
 
 #include <sstream>
 
-#include "gtest/gtest.h"
 #include "src/ast/identifier_expression.h"
+#include "src/ast/test_helper.h"
 
 namespace tint {
 namespace ast {
 namespace {
 
-using BinaryExpressionTest = testing::Test;
+using BinaryExpressionTest = TestHelper;
 
 TEST_F(BinaryExpressionTest, Creation) {
   auto lhs = std::make_unique<IdentifierExpression>("lhs");
diff --git a/src/ast/binding_decoration_test.cc b/src/ast/binding_decoration_test.cc
index 2f463fe..253d296 100644
--- a/src/ast/binding_decoration_test.cc
+++ b/src/ast/binding_decoration_test.cc
@@ -14,13 +14,13 @@
 
 #include "src/ast/binding_decoration.h"
 
-#include "gtest/gtest.h"
+#include "src/ast/test_helper.h"
 
 namespace tint {
 namespace ast {
 namespace {
 
-using BindingDecorationTest = testing::Test;
+using BindingDecorationTest = TestHelper;
 
 TEST_F(BindingDecorationTest, Creation) {
   BindingDecoration d{2, Source{}};
diff --git a/src/ast/bitcast_expression_test.cc b/src/ast/bitcast_expression_test.cc
index fbc6059..8641442 100644
--- a/src/ast/bitcast_expression_test.cc
+++ b/src/ast/bitcast_expression_test.cc
@@ -14,15 +14,15 @@
 
 #include "src/ast/bitcast_expression.h"
 
-#include "gtest/gtest.h"
 #include "src/ast/identifier_expression.h"
+#include "src/ast/test_helper.h"
 #include "src/ast/type/f32_type.h"
 
 namespace tint {
 namespace ast {
 namespace {
 
-using BitcastExpressionTest = testing::Test;
+using BitcastExpressionTest = TestHelper;
 
 TEST_F(BitcastExpressionTest, Create) {
   type::F32Type f32;
diff --git a/src/ast/block_statement_test.cc b/src/ast/block_statement_test.cc
index d2276bc..893ad38 100644
--- a/src/ast/block_statement_test.cc
+++ b/src/ast/block_statement_test.cc
@@ -17,15 +17,15 @@
 #include <memory>
 #include <sstream>
 
-#include "gtest/gtest.h"
 #include "src/ast/discard_statement.h"
 #include "src/ast/if_statement.h"
+#include "src/ast/test_helper.h"
 
 namespace tint {
 namespace ast {
 namespace {
 
-using BlockStatementTest = testing::Test;
+using BlockStatementTest = TestHelper;
 
 TEST_F(BlockStatementTest, Creation) {
   auto d = std::make_unique<DiscardStatement>();
diff --git a/src/ast/bool_literal_test.cc b/src/ast/bool_literal_test.cc
index 502b12d..1a09808 100644
--- a/src/ast/bool_literal_test.cc
+++ b/src/ast/bool_literal_test.cc
@@ -14,14 +14,14 @@
 
 #include "src/ast/bool_literal.h"
 
-#include "gtest/gtest.h"
+#include "src/ast/test_helper.h"
 #include "src/ast/type/bool_type.h"
 
 namespace tint {
 namespace ast {
 namespace {
 
-using BoolLiteralTest = testing::Test;
+using BoolLiteralTest = TestHelper;
 
 TEST_F(BoolLiteralTest, True) {
   ast::type::BoolType bool_type;
diff --git a/src/ast/break_statement_test.cc b/src/ast/break_statement_test.cc
index fda7552..e9e44cb 100644
--- a/src/ast/break_statement_test.cc
+++ b/src/ast/break_statement_test.cc
@@ -14,13 +14,13 @@
 
 #include "src/ast/break_statement.h"
 
-#include "gtest/gtest.h"
+#include "src/ast/test_helper.h"
 
 namespace tint {
 namespace ast {
 namespace {
 
-using BreakStatementTest = testing::Test;
+using BreakStatementTest = TestHelper;
 
 TEST_F(BreakStatementTest, Creation_WithSource) {
   BreakStatement stmt(Source{Source::Location{20, 2}});
diff --git a/src/ast/builtin_decoration_test.cc b/src/ast/builtin_decoration_test.cc
index ec1b6cc..b64fcd4 100644
--- a/src/ast/builtin_decoration_test.cc
+++ b/src/ast/builtin_decoration_test.cc
@@ -14,13 +14,13 @@
 
 #include "src/ast/builtin_decoration.h"
 
-#include "gtest/gtest.h"
+#include "src/ast/test_helper.h"
 
 namespace tint {
 namespace ast {
 namespace {
 
-using BuiltinDecorationTest = testing::Test;
+using BuiltinDecorationTest = TestHelper;
 
 TEST_F(BuiltinDecorationTest, Creation) {
   BuiltinDecoration d{Builtin::kFragDepth, Source{}};
diff --git a/src/ast/call_expression_test.cc b/src/ast/call_expression_test.cc
index 89e4872..aae1389 100644
--- a/src/ast/call_expression_test.cc
+++ b/src/ast/call_expression_test.cc
@@ -14,14 +14,14 @@
 
 #include "src/ast/call_expression.h"
 
-#include "gtest/gtest.h"
 #include "src/ast/identifier_expression.h"
+#include "src/ast/test_helper.h"
 
 namespace tint {
 namespace ast {
 namespace {
 
-using CallExpressionTest = testing::Test;
+using CallExpressionTest = TestHelper;
 
 TEST_F(CallExpressionTest, Creation) {
   auto func = std::make_unique<IdentifierExpression>("func");
diff --git a/src/ast/call_statement_test.cc b/src/ast/call_statement_test.cc
index 62b2134..1337440 100644
--- a/src/ast/call_statement_test.cc
+++ b/src/ast/call_statement_test.cc
@@ -14,15 +14,15 @@
 
 #include "src/ast/call_statement.h"
 
-#include "gtest/gtest.h"
 #include "src/ast/call_expression.h"
 #include "src/ast/identifier_expression.h"
+#include "src/ast/test_helper.h"
 
 namespace tint {
 namespace ast {
 namespace {
 
-using CallStatementTest = testing::Test;
+using CallStatementTest = TestHelper;
 
 TEST_F(CallStatementTest, Creation) {
   auto expr = std::make_unique<ast::CallExpression>(
diff --git a/src/ast/case_statement_test.cc b/src/ast/case_statement_test.cc
index 85194fd..9a415c8 100644
--- a/src/ast/case_statement_test.cc
+++ b/src/ast/case_statement_test.cc
@@ -14,10 +14,10 @@
 
 #include "src/ast/case_statement.h"
 
-#include "gtest/gtest.h"
 #include "src/ast/discard_statement.h"
 #include "src/ast/if_statement.h"
 #include "src/ast/sint_literal.h"
+#include "src/ast/test_helper.h"
 #include "src/ast/type/i32_type.h"
 #include "src/ast/type/u32_type.h"
 #include "src/ast/uint_literal.h"
@@ -26,7 +26,7 @@
 namespace ast {
 namespace {
 
-using CaseStatementTest = testing::Test;
+using CaseStatementTest = TestHelper;
 
 TEST_F(CaseStatementTest, Creation_i32) {
   ast::type::I32Type i32;
diff --git a/src/ast/constant_id_decoration_test.cc b/src/ast/constant_id_decoration_test.cc
index 93077eb..32545fb 100644
--- a/src/ast/constant_id_decoration_test.cc
+++ b/src/ast/constant_id_decoration_test.cc
@@ -14,13 +14,13 @@
 
 #include "src/ast/constant_id_decoration.h"
 
-#include "gtest/gtest.h"
+#include "src/ast/test_helper.h"
 
 namespace tint {
 namespace ast {
 namespace {
 
-using ConstantIdDecorationTest = testing::Test;
+using ConstantIdDecorationTest = TestHelper;
 
 TEST_F(ConstantIdDecorationTest, Creation) {
   ConstantIdDecoration d{12, Source{}};
diff --git a/src/ast/continue_statement_test.cc b/src/ast/continue_statement_test.cc
index bd8c9b6..5b1c58e 100644
--- a/src/ast/continue_statement_test.cc
+++ b/src/ast/continue_statement_test.cc
@@ -14,13 +14,13 @@
 
 #include "src/ast/continue_statement.h"
 
-#include "gtest/gtest.h"
+#include "src/ast/test_helper.h"
 
 namespace tint {
 namespace ast {
 namespace {
 
-using ContinueStatementTest = testing::Test;
+using ContinueStatementTest = TestHelper;
 
 TEST_F(ContinueStatementTest, Creation_WithSource) {
   ContinueStatement stmt(Source{Source::Location{20, 2}});
diff --git a/src/ast/decorated_variable_test.cc b/src/ast/decorated_variable_test.cc
index b43be2d..0e51135 100644
--- a/src/ast/decorated_variable_test.cc
+++ b/src/ast/decorated_variable_test.cc
@@ -14,13 +14,13 @@
 
 #include "src/ast/decorated_variable.h"
 
-#include "gtest/gtest.h"
 #include "src/ast/binding_decoration.h"
 #include "src/ast/builtin_decoration.h"
 #include "src/ast/constant_id_decoration.h"
 #include "src/ast/identifier_expression.h"
 #include "src/ast/location_decoration.h"
 #include "src/ast/set_decoration.h"
+#include "src/ast/test_helper.h"
 #include "src/ast/type/f32_type.h"
 #include "src/ast/type/i32_type.h"
 #include "src/ast/variable.h"
@@ -30,7 +30,7 @@
 namespace ast {
 namespace {
 
-using DecoratedVariableTest = testing::Test;
+using DecoratedVariableTest = TestHelper;
 
 TEST_F(DecoratedVariableTest, Creation) {
   type::I32Type t;
diff --git a/src/ast/decoration_test.cc b/src/ast/decoration_test.cc
index aed6aea..8f32546 100644
--- a/src/ast/decoration_test.cc
+++ b/src/ast/decoration_test.cc
@@ -17,16 +17,15 @@
 #include <sstream>
 #include <utility>
 
-#include "gtest/gtest.h"
-
 #include "src/ast/array_decoration.h"
 #include "src/ast/constant_id_decoration.h"
+#include "src/ast/test_helper.h"
 
 namespace tint {
 namespace ast {
 namespace {
 
-using DecorationTest = testing::Test;
+using DecorationTest = TestHelper;
 
 TEST_F(DecorationTest, AsCorrectType) {
   auto* decoration = new ConstantIdDecoration(1, Source{});
diff --git a/src/ast/discard_statement_test.cc b/src/ast/discard_statement_test.cc
index 9433421..a60a9a4 100644
--- a/src/ast/discard_statement_test.cc
+++ b/src/ast/discard_statement_test.cc
@@ -16,13 +16,13 @@
 
 #include <sstream>
 
-#include "gtest/gtest.h"
+#include "src/ast/test_helper.h"
 
 namespace tint {
 namespace ast {
 namespace {
 
-using DiscardStatementTest = testing::Test;
+using DiscardStatementTest = TestHelper;
 
 TEST_F(DiscardStatementTest, Creation) {
   DiscardStatement stmt;
diff --git a/src/ast/else_statement_test.cc b/src/ast/else_statement_test.cc
index 6235a9d..4e436fa 100644
--- a/src/ast/else_statement_test.cc
+++ b/src/ast/else_statement_test.cc
@@ -14,18 +14,18 @@
 
 #include "src/ast/else_statement.h"
 
-#include "gtest/gtest.h"
 #include "src/ast/bool_literal.h"
 #include "src/ast/discard_statement.h"
 #include "src/ast/if_statement.h"
 #include "src/ast/scalar_constructor_expression.h"
+#include "src/ast/test_helper.h"
 #include "src/ast/type/bool_type.h"
 
 namespace tint {
 namespace ast {
 namespace {
 
-using ElseStatementTest = testing::Test;
+using ElseStatementTest = TestHelper;
 
 TEST_F(ElseStatementTest, Creation) {
   ast::type::BoolType bool_type;
diff --git a/src/ast/expression_test.cc b/src/ast/expression_test.cc
index 41a7ee6..a1b6881 100644
--- a/src/ast/expression_test.cc
+++ b/src/ast/expression_test.cc
@@ -14,7 +14,7 @@
 
 #include "src/ast/expression.h"
 
-#include "gtest/gtest.h"
+#include "src/ast/test_helper.h"
 #include "src/ast/type/alias_type.h"
 #include "src/ast/type/i32_type.h"
 
@@ -30,7 +30,7 @@
   void to_str(std::ostream&, size_t) const override {}
 };
 
-using ExpressionTest = testing::Test;
+using ExpressionTest = TestHelper;
 
 TEST_F(ExpressionTest, set_result_type) {
   type::I32Type i32;
diff --git a/src/ast/fallthrough_statement_test.cc b/src/ast/fallthrough_statement_test.cc
index 9552627..c5a936d 100644
--- a/src/ast/fallthrough_statement_test.cc
+++ b/src/ast/fallthrough_statement_test.cc
@@ -14,13 +14,13 @@
 
 #include "src/ast/fallthrough_statement.h"
 
-#include "gtest/gtest.h"
+#include "src/ast/test_helper.h"
 
 namespace tint {
 namespace ast {
 namespace {
 
-using FallthroughStatementTest = testing::Test;
+using FallthroughStatementTest = TestHelper;
 
 TEST_F(FallthroughStatementTest, Creation) {
   FallthroughStatement stmt;
diff --git a/src/ast/float_literal_test.cc b/src/ast/float_literal_test.cc
index 5c5f23f..cc5d55f 100644
--- a/src/ast/float_literal_test.cc
+++ b/src/ast/float_literal_test.cc
@@ -14,14 +14,14 @@
 
 #include "src/ast/float_literal.h"
 
-#include "gtest/gtest.h"
+#include "src/ast/test_helper.h"
 #include "src/ast/type/f32_type.h"
 
 namespace tint {
 namespace ast {
 namespace {
 
-using FloatLiteralTest = testing::Test;
+using FloatLiteralTest = TestHelper;
 
 TEST_F(FloatLiteralTest, Value) {
   ast::type::F32Type f32;
diff --git a/src/ast/function_test.cc b/src/ast/function_test.cc
index 1410f57..34c01a8 100644
--- a/src/ast/function_test.cc
+++ b/src/ast/function_test.cc
@@ -14,12 +14,12 @@
 
 #include "src/ast/function.h"
 
-#include "gtest/gtest.h"
 #include "src/ast/builtin_decoration.h"
 #include "src/ast/decorated_variable.h"
 #include "src/ast/discard_statement.h"
 #include "src/ast/location_decoration.h"
 #include "src/ast/pipeline_stage.h"
+#include "src/ast/test_helper.h"
 #include "src/ast/type/f32_type.h"
 #include "src/ast/type/i32_type.h"
 #include "src/ast/type/void_type.h"
@@ -30,7 +30,7 @@
 namespace ast {
 namespace {
 
-using FunctionTest = testing::Test;
+using FunctionTest = TestHelper;
 
 TEST_F(FunctionTest, Creation) {
   type::VoidType void_type;
diff --git a/src/ast/identifier_expression_test.cc b/src/ast/identifier_expression_test.cc
index 95e0db2..7262fae 100644
--- a/src/ast/identifier_expression_test.cc
+++ b/src/ast/identifier_expression_test.cc
@@ -14,13 +14,13 @@
 
 #include "src/ast/identifier_expression.h"
 
-#include "gtest/gtest.h"
+#include "src/ast/test_helper.h"
 
 namespace tint {
 namespace ast {
 namespace {
 
-using IdentifierExpressionTest = testing::Test;
+using IdentifierExpressionTest = TestHelper;
 
 TEST_F(IdentifierExpressionTest, Creation) {
   IdentifierExpression i("ident");
diff --git a/src/ast/if_statement_test.cc b/src/ast/if_statement_test.cc
index 67597ea..e36cc1f 100644
--- a/src/ast/if_statement_test.cc
+++ b/src/ast/if_statement_test.cc
@@ -14,15 +14,15 @@
 
 #include "src/ast/if_statement.h"
 
-#include "gtest/gtest.h"
 #include "src/ast/discard_statement.h"
 #include "src/ast/identifier_expression.h"
+#include "src/ast/test_helper.h"
 
 namespace tint {
 namespace ast {
 namespace {
 
-using IfStatementTest = testing::Test;
+using IfStatementTest = TestHelper;
 
 TEST_F(IfStatementTest, Creation) {
   auto cond = std::make_unique<IdentifierExpression>("cond");
diff --git a/src/ast/int_literal_test.cc b/src/ast/int_literal_test.cc
index d4cd32b..8b2190e 100644
--- a/src/ast/int_literal_test.cc
+++ b/src/ast/int_literal_test.cc
@@ -14,8 +14,8 @@
 
 #include "src/ast/int_literal.h"
 
-#include "gtest/gtest.h"
 #include "src/ast/sint_literal.h"
+#include "src/ast/test_helper.h"
 #include "src/ast/type/i32_type.h"
 #include "src/ast/type/u32_type.h"
 #include "src/ast/uint_literal.h"
@@ -24,7 +24,7 @@
 namespace ast {
 namespace {
 
-using IntLiteralTest = testing::Test;
+using IntLiteralTest = TestHelper;
 
 TEST_F(IntLiteralTest, Sint_IsInt) {
   ast::type::I32Type i32;
diff --git a/src/ast/location_decoration_test.cc b/src/ast/location_decoration_test.cc
index e09f2eb..eec01d2 100644
--- a/src/ast/location_decoration_test.cc
+++ b/src/ast/location_decoration_test.cc
@@ -16,13 +16,13 @@
 
 #include <sstream>
 
-#include "gtest/gtest.h"
+#include "src/ast/test_helper.h"
 
 namespace tint {
 namespace ast {
 namespace {
 
-using LocationDecorationTest = testing::Test;
+using LocationDecorationTest = TestHelper;
 
 TEST_F(LocationDecorationTest, Creation) {
   LocationDecoration d{2, Source{}};
diff --git a/src/ast/loop_statement_test.cc b/src/ast/loop_statement_test.cc
index b63aaec..73f0f93 100644
--- a/src/ast/loop_statement_test.cc
+++ b/src/ast/loop_statement_test.cc
@@ -17,15 +17,15 @@
 #include <memory>
 #include <sstream>
 
-#include "gtest/gtest.h"
 #include "src/ast/discard_statement.h"
 #include "src/ast/if_statement.h"
+#include "src/ast/test_helper.h"
 
 namespace tint {
 namespace ast {
 namespace {
 
-using LoopStatementTest = testing::Test;
+using LoopStatementTest = TestHelper;
 
 TEST_F(LoopStatementTest, Creation) {
   auto body = std::make_unique<BlockStatement>();
diff --git a/src/ast/member_accessor_expression_test.cc b/src/ast/member_accessor_expression_test.cc
index aefb618..4c49327 100644
--- a/src/ast/member_accessor_expression_test.cc
+++ b/src/ast/member_accessor_expression_test.cc
@@ -16,14 +16,14 @@
 
 #include <sstream>
 
-#include "gtest/gtest.h"
 #include "src/ast/identifier_expression.h"
+#include "src/ast/test_helper.h"
 
 namespace tint {
 namespace ast {
 namespace {
 
-using MemberAccessorExpressionTest = testing::Test;
+using MemberAccessorExpressionTest = TestHelper;
 
 TEST_F(MemberAccessorExpressionTest, Creation) {
   auto str = std::make_unique<IdentifierExpression>("structure");
diff --git a/src/ast/module_test.cc b/src/ast/module_test.cc
index 0787e9e..f5fd5ae 100644
--- a/src/ast/module_test.cc
+++ b/src/ast/module_test.cc
@@ -19,6 +19,7 @@
 
 #include "gmock/gmock.h"
 #include "src/ast/function.h"
+#include "src/ast/test_helper.h"
 #include "src/ast/type/alias_type.h"
 #include "src/ast/type/f32_type.h"
 #include "src/ast/type/struct_type.h"
@@ -28,7 +29,7 @@
 namespace ast {
 namespace {
 
-using ModuleTest = testing::Test;
+using ModuleTest = TestHelper;
 
 TEST_F(ModuleTest, Creation) {
   Module m;
diff --git a/src/ast/null_literal_test.cc b/src/ast/null_literal_test.cc
index 5e48f61..2ede9c3 100644
--- a/src/ast/null_literal_test.cc
+++ b/src/ast/null_literal_test.cc
@@ -14,14 +14,14 @@
 
 #include "src/ast/null_literal.h"
 
-#include "gtest/gtest.h"
+#include "src/ast/test_helper.h"
 #include "src/ast/type/i32_type.h"
 
 namespace tint {
 namespace ast {
 namespace {
 
-using NullLiteralTest = testing::Test;
+using NullLiteralTest = TestHelper;
 
 TEST_F(NullLiteralTest, Is) {
   ast::type::I32Type i32;
diff --git a/src/ast/return_statement_test.cc b/src/ast/return_statement_test.cc
index 7ff2621..0a68f9ba 100644
--- a/src/ast/return_statement_test.cc
+++ b/src/ast/return_statement_test.cc
@@ -16,14 +16,14 @@
 
 #include <sstream>
 
-#include "gtest/gtest.h"
 #include "src/ast/identifier_expression.h"
+#include "src/ast/test_helper.h"
 
 namespace tint {
 namespace ast {
 namespace {
 
-using ReturnStatementTest = testing::Test;
+using ReturnStatementTest = TestHelper;
 
 TEST_F(ReturnStatementTest, Creation) {
   auto expr = std::make_unique<IdentifierExpression>("expr");
diff --git a/src/ast/scalar_constructor_expression_test.cc b/src/ast/scalar_constructor_expression_test.cc
index 3dc4ea5..b82dbfa 100644
--- a/src/ast/scalar_constructor_expression_test.cc
+++ b/src/ast/scalar_constructor_expression_test.cc
@@ -14,15 +14,15 @@
 
 #include "src/ast/scalar_constructor_expression.h"
 
-#include "gtest/gtest.h"
 #include "src/ast/bool_literal.h"
+#include "src/ast/test_helper.h"
 #include "src/ast/type/bool_type.h"
 
 namespace tint {
 namespace ast {
 namespace {
 
-using ScalarConstructorExpressionTest = testing::Test;
+using ScalarConstructorExpressionTest = TestHelper;
 
 TEST_F(ScalarConstructorExpressionTest, Creation) {
   ast::type::BoolType bool_type;
diff --git a/src/ast/set_decoration_test.cc b/src/ast/set_decoration_test.cc
index e0782b1..acd4351 100644
--- a/src/ast/set_decoration_test.cc
+++ b/src/ast/set_decoration_test.cc
@@ -14,13 +14,13 @@
 
 #include "src/ast/set_decoration.h"
 
-#include "gtest/gtest.h"
+#include "src/ast/test_helper.h"
 
 namespace tint {
 namespace ast {
 namespace {
 
-using SetDecorationTest = testing::Test;
+using SetDecorationTest = TestHelper;
 
 TEST_F(SetDecorationTest, Creation) {
   SetDecoration d{2, Source{}};
diff --git a/src/ast/sint_literal_test.cc b/src/ast/sint_literal_test.cc
index 907c5b3..9e42a5c 100644
--- a/src/ast/sint_literal_test.cc
+++ b/src/ast/sint_literal_test.cc
@@ -14,7 +14,7 @@
 
 #include "src/ast/sint_literal.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"
 
@@ -22,7 +22,7 @@
 namespace ast {
 namespace {
 
-using SintLiteralTest = testing::Test;
+using SintLiteralTest = TestHelper;
 
 TEST_F(SintLiteralTest, Value) {
   ast::type::I32Type i32;
diff --git a/src/ast/stage_decoration_test.cc b/src/ast/stage_decoration_test.cc
index 19729c0..c60aff3 100644
--- a/src/ast/stage_decoration_test.cc
+++ b/src/ast/stage_decoration_test.cc
@@ -16,13 +16,13 @@
 
 #include <sstream>
 
-#include "gtest/gtest.h"
+#include "src/ast/test_helper.h"
 
 namespace tint {
 namespace ast {
 namespace {
 
-using StageDecorationTest = testing::Test;
+using StageDecorationTest = TestHelper;
 
 TEST_F(StageDecorationTest, Creation_1param) {
   StageDecoration d{ast::PipelineStage::kFragment, Source{}};
diff --git a/src/ast/stride_decoration_test.cc b/src/ast/stride_decoration_test.cc
index ac378e8..4a1088c 100644
--- a/src/ast/stride_decoration_test.cc
+++ b/src/ast/stride_decoration_test.cc
@@ -14,13 +14,13 @@
 
 #include "src/ast/stride_decoration.h"
 
-#include "gtest/gtest.h"
+#include "src/ast/test_helper.h"
 
 namespace tint {
 namespace ast {
 namespace {
 
-using StrideDecorationTest = testing::Test;
+using StrideDecorationTest = TestHelper;
 
 TEST_F(StrideDecorationTest, Creation) {
   StrideDecoration d{2, Source{}};
diff --git a/src/ast/struct_member_offset_decoration_test.cc b/src/ast/struct_member_offset_decoration_test.cc
index efa4698..fb96a3b 100644
--- a/src/ast/struct_member_offset_decoration_test.cc
+++ b/src/ast/struct_member_offset_decoration_test.cc
@@ -14,13 +14,13 @@
 
 #include "src/ast/struct_member_offset_decoration.h"
 
-#include "gtest/gtest.h"
+#include "src/ast/test_helper.h"
 
 namespace tint {
 namespace ast {
 namespace {
 
-using StructMemberOffsetDecorationTest = testing::Test;
+using StructMemberOffsetDecorationTest = TestHelper;
 
 TEST_F(StructMemberOffsetDecorationTest, Creation) {
   StructMemberOffsetDecoration d{2, Source{}};
diff --git a/src/ast/struct_member_test.cc b/src/ast/struct_member_test.cc
index 322f52a..20912bc 100644
--- a/src/ast/struct_member_test.cc
+++ b/src/ast/struct_member_test.cc
@@ -17,15 +17,15 @@
 #include <sstream>
 #include <utility>
 
-#include "gtest/gtest.h"
 #include "src/ast/struct_member_offset_decoration.h"
+#include "src/ast/test_helper.h"
 #include "src/ast/type/i32_type.h"
 
 namespace tint {
 namespace ast {
 namespace {
 
-using StructMemberTest = testing::Test;
+using StructMemberTest = TestHelper;
 
 TEST_F(StructMemberTest, Creation) {
   type::I32Type i32;
diff --git a/src/ast/struct_test.cc b/src/ast/struct_test.cc
index 475d6b6..540a4a8 100644
--- a/src/ast/struct_test.cc
+++ b/src/ast/struct_test.cc
@@ -18,16 +18,16 @@
 #include <sstream>
 #include <utility>
 
-#include "gtest/gtest.h"
 #include "src/ast/struct_block_decoration.h"
 #include "src/ast/struct_member.h"
+#include "src/ast/test_helper.h"
 #include "src/ast/type/i32_type.h"
 
 namespace tint {
 namespace ast {
 namespace {
 
-using StructTest = testing::Test;
+using StructTest = TestHelper;
 
 TEST_F(StructTest, Creation) {
   type::I32Type i32;
diff --git a/src/ast/switch_statement_test.cc b/src/ast/switch_statement_test.cc
index 52774c6..4b78e79 100644
--- a/src/ast/switch_statement_test.cc
+++ b/src/ast/switch_statement_test.cc
@@ -16,17 +16,17 @@
 
 #include <sstream>
 
-#include "gtest/gtest.h"
 #include "src/ast/case_statement.h"
 #include "src/ast/identifier_expression.h"
 #include "src/ast/sint_literal.h"
+#include "src/ast/test_helper.h"
 #include "src/ast/type/i32_type.h"
 
 namespace tint {
 namespace ast {
 namespace {
 
-using SwitchStatementTest = testing::Test;
+using SwitchStatementTest = TestHelper;
 
 TEST_F(SwitchStatementTest, Creation) {
   ast::type::I32Type i32;
diff --git a/src/ast/test_helper.h b/src/ast/test_helper.h
new file mode 100644
index 0000000..a00623f
--- /dev/null
+++ b/src/ast/test_helper.h
@@ -0,0 +1,38 @@
+// Copyright 2020 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef SRC_AST_TEST_HELPER_H_
+#define SRC_AST_TEST_HELPER_H_
+
+#include "gtest/gtest.h"
+
+namespace tint {
+namespace ast {
+
+/// Helper class for testing
+template <typename BASE>
+class TestHelperBase : public BASE {
+ public:
+  TestHelperBase() {}
+  ~TestHelperBase() = default;
+};
+using TestHelper = TestHelperBase<testing::Test>;
+
+template <typename T>
+using TestParamHelper = TestHelperBase<testing::TestWithParam<T>>;
+
+}  // namespace ast
+}  // namespace tint
+
+#endif  // SRC_AST_TEST_HELPER_H_
diff --git a/src/ast/type_constructor_expression_test.cc b/src/ast/type_constructor_expression_test.cc
index a65a343..c3df0fb 100644
--- a/src/ast/type_constructor_expression_test.cc
+++ b/src/ast/type_constructor_expression_test.cc
@@ -17,9 +17,9 @@
 #include <memory>
 #include <sstream>
 
-#include "gtest/gtest.h"
 #include "src/ast/constructor_expression.h"
 #include "src/ast/identifier_expression.h"
+#include "src/ast/test_helper.h"
 #include "src/ast/type/f32_type.h"
 #include "src/ast/type/vector_type.h"
 
@@ -27,7 +27,7 @@
 namespace ast {
 namespace {
 
-using TypeConstructorExpressionTest = testing::Test;
+using TypeConstructorExpressionTest = TestHelper;
 
 TEST_F(TypeConstructorExpressionTest, Creation) {
   type::F32Type f32;
diff --git a/src/ast/uint_literal_test.cc b/src/ast/uint_literal_test.cc
index 5fab748..df60554 100644
--- a/src/ast/uint_literal_test.cc
+++ b/src/ast/uint_literal_test.cc
@@ -14,14 +14,14 @@
 
 #include "src/ast/uint_literal.h"
 
-#include "gtest/gtest.h"
+#include "src/ast/test_helper.h"
 #include "src/ast/type/u32_type.h"
 
 namespace tint {
 namespace ast {
 namespace {
 
-using UintLiteralTest = testing::Test;
+using UintLiteralTest = TestHelper;
 
 TEST_F(UintLiteralTest, Value) {
   ast::type::U32Type u32;
diff --git a/src/ast/unary_op_expression_test.cc b/src/ast/unary_op_expression_test.cc
index da018c0..b23fa61 100644
--- a/src/ast/unary_op_expression_test.cc
+++ b/src/ast/unary_op_expression_test.cc
@@ -16,14 +16,14 @@
 
 #include <sstream>
 
-#include "gtest/gtest.h"
 #include "src/ast/identifier_expression.h"
+#include "src/ast/test_helper.h"
 
 namespace tint {
 namespace ast {
 namespace {
 
-using UnaryOpExpressionTest = testing::Test;
+using UnaryOpExpressionTest = TestHelper;
 
 TEST_F(UnaryOpExpressionTest, Creation) {
   auto ident = std::make_unique<IdentifierExpression>("ident");
diff --git a/src/ast/variable_decl_statement_test.cc b/src/ast/variable_decl_statement_test.cc
index 60832d0..7a104d0 100644
--- a/src/ast/variable_decl_statement_test.cc
+++ b/src/ast/variable_decl_statement_test.cc
@@ -14,7 +14,7 @@
 
 #include "src/ast/variable_decl_statement.h"
 
-#include "gtest/gtest.h"
+#include "src/ast/test_helper.h"
 #include "src/ast/type/f32_type.h"
 #include "src/ast/variable.h"
 
@@ -22,7 +22,7 @@
 namespace ast {
 namespace {
 
-using VariableDeclStatementTest = testing::Test;
+using VariableDeclStatementTest = TestHelper;
 
 TEST_F(VariableDeclStatementTest, Creation) {
   type::F32Type f32;
diff --git a/src/ast/variable_test.cc b/src/ast/variable_test.cc
index 3b0f845..4898d6b 100644
--- a/src/ast/variable_test.cc
+++ b/src/ast/variable_test.cc
@@ -14,8 +14,8 @@
 
 #include "src/ast/variable.h"
 
-#include "gtest/gtest.h"
 #include "src/ast/identifier_expression.h"
+#include "src/ast/test_helper.h"
 #include "src/ast/type/f32_type.h"
 #include "src/ast/type/i32_type.h"
 
@@ -23,7 +23,7 @@
 namespace ast {
 namespace {
 
-using VariableTest = testing::Test;
+using VariableTest = TestHelper;
 
 TEST_F(VariableTest, Creation) {
   type::I32Type t;
diff --git a/src/ast/workgroup_decoration_test.cc b/src/ast/workgroup_decoration_test.cc
index edcbe6e..72d9934 100644
--- a/src/ast/workgroup_decoration_test.cc
+++ b/src/ast/workgroup_decoration_test.cc
@@ -16,13 +16,13 @@
 
 #include <sstream>
 
-#include "gtest/gtest.h"
+#include "src/ast/test_helper.h"
 
 namespace tint {
 namespace ast {
 namespace {
 
-using WorkgroupDecorationTest = testing::Test;
+using WorkgroupDecorationTest = TestHelper;
 
 TEST_F(WorkgroupDecorationTest, Creation_1param) {
   WorkgroupDecoration d{2, Source{}};