Revision: 23673
Author:   [email protected]
Date:     Thu Sep  4 08:44:03 2014 UTC
Log:      Refactor common unit test code.

TEST=compiler-unittests
BUG=v8:3489
LOG=n
[email protected]

Review URL: https://codereview.chromium.org/540823002
https://code.google.com/p/v8/source/detail?r=23673

Added:
 /branches/bleeding_edge/src/compiler/compiler-test-utils.h
 /branches/bleeding_edge/src/test
 /branches/bleeding_edge/src/test/DEPS
 /branches/bleeding_edge/src/test/run-all-unittests.cc
 /branches/bleeding_edge/src/test/test-utils.cc
 /branches/bleeding_edge/src/test/test-utils.h
 /branches/bleeding_edge/src/test/test.gyp
Deleted:
 /branches/bleeding_edge/src/compiler/DEPS
 /branches/bleeding_edge/src/compiler/compiler-unittests.cc
 /branches/bleeding_edge/src/compiler/compiler-unittests.h
Modified:
 /branches/bleeding_edge/src/compiler/change-lowering-unittest.cc
 /branches/bleeding_edge/src/compiler/common-operator-unittest.cc
 /branches/bleeding_edge/src/compiler/compiler.gyp
 /branches/bleeding_edge/src/compiler/graph-unittest.h
 /branches/bleeding_edge/src/compiler/instruction-selector-unittest.cc
 /branches/bleeding_edge/src/compiler/instruction-selector-unittest.h
 /branches/bleeding_edge/src/compiler/machine-operator-reducer-unittest.cc
 /branches/bleeding_edge/src/compiler/machine-operator-unittest.cc
 /branches/bleeding_edge/testing/gmock.gyp

=======================================
--- /dev/null
+++ /branches/bleeding_edge/src/compiler/compiler-test-utils.h Thu Sep 4 08:44:03 2014 UTC
@@ -0,0 +1,57 @@
+// Copyright 2014 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef V8_COMPILER_COMPILER_TEST_UTILS_H_
+#define V8_COMPILER_COMPILER_TEST_UTILS_H_
+
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace v8 {
+namespace internal {
+namespace compiler {
+
+// The TARGET_TEST(Case, Name) macro works just like
+// TEST(Case, Name), except that the test is disabled
+// if the platform is not a supported TurboFan target.
+#if V8_TURBOFAN_TARGET
+#define TARGET_TEST(Case, Name) TEST(Case, Name)
+#else
+#define TARGET_TEST(Case, Name) TEST(Case, DISABLED_##Name)
+#endif
+
+
+// The TARGET_TEST_F(Case, Name) macro works just like
+// TEST_F(Case, Name), except that the test is disabled
+// if the platform is not a supported TurboFan target.
+#if V8_TURBOFAN_TARGET
+#define TARGET_TEST_F(Case, Name) TEST_F(Case, Name)
+#else
+#define TARGET_TEST_F(Case, Name) TEST_F(Case, DISABLED_##Name)
+#endif
+
+
+// The TARGET_TEST_P(Case, Name) macro works just like
+// TEST_P(Case, Name), except that the test is disabled
+// if the platform is not a supported TurboFan target.
+#if V8_TURBOFAN_TARGET
+#define TARGET_TEST_P(Case, Name) TEST_P(Case, Name)
+#else
+#define TARGET_TEST_P(Case, Name) TEST_P(Case, DISABLED_##Name)
+#endif
+
+
+// The TARGET_TYPED_TEST(Case, Name) macro works just like
+// TYPED_TEST(Case, Name), except that the test is disabled
+// if the platform is not a supported TurboFan target.
+#if V8_TURBOFAN_TARGET
+#define TARGET_TYPED_TEST(Case, Name) TYPED_TEST(Case, Name)
+#else
+#define TARGET_TYPED_TEST(Case, Name) TYPED_TEST(Case, DISABLED_##Name)
+#endif
+
+}  // namespace compiler
+}  // namespace internal
+}  // namespace v8
+
+#endif  // V8_COMPILER_COMPILER_TEST_UTILS_H_
=======================================
--- /dev/null
+++ /branches/bleeding_edge/src/test/DEPS       Thu Sep  4 08:44:03 2014 UTC
@@ -0,0 +1,3 @@
+include_rules = [
+  "+include/libplatform/libplatform.h"
+]
=======================================
--- /dev/null
+++ /branches/bleeding_edge/src/test/run-all-unittests.cc Thu Sep 4 08:44:03 2014 UTC
@@ -0,0 +1,45 @@
+// Copyright 2014 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "include/libplatform/libplatform.h"
+#include "include/v8.h"
+#include "src/base/compiler-specific.h"
+#include "testing/gmock/include/gmock/gmock.h"
+
+namespace {
+
+class DefaultPlatformEnvironment FINAL : public ::testing::Environment {
+ public:
+  DefaultPlatformEnvironment() : platform_(NULL) {}
+  ~DefaultPlatformEnvironment() {}
+
+  virtual void SetUp() OVERRIDE {
+    EXPECT_EQ(NULL, platform_);
+    platform_ = v8::platform::CreateDefaultPlatform();
+    ASSERT_TRUE(platform_ != NULL);
+    v8::V8::InitializePlatform(platform_);
+    ASSERT_TRUE(v8::V8::Initialize());
+  }
+
+  virtual void TearDown() OVERRIDE {
+    ASSERT_TRUE(platform_ != NULL);
+    v8::V8::Dispose();
+    v8::V8::ShutdownPlatform();
+    delete platform_;
+    platform_ = NULL;
+  }
+
+ private:
+  v8::Platform* platform_;
+};
+
+}  // namespace
+
+
+int main(int argc, char** argv) {
+  testing::InitGoogleMock(&argc, argv);
+  testing::AddGlobalTestEnvironment(new DefaultPlatformEnvironment);
+  v8::V8::SetFlagsFromCommandLine(&argc, argv, true);
+  return RUN_ALL_TESTS();
+}
=======================================
--- /dev/null
+++ /branches/bleeding_edge/src/test/test-utils.cc Thu Sep 4 08:44:03 2014 UTC
@@ -0,0 +1,58 @@
+// Copyright 2014 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "src/test/test-utils.h"
+
+#include "src/isolate-inl.h"
+
+namespace v8 {
+
+// static
+Isolate* TestWithIsolate::isolate_ = NULL;
+
+
+TestWithIsolate::TestWithIsolate()
+    : isolate_scope_(isolate()), handle_scope_(isolate()) {}
+
+
+TestWithIsolate::~TestWithIsolate() {}
+
+
+// static
+void TestWithIsolate::SetUpTestCase() {
+  Test::SetUpTestCase();
+  EXPECT_EQ(NULL, isolate_);
+  isolate_ = v8::Isolate::New();
+  EXPECT_TRUE(isolate_ != NULL);
+}
+
+
+// static
+void TestWithIsolate::TearDownTestCase() {
+  ASSERT_TRUE(isolate_ != NULL);
+  isolate_->Dispose();
+  isolate_ = NULL;
+  Test::TearDownTestCase();
+}
+
+
+TestWithContext::TestWithContext()
+    : context_(Context::New(isolate())), context_scope_(context_) {}
+
+
+TestWithContext::~TestWithContext() {}
+
+
+namespace internal {
+
+TestWithIsolate::~TestWithIsolate() {}
+
+
+Factory* TestWithIsolate::factory() const { return isolate()->factory(); }
+
+
+TestWithZone::~TestWithZone() {}
+
+}  // namespace internal
+}  // namespace v8
=======================================
--- /dev/null
+++ /branches/bleeding_edge/src/test/test-utils.h Thu Sep 4 08:44:03 2014 UTC
@@ -0,0 +1,86 @@
+// Copyright 2014 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef V8_TEST_TEST_UTILS_H_
+#define V8_TEST_TEST_UTILS_H_
+
+#include "include/v8.h"
+#include "src/base/macros.h"
+#include "src/zone.h"
+#include "testing/gtest-support.h"
+
+namespace v8 {
+
+class TestWithIsolate : public ::testing::Test {
+ public:
+  TestWithIsolate();
+  virtual ~TestWithIsolate();
+
+  Isolate* isolate() const { return isolate_; }
+
+  static void SetUpTestCase();
+  static void TearDownTestCase();
+
+ private:
+  static Isolate* isolate_;
+  Isolate::Scope isolate_scope_;
+  HandleScope handle_scope_;
+
+  DISALLOW_COPY_AND_ASSIGN(TestWithIsolate);
+};
+
+
+class TestWithContext : public virtual TestWithIsolate {
+ public:
+  TestWithContext();
+  virtual ~TestWithContext();
+
+  const Local<Context>& context() const { return context_; }
+
+ private:
+  Local<Context> context_;
+  Context::Scope context_scope_;
+
+  DISALLOW_COPY_AND_ASSIGN(TestWithContext);
+};
+
+
+namespace internal {
+
+// Forward declarations.
+class Factory;
+
+
+class TestWithIsolate : public virtual ::v8::TestWithIsolate {
+ public:
+  TestWithIsolate() {}
+  virtual ~TestWithIsolate();
+
+  Factory* factory() const;
+  Isolate* isolate() const {
+    return reinterpret_cast<Isolate*>(::v8::TestWithIsolate::isolate());
+  }
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(TestWithIsolate);
+};
+
+
+class TestWithZone : public TestWithIsolate {
+ public:
+  TestWithZone() : zone_(isolate()) {}
+  virtual ~TestWithZone();
+
+  Zone* zone() { return &zone_; }
+
+ private:
+  Zone zone_;
+
+  DISALLOW_COPY_AND_ASSIGN(TestWithZone);
+};
+
+}  // namespace internal
+}  // namespace v8
+
+#endif  // V8_TEST_TEST_UTILS_H_
=======================================
--- /dev/null
+++ /branches/bleeding_edge/src/test/test.gyp   Thu Sep  4 08:44:03 2014 UTC
@@ -0,0 +1,71 @@
+# Copyright 2014 the V8 project authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+{
+  'variables': {
+    'v8_code': 1,
+  },
+  'includes': ['../../build/toolchain.gypi', '../../build/features.gypi'],
+  'targets': [
+    {
+      'target_name': 'run-all-unittests',
+      'type': 'static_library',
+      'variables': {
+        'optimize': 'max',
+      },
+      'dependencies': [
+        '../../testing/gmock.gyp:gmock',
+        '../../testing/gtest.gyp:gtest',
+        '../../tools/gyp/v8.gyp:v8_libplatform',
+      ],
+      'include_dirs': [
+        '../..',
+      ],
+      'sources': [  ### gcmole(all) ###
+        'run-all-unittests.cc',
+        'test-utils.h',
+        'test-utils.cc',
+      ],
+      'export_dependent_settings': [
+        '../../testing/gmock.gyp:gmock',
+        '../../testing/gtest.gyp:gtest',
+      ],
+      'conditions': [
+        ['component=="shared_library"', {
+ # compiler-unittests can't be built against a shared library, so we
+          # need to depend on the underlying static target in that case.
+          'conditions': [
+            ['v8_use_snapshot=="true"', {
+              'dependencies': ['../../tools/gyp/v8.gyp:v8_snapshot'],
+            },
+            {
+              'dependencies': [
+                '../../tools/gyp/v8.gyp:v8_nosnapshot',
+              ],
+            }],
+          ],
+        }, {
+          'dependencies': ['../../tools/gyp/v8.gyp:v8'],
+        }],
+        ['os_posix == 1', {
+ # TODO(svenpanne): This is a temporary work-around to fix the warnings
+          # that show up because we use -std=gnu++0x instead of -std=c++11.
+          'cflags!': [
+            '-pedantic',
+          ],
+          'direct_dependent_settings': {
+            'cflags!': [
+              '-pedantic',
+            ],
+          },
+        }],
+        ['want_separate_host_toolset==1', {
+          'toolsets': ['host', 'target'],
+        }, {
+          'toolsets': ['target'],
+        }],
+      ],
+    },
+  ],
+}
=======================================
--- /branches/bleeding_edge/src/compiler/DEPS   Mon Sep  1 10:26:12 2014 UTC
+++ /dev/null
@@ -1,4 +0,0 @@
-# TODO(bmeurer): Temporary work-around, will be fixed soonish.
-include_rules = [
-  "+include/libplatform/libplatform.h"
-]
=======================================
--- /branches/bleeding_edge/src/compiler/compiler-unittests.cc Tue Sep 2 07:07:52 2014 UTC
+++ /dev/null
@@ -1,90 +0,0 @@
-// Copyright 2014 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "include/libplatform/libplatform.h"
-#include "src/compiler/compiler-unittests.h"
-#include "src/isolate-inl.h"
-#include "testing/gmock/include/gmock/gmock.h"
-
-using testing::IsNull;
-using testing::NotNull;
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-// static
-v8::Isolate* CompilerTest::isolate_ = NULL;
-
-
-CompilerTest::CompilerTest()
-    : isolate_scope_(isolate_),
-      handle_scope_(isolate_),
-      context_scope_(v8::Context::New(isolate_)),
-      zone_(isolate()) {}
-
-
-CompilerTest::~CompilerTest() {}
-
-
-Factory* CompilerTest::factory() const { return isolate()->factory(); }
-
-
-// static
-void CompilerTest::SetUpTestCase() {
-  Test::SetUpTestCase();
-  EXPECT_THAT(isolate_, IsNull());
-  isolate_ = v8::Isolate::New();
-  ASSERT_THAT(isolate_, NotNull());
-}
-
-
-// static
-void CompilerTest::TearDownTestCase() {
-  ASSERT_THAT(isolate_, NotNull());
-  isolate_->Dispose();
-  isolate_ = NULL;
-  Test::TearDownTestCase();
-}
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
-
-
-namespace {
-
-class CompilerTestEnvironment FINAL : public ::testing::Environment {
- public:
-  CompilerTestEnvironment() : platform_(NULL) {}
-  ~CompilerTestEnvironment() {}
-
-  virtual void SetUp() OVERRIDE {
-    EXPECT_THAT(platform_, IsNull());
-    platform_ = v8::platform::CreateDefaultPlatform();
-    v8::V8::InitializePlatform(platform_);
-    ASSERT_TRUE(v8::V8::Initialize());
-  }
-
-  virtual void TearDown() OVERRIDE {
-    ASSERT_THAT(platform_, NotNull());
-    v8::V8::Dispose();
-    v8::V8::ShutdownPlatform();
-    delete platform_;
-    platform_ = NULL;
-  }
-
- private:
-  v8::Platform* platform_;
-};
-
-}  // namespace
-
-
-int main(int argc, char** argv) {
-  testing::InitGoogleMock(&argc, argv);
-  testing::AddGlobalTestEnvironment(new CompilerTestEnvironment);
-  v8::V8::SetFlagsFromCommandLine(&argc, argv, true);
-  return RUN_ALL_TESTS();
-}
=======================================
--- /branches/bleeding_edge/src/compiler/compiler-unittests.h Mon Sep 1 10:26:12 2014 UTC
+++ /dev/null
@@ -1,90 +0,0 @@
-// Copyright 2014 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_COMPILER_UNITTESTS_COMPILER_UNITTESTS_H_
-#define V8_COMPILER_UNITTESTS_COMPILER_UNITTESTS_H_
-
-#include "include/v8.h"
-#include "src/zone.h"
-#include "testing/gtest-support.h"
-
-namespace v8 {
-namespace internal {
-
-// Forward declarations.
-class Factory;
-
-
-namespace compiler {
-
-// The TARGET_TEST(Case, Name) macro works just like
-// TEST(Case, Name), except that the test is disabled
-// if the platform is not a supported TurboFan target.
-#if V8_TURBOFAN_TARGET
-#define TARGET_TEST(Case, Name) TEST(Case, Name)
-#else
-#define TARGET_TEST(Case, Name) TEST(Case, DISABLED_##Name)
-#endif
-
-
-// The TARGET_TEST_F(Case, Name) macro works just like
-// TEST_F(Case, Name), except that the test is disabled
-// if the platform is not a supported TurboFan target.
-#if V8_TURBOFAN_TARGET
-#define TARGET_TEST_F(Case, Name) TEST_F(Case, Name)
-#else
-#define TARGET_TEST_F(Case, Name) TEST_F(Case, DISABLED_##Name)
-#endif
-
-
-// The TARGET_TEST_P(Case, Name) macro works just like
-// TEST_P(Case, Name), except that the test is disabled
-// if the platform is not a supported TurboFan target.
-#if V8_TURBOFAN_TARGET
-#define TARGET_TEST_P(Case, Name) TEST_P(Case, Name)
-#else
-#define TARGET_TEST_P(Case, Name) TEST_P(Case, DISABLED_##Name)
-#endif
-
-
-// The TARGET_TYPED_TEST(Case, Name) macro works just like
-// TYPED_TEST(Case, Name), except that the test is disabled
-// if the platform is not a supported TurboFan target.
-#if V8_TURBOFAN_TARGET
-#define TARGET_TYPED_TEST(Case, Name) TYPED_TEST(Case, Name)
-#else
-#define TARGET_TYPED_TEST(Case, Name) TYPED_TEST(Case, DISABLED_##Name)
-#endif
-
-
-class CompilerTest : public ::testing::Test {
- public:
-  CompilerTest();
-  virtual ~CompilerTest();
-
-  Factory* factory() const;
-  Isolate* isolate() const { return reinterpret_cast<Isolate*>(isolate_); }
-  Zone* zone() { return &zone_; }
-
-  static void SetUpTestCase();
-  static void TearDownTestCase();
-
- private:
-  static v8::Isolate* isolate_;
-  v8::Isolate::Scope isolate_scope_;
-  v8::HandleScope handle_scope_;
-  v8::Context::Scope context_scope_;
-  Zone zone_;
-};
-
-
-template <typename T>
-class CompilerTestWithParam : public CompilerTest,
-                              public ::testing::WithParamInterface<T> {};
-
-}  // namespace compiler
-}  // namespace internal
-}  // namespace v8
-
-#endif  // V8_COMPILER_UNITTESTS_COMPILER_UNITTESTS_H_
=======================================
--- /branches/bleeding_edge/src/compiler/change-lowering-unittest.cc Tue Sep 2 07:07:52 2014 UTC +++ /branches/bleeding_edge/src/compiler/change-lowering-unittest.cc Thu Sep 4 08:44:03 2014 UTC
@@ -3,6 +3,7 @@
 // found in the LICENSE file.

 #include "src/compiler/change-lowering.h"
+#include "src/compiler/compiler-test-utils.h"
 #include "src/compiler/graph-unittest.h"
 #include "src/compiler/js-graph.h"
 #include "src/compiler/node-properties-inl.h"
=======================================
--- /branches/bleeding_edge/src/compiler/common-operator-unittest.cc Mon Sep 1 10:26:12 2014 UTC +++ /branches/bleeding_edge/src/compiler/common-operator-unittest.cc Thu Sep 4 08:44:03 2014 UTC
@@ -3,8 +3,8 @@
 // found in the LICENSE file.

 #include "src/compiler/common-operator.h"
-#include "src/compiler/compiler-unittests.h"
 #include "src/compiler/operator-properties-inl.h"
+#include "src/test/test-utils.h"

 namespace v8 {
 namespace internal {
@@ -12,7 +12,7 @@

 namespace {

-class CommonOperatorTest : public CompilerTest {
+class CommonOperatorTest : public TestWithZone {
  public:
   CommonOperatorTest() : common_(zone()) {}
   virtual ~CommonOperatorTest() {}
=======================================
--- /branches/bleeding_edge/src/compiler/compiler.gyp Mon Sep 1 10:26:12 2014 UTC +++ /branches/bleeding_edge/src/compiler/compiler.gyp Thu Sep 4 08:44:03 2014 UTC
@@ -12,9 +12,7 @@
       'target_name': 'compiler-unittests',
       'type': 'executable',
       'dependencies': [
-        '../../testing/gmock.gyp:gmock',
-        '../../testing/gtest.gyp:gtest',
-        '../../tools/gyp/v8.gyp:v8_libplatform',
+        '../test/test.gyp:run-all-unittests',
       ],
       'include_dirs': [
         '../..',
@@ -22,8 +20,7 @@
       'sources': [  ### gcmole(all) ###
         'change-lowering-unittest.cc',
         'common-operator-unittest.cc',
-        'compiler-unittests.cc',
-        'compiler-unittests.h',
+        'compiler-test-utils.h',
         'graph-unittest.cc',
         'graph-unittest.h',
         'instruction-selector-unittest.cc',
@@ -53,29 +50,6 @@
             'x64/instruction-selector-x64-unittest.cc',
           ],
         }],
-        ['component=="shared_library"', {
- # compiler-unittests can't be built against a shared library, so we
-          # need to depend on the underlying static target in that case.
-          'conditions': [
-            ['v8_use_snapshot=="true"', {
-              'dependencies': ['../../tools/gyp/v8.gyp:v8_snapshot'],
-            },
-            {
-              'dependencies': [
-                '../../tools/gyp/v8.gyp:v8_nosnapshot',
-              ],
-            }],
-          ],
-        }, {
-          'dependencies': ['../../tools/gyp/v8.gyp:v8'],
-        }],
-        ['os_posix == 1', {
- # TODO(svenpanne): This is a temporary work-around to fix the warnings
-          # that show up because we use -std=gnu++0x instead of -std=c++11.
-          'cflags!': [
-            '-pedantic',
-          ],
-        }],
       ],
     },
   ],
=======================================
--- /branches/bleeding_edge/src/compiler/graph-unittest.h Mon Sep 1 10:26:12 2014 UTC +++ /branches/bleeding_edge/src/compiler/graph-unittest.h Thu Sep 4 08:44:03 2014 UTC
@@ -6,9 +6,9 @@
 #define V8_COMPILER_GRAPH_UNITTEST_H_

 #include "src/compiler/common-operator.h"
-#include "src/compiler/compiler-unittests.h"
 #include "src/compiler/graph.h"
 #include "src/compiler/machine-operator.h"
+#include "src/test/test-utils.h"
 #include "testing/gmock/include/gmock/gmock.h"

 namespace v8 {
@@ -24,7 +24,7 @@
 using ::testing::Matcher;


-class GraphTest : public CompilerTest {
+class GraphTest : public TestWithContext, public TestWithZone {
  public:
   explicit GraphTest(int parameters = 1);
   virtual ~GraphTest();
=======================================
--- /branches/bleeding_edge/src/compiler/instruction-selector-unittest.cc Wed Sep 3 14:10:20 2014 UTC +++ /branches/bleeding_edge/src/compiler/instruction-selector-unittest.cc Thu Sep 4 08:44:03 2014 UTC
@@ -4,6 +4,7 @@

 #include "src/compiler/instruction-selector-unittest.h"

+#include "src/compiler/compiler-test-utils.h"
 #include "src/flags.h"

 namespace v8 {
@@ -18,6 +19,9 @@


InstructionSelectorTest::InstructionSelectorTest() : rng_(FLAG_random_seed) {}
+
+
+InstructionSelectorTest::~InstructionSelectorTest() {}


InstructionSelectorTest::Stream InstructionSelectorTest::StreamBuilder::Build(
=======================================
--- /branches/bleeding_edge/src/compiler/instruction-selector-unittest.h Wed Sep 3 10:13:21 2014 UTC +++ /branches/bleeding_edge/src/compiler/instruction-selector-unittest.h Thu Sep 4 08:44:03 2014 UTC
@@ -9,18 +9,18 @@
 #include <set>

 #include "src/base/utils/random-number-generator.h"
-#include "src/compiler/compiler-unittests.h"
 #include "src/compiler/instruction-selector.h"
 #include "src/compiler/raw-machine-assembler.h"
+#include "src/test/test-utils.h"

 namespace v8 {
 namespace internal {
 namespace compiler {

-class InstructionSelectorTest : public CompilerTest {
+class InstructionSelectorTest : public TestWithContext, public TestWithZone {
  public:
   InstructionSelectorTest();
-  virtual ~InstructionSelectorTest() {}
+  virtual ~InstructionSelectorTest();

   base::RandomNumberGenerator* rng() { return &rng_; }

=======================================
--- /branches/bleeding_edge/src/compiler/machine-operator-reducer-unittest.cc Tue Sep 2 05:08:54 2014 UTC +++ /branches/bleeding_edge/src/compiler/machine-operator-reducer-unittest.cc Thu Sep 4 08:44:03 2014 UTC
@@ -16,7 +16,6 @@
  public:
   explicit MachineOperatorReducerTest(int num_parameters = 2)
       : GraphTest(num_parameters), machine_(zone()) {}
-  virtual ~MachineOperatorReducerTest() {}

  protected:
   Reduction Reduce(Node* node) {
=======================================
--- /branches/bleeding_edge/src/compiler/machine-operator-unittest.cc Tue Sep 2 07:07:52 2014 UTC +++ /branches/bleeding_edge/src/compiler/machine-operator-unittest.cc Thu Sep 4 08:44:03 2014 UTC
@@ -2,31 +2,32 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.

-#include "src/compiler/compiler-unittests.h"
 #include "src/compiler/machine-operator.h"
 #include "src/compiler/operator-properties-inl.h"
-#include "testing/gmock/include/gmock/gmock.h"
-
-using testing::IsNull;
+#include "src/test/test-utils.h"

 namespace v8 {
 namespace internal {
 namespace compiler {

-class MachineOperatorCommonTest : public CompilerTestWithParam<MachineType> {
+class MachineOperatorCommonTest
+    : public TestWithZone,
+      public ::testing::WithParamInterface<MachineType> {
  public:
   MachineOperatorCommonTest() : machine_(NULL) {}
-  virtual ~MachineOperatorCommonTest() { EXPECT_THAT(machine_, IsNull()); }
+  virtual ~MachineOperatorCommonTest() { EXPECT_EQ(NULL, machine_); }

   virtual void SetUp() OVERRIDE {
-    CompilerTestWithParam<MachineType>::SetUp();
+    TestWithZone::SetUp();
+    EXPECT_EQ(NULL, machine_);
     machine_ = new MachineOperatorBuilder(zone(), GetParam());
   }

   virtual void TearDown() OVERRIDE {
+    ASSERT_TRUE(machine_ != NULL);
     delete machine_;
     machine_ = NULL;
-    CompilerTestWithParam<MachineType>::TearDown();
+    TestWithZone::TearDown();
   }

  protected:
=======================================
--- /branches/bleeding_edge/testing/gmock.gyp   Mon Aug 18 06:54:07 2014 UTC
+++ /branches/bleeding_edge/testing/gmock.gyp   Thu Sep  4 08:44:03 2014 UTC
@@ -47,6 +47,13 @@
       'export_dependent_settings': [
         'gtest.gyp:gtest',
       ],
+      'conditions': [
+        ['want_separate_host_toolset==1', {
+          'toolsets': ['host', 'target'],
+        }, {
+          'toolsets': ['target'],
+        }],
+      ],
     },
     {
       'target_name': 'gmock_main',

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to