Commit b2272496 authored by bmeurer@chromium.org's avatar bmeurer@chromium.org

[turbofan] Merge compiler unit tests into src.

BUG=v8:3489
LOG=n
R=svenpanne@chromium.org

Review URL: https://codereview.chromium.org/530693002

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@23551 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 40da0e5e
......@@ -10,11 +10,11 @@
'dependencies': [
'../samples/samples.gyp:*',
'../src/base/base.gyp:base-unittests',
'../src/compiler/compiler.gyp:compiler-unittests',
'../src/d8.gyp:d8',
'../src/heap/heap.gyp:heap-unittests',
'../src/libplatform/libplatform.gyp:libplatform-unittests',
'../test/cctest/cctest.gyp:*',
'../test/compiler-unittests/compiler-unittests.gyp:*',
],
'conditions': [
['component!="shared_library"', {
......
# TODO(bmeurer): Temporary work-around, will be fixed soonish.
include_rules = [
"+include/libplatform/libplatform.h"
]
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "test/compiler-unittests/instruction-selector-unittest.h"
#include "src/compiler/instruction-selector-unittest.h"
namespace v8 {
namespace internal {
......
......@@ -4,7 +4,7 @@
#include <list>
#include "test/compiler-unittests/instruction-selector-unittest.h"
#include "src/compiler/instruction-selector-unittest.h"
namespace v8 {
namespace internal {
......
......@@ -3,11 +3,11 @@
// found in the LICENSE file.
#include "src/compiler/change-lowering.h"
#include "src/compiler/graph-unittest.h"
#include "src/compiler/js-graph.h"
#include "src/compiler/node-properties-inl.h"
#include "src/compiler/simplified-operator.h"
#include "src/compiler/typer.h"
#include "test/compiler-unittests/graph-unittest.h"
#include "testing/gmock-support.h"
using testing::_;
......
......@@ -2,21 +2,31 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "test/compiler-unittests/common-operator-unittest.h"
#include "src/compiler/common-operator.h"
#include "src/compiler/compiler-unittests.h"
#include "src/compiler/operator-properties-inl.h"
namespace v8 {
namespace internal {
namespace compiler {
static const int kArguments[] = {1, 5, 6, 42, 100, 10000, kMaxInt};
namespace {
class CommonOperatorTest : public CompilerTest {
public:
CommonOperatorTest() : common_(zone()) {}
virtual ~CommonOperatorTest() {}
CommonOperatorBuilder* common() { return &common_; }
private:
CommonOperatorBuilder common_;
};
CommonOperatorTest::CommonOperatorTest() : common_(zone()) {}
const int kArguments[] = {1, 5, 6, 42, 100, 10000, kMaxInt};
CommonOperatorTest::~CommonOperatorTest() {}
} // namespace
TEST_F(CommonOperatorTest, ControlEffect) {
......
......@@ -3,8 +3,8 @@
// found in the LICENSE file.
#include "include/libplatform/libplatform.h"
#include "src/compiler/compiler-unittests.h"
#include "src/isolate-inl.h"
#include "test/compiler-unittests/compiler-unittests.h"
#include "testing/gmock/include/gmock/gmock.h"
using testing::IsNull;
......@@ -79,7 +79,7 @@ class CompilerTestEnvironment V8_FINAL : public ::testing::Environment {
v8::Platform* platform_;
};
}
} // namespace
int main(int argc, char** argv) {
......
......@@ -11,6 +11,11 @@
namespace v8 {
namespace internal {
// Forward declarations.
class Factory;
namespace compiler {
// The TARGET_TEST(Case, Name) macro works just like
......
......@@ -22,11 +22,12 @@
'sources': [ ### gcmole(all) ###
'change-lowering-unittest.cc',
'common-operator-unittest.cc',
'common-operator-unittest.h',
'compiler-unittests.cc',
'compiler-unittests.h',
'graph-unittest.cc',
'graph-unittest.h',
'instruction-selector-unittest.cc',
'instruction-selector-unittest.h',
'machine-operator-reducer-unittest.cc',
'machine-operator-unittest.cc',
'simplified-operator-reducer-unittest.cc',
......
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "test/compiler-unittests/graph-unittest.h"
#include "src/compiler/graph-unittest.h"
#include <ostream> // NOLINT(readability/streams)
......@@ -32,7 +32,7 @@ inline std::ostream& operator<<(std::ostream& os,
namespace compiler {
GraphTest::GraphTest(int num_parameters) : graph_(zone()) {
GraphTest::GraphTest(int num_parameters) : common_(zone()), graph_(zone()) {
graph()->SetStart(graph()->NewNode(common()->Start(num_parameters)));
}
......
......@@ -2,12 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef V8_COMPILER_UNITTESTS_GRAPH_UNITTEST_H_
#define V8_COMPILER_UNITTESTS_GRAPH_UNITTEST_H_
#ifndef V8_COMPILER_GRAPH_UNITTEST_H_
#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 "test/compiler-unittests/common-operator-unittest.h"
#include "testing/gmock/include/gmock/gmock.h"
namespace v8 {
......@@ -23,7 +24,7 @@ namespace compiler {
using ::testing::Matcher;
class GraphTest : public CommonOperatorTest {
class GraphTest : public CompilerTest {
public:
explicit GraphTest(int parameters = 1);
virtual ~GraphTest();
......@@ -41,9 +42,11 @@ class GraphTest : public CommonOperatorTest {
Matcher<Node*> IsFalseConstant();
Matcher<Node*> IsTrueConstant();
CommonOperatorBuilder* common() { return &common_; }
Graph* graph() { return &graph_; }
private:
CommonOperatorBuilder common_;
Graph graph_;
};
......@@ -125,4 +128,4 @@ Matcher<Node*> IsTruncateInt64ToInt32(const Matcher<Node*>& input_matcher);
} // namespace internal
} // namespace v8
#endif // V8_COMPILER_UNITTESTS_GRAPH_UNITTEST_H_
#endif // V8_COMPILER_GRAPH_UNITTEST_H_
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "test/compiler-unittests/instruction-selector-unittest.h"
#include "src/compiler/instruction-selector-unittest.h"
namespace v8 {
namespace internal {
......
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "test/compiler-unittests/instruction-selector-unittest.h"
#include "src/compiler/instruction-selector-unittest.h"
#include "src/flags.h"
......
......@@ -2,16 +2,16 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef V8_COMPILER_UNITTESTS_INSTRUCTION_SELECTOR_UNITTEST_H_
#define V8_COMPILER_UNITTESTS_INSTRUCTION_SELECTOR_UNITTEST_H_
#ifndef V8_COMPILER_INSTRUCTION_SELECTOR_UNITTEST_H_
#define V8_COMPILER_INSTRUCTION_SELECTOR_UNITTEST_H_
#include <deque>
#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 "test/compiler-unittests/compiler-unittests.h"
namespace v8 {
namespace internal {
......@@ -199,4 +199,4 @@ class InstructionSelectorTestWithParam
} // namespace internal
} // namespace v8
#endif // V8_COMPILER_UNITTESTS_INSTRUCTION_SELECTOR_UNITTEST_H_
#endif // V8_COMPILER_INSTRUCTION_SELECTOR_UNITTEST_H_
......@@ -3,8 +3,8 @@
// found in the LICENSE file.
#include "src/base/bits.h"
#include "src/compiler/graph-unittest.h"
#include "src/compiler/machine-operator-reducer.h"
#include "test/compiler-unittests/graph-unittest.h"
namespace v8 {
namespace internal {
......
......@@ -2,9 +2,9 @@
// 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 "test/compiler-unittests/compiler-unittests.h"
#include "testing/gmock/include/gmock/gmock.h"
using testing::IsNull;
......
......@@ -2,12 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/compiler/graph-unittest.h"
#include "src/compiler/js-graph.h"
#include "src/compiler/simplified-operator.h"
#include "src/compiler/simplified-operator-reducer.h"
#include "src/compiler/typer.h"
#include "src/conversions.h"
#include "test/compiler-unittests/graph-unittest.h"
namespace v8 {
namespace internal {
......
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "test/compiler-unittests/instruction-selector-unittest.h"
#include "src/compiler/instruction-selector-unittest.h"
namespace v8 {
namespace internal {
......
include_rules = [
"+src",
"+testing/gtest",
"+testing/gtest-support.h",
"+testing/gmock",
"+testing/gmock-support.h",
]
// 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_COMMON_OPERATOR_UNITTEST_H_
#define V8_COMPILER_UNITTESTS_COMMON_OPERATOR_UNITTEST_H_
#include "src/compiler/common-operator.h"
#include "test/compiler-unittests/compiler-unittests.h"
namespace v8 {
namespace internal {
namespace compiler {
class CommonOperatorTest : public CompilerTest {
public:
CommonOperatorTest();
virtual ~CommonOperatorTest();
protected:
CommonOperatorBuilder* common() { return &common_; }
private:
CommonOperatorBuilder common_;
};
} // namespace compiler
} // namespace internal
} // namespace v8
#endif // V8_COMPILER_UNITTESTS_COMMON_OPERATOR_UNITTEST_H_
......@@ -236,9 +236,7 @@ class CppLintProcessor(SourceFileProcessor):
or (name in CppLintProcessor.IGNORE_LINT))
def GetPathsToSearch(self):
return ['src', 'include', 'samples',
join('test', 'cctest'),
join('test', 'compiler-unittests')]
return ['src', 'include', 'samples', join('test', 'cctest')]
def GetCpplintScript(self, prio_path):
for path in [prio_path] + os.environ["PATH"].split(os.pathsep):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment