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

Move unit tests to test/unittests.

As per discussion on the V8 team, this is the place we want them to live,
not following the Chrome Style Guide for this.

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

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

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24350 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent cc6fe3a9
......@@ -230,8 +230,8 @@ NACL_ARCHES = nacl_ia32 nacl_x64
# List of files that trigger Makefile regeneration:
GYPFILES = build/all.gyp build/features.gypi build/standalone.gypi \
build/toolchain.gypi samples/samples.gyp src/compiler/compiler.gyp \
src/d8.gyp test/cctest/cctest.gyp tools/gyp/v8.gyp
build/toolchain.gypi samples/samples.gyp src/d8.gyp \
test/cctest/cctest.gyp test/unittests/unittests.gyp tools/gyp/v8.gyp
# If vtunejit=on, the v8vtune.gyp will be appended.
ifeq ($(vtunejit), on)
......
......@@ -9,12 +9,9 @@
'type': 'none',
'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/unittests/unittests.gyp:*',
],
'conditions': [
['component!="shared_library"', {
......
......@@ -3,8 +3,7 @@ include_rules = [
"-src/compiler",
"+src/compiler/pipeline.h",
"-src/libplatform",
"-include/libplatform",
"+testing",
"-include/libplatform"
]
specific_include_rules = {
......
# 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': 'base-unittests',
'type': 'executable',
'dependencies': [
'../../testing/gtest.gyp:gtest',
'../../testing/gtest.gyp:gtest_main',
'../../tools/gyp/v8.gyp:v8_libbase',
],
'include_dirs': [
'../..',
],
'sources': [ ### gcmole(all) ###
'bits-unittest.cc',
'cpu-unittest.cc',
'division-by-constant-unittest.cc',
'flags-unittest.cc',
'platform/condition-variable-unittest.cc',
'platform/mutex-unittest.cc',
'platform/platform-unittest.cc',
'platform/semaphore-unittest.cc',
'platform/time-unittest.cc',
'sys-info-unittest.cc',
'utils/random-number-generator-unittest.cc',
],
'conditions': [
['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',
],
}],
],
},
],
}
# 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': 'compiler-unittests',
'type': 'executable',
'dependencies': [
'../test/test.gyp:run-all-unittests',
],
'include_dirs': [
'../..',
],
'sources': [ ### gcmole(all) ###
'change-lowering-unittest.cc',
'common-operator-unittest.cc',
'compiler-test-utils.h',
'graph-reducer-unittest.cc',
'graph-unittest.cc',
'graph-unittest.h',
'instruction-selector-unittest.cc',
'instruction-selector-unittest.h',
'js-builtin-reducer-unittest.cc',
'js-operator-unittest.cc',
'machine-operator-reducer-unittest.cc',
'machine-operator-unittest.cc',
'simplified-operator-reducer-unittest.cc',
'simplified-operator-unittest.cc',
'value-numbering-reducer-unittest.cc',
],
'conditions': [
['v8_target_arch=="arm"', {
'sources': [ ### gcmole(arch:arm) ###
'arm/instruction-selector-arm-unittest.cc',
],
}],
['v8_target_arch=="arm64"', {
'sources': [ ### gcmole(arch:arm64) ###
'arm64/instruction-selector-arm64-unittest.cc',
],
}],
['v8_target_arch=="ia32"', {
'sources': [ ### gcmole(arch:ia32) ###
'ia32/instruction-selector-ia32-unittest.cc',
],
}],
['v8_target_arch=="x64"', {
'sources': [ ### gcmole(arch:x64) ###
'x64/instruction-selector-x64-unittest.cc',
],
}],
],
},
],
}
# 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': 'heap-unittests',
'type': 'executable',
'dependencies': [
'../../testing/gtest.gyp:gtest',
'../../testing/gtest.gyp:gtest_main',
'../../tools/gyp/v8.gyp:v8_libplatform',
],
'include_dirs': [
'../..',
],
'sources': [ ### gcmole(all) ###
'gc-idle-time-handler-unittest.cc',
],
'conditions': [
['component=="shared_library"', {
# heap-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',
],
}],
],
},
],
}
# 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': 'libplatform-unittests',
'type': 'executable',
'dependencies': [
'../../testing/gtest.gyp:gtest',
'../../testing/gmock.gyp:gmock',
'../../testing/gmock.gyp:gmock_main',
'../../tools/gyp/v8.gyp:v8_libplatform',
],
'include_dirs': [
'../..',
],
'sources': [ ### gcmole(all) ###
'default-platform-unittest.cc',
'task-queue-unittest.cc',
'worker-thread-unittest.cc',
],
'conditions': [
['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',
],
}],
],
},
],
}
# 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.
[
]
# 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.
[
]
# 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_rules = [
"+include/libplatform/libplatform.h"
"+src",
"+testing"
]
......@@ -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 "src/compiler/instruction-selector-unittest.h"
#include "test/unittests/compiler/instruction-selector-unittest.h"
namespace v8 {
namespace internal {
......
......@@ -2,9 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <list>
#include "src/compiler/instruction-selector-unittest.h"
#include "test/unittests/compiler/instruction-selector-unittest.h"
namespace v8 {
namespace internal {
......@@ -1003,36 +1001,56 @@ std::ostream& operator<<(std::ostream& os, const MemoryAccess& memacc) {
static const MemoryAccess kMemoryAccesses[] = {
{kMachInt8, kArm64Ldrsb, kArm64Strb,
{-256, -255, -3, -2, -1, 0, 1, 2, 3, 255, 256, 257, 258, 1000, 1001,
2121, 2442, 4093, 4094, 4095}},
{kMachUint8, kArm64Ldrb, kArm64Strb,
{-256, -255, -3, -2, -1, 0, 1, 2, 3, 255, 256, 257, 258, 1000, 1001,
2121, 2442, 4093, 4094, 4095}},
{kMachInt16, kArm64Ldrsh, kArm64Strh,
{-256, -255, -3, -2, -1, 0, 1, 2, 3, 255, 256, 258, 260, 4096, 4098,
4100, 4242, 6786, 8188, 8190}},
{kMachUint16, kArm64Ldrh, kArm64Strh,
{-256, -255, -3, -2, -1, 0, 1, 2, 3, 255, 256, 258, 260, 4096, 4098,
4100, 4242, 6786, 8188, 8190}},
{kMachInt32, kArm64LdrW, kArm64StrW,
{-256, -255, -3, -2, -1, 0, 1, 2, 3, 255, 256, 260, 4096, 4100, 8192,
8196, 3276, 3280, 16376, 16380}},
{kMachUint32, kArm64LdrW, kArm64StrW,
{-256, -255, -3, -2, -1, 0, 1, 2, 3, 255, 256, 260, 4096, 4100, 8192,
8196, 3276, 3280, 16376, 16380}},
{kMachInt64, kArm64Ldr, kArm64Str,
{-256, -255, -3, -2, -1, 0, 1, 2, 3, 255, 256, 264, 4096, 4104, 8192,
8200, 16384, 16392, 32752, 32760}},
{kMachUint64, kArm64Ldr, kArm64Str,
{-256, -255, -3, -2, -1, 0, 1, 2, 3, 255, 256, 264, 4096, 4104, 8192,
8200, 16384, 16392, 32752, 32760}},
{kMachFloat32, kArm64LdrS, kArm64StrS,
{-256, -255, -3, -2, -1, 0, 1, 2, 3, 255, 256, 260, 4096, 4100, 8192,
8196, 3276, 3280, 16376, 16380}},
{kMachFloat64, kArm64LdrD, kArm64StrD,
{-256, -255, -3, -2, -1, 0, 1, 2, 3, 255, 256, 264, 4096, 4104, 8192,
8200, 16384, 16392, 32752, 32760}}};
{kMachInt8,
kArm64Ldrsb,
kArm64Strb,
{-256, -255, -3, -2, -1, 0, 1, 2, 3, 255, 256, 257, 258, 1000, 1001, 2121,
2442, 4093, 4094, 4095}},
{kMachUint8,
kArm64Ldrb,
kArm64Strb,
{-256, -255, -3, -2, -1, 0, 1, 2, 3, 255, 256, 257, 258, 1000, 1001, 2121,
2442, 4093, 4094, 4095}},
{kMachInt16,
kArm64Ldrsh,
kArm64Strh,
{-256, -255, -3, -2, -1, 0, 1, 2, 3, 255, 256, 258, 260, 4096, 4098, 4100,
4242, 6786, 8188, 8190}},
{kMachUint16,
kArm64Ldrh,
kArm64Strh,
{-256, -255, -3, -2, -1, 0, 1, 2, 3, 255, 256, 258, 260, 4096, 4098, 4100,
4242, 6786, 8188, 8190}},
{kMachInt32,
kArm64LdrW,
kArm64StrW,
{-256, -255, -3, -2, -1, 0, 1, 2, 3, 255, 256, 260, 4096, 4100, 8192, 8196,
3276, 3280, 16376, 16380}},
{kMachUint32,
kArm64LdrW,
kArm64StrW,
{-256, -255, -3, -2, -1, 0, 1, 2, 3, 255, 256, 260, 4096, 4100, 8192, 8196,
3276, 3280, 16376, 16380}},
{kMachInt64,
kArm64Ldr,
kArm64Str,
{-256, -255, -3, -2, -1, 0, 1, 2, 3, 255, 256, 264, 4096, 4104, 8192, 8200,
16384, 16392, 32752, 32760}},
{kMachUint64,
kArm64Ldr,
kArm64Str,
{-256, -255, -3, -2, -1, 0, 1, 2, 3, 255, 256, 264, 4096, 4104, 8192, 8200,
16384, 16392, 32752, 32760}},
{kMachFloat32,
kArm64LdrS,
kArm64StrS,
{-256, -255, -3, -2, -1, 0, 1, 2, 3, 255, 256, 260, 4096, 4100, 8192, 8196,
3276, 3280, 16376, 16380}},
{kMachFloat64,
kArm64LdrD,
kArm64StrD,
{-256, -255, -3, -2, -1, 0, 1, 2, 3, 255, 256, 264, 4096, 4104, 8192, 8200,
16384, 16392, 32752, 32760}}};
typedef InstructionSelectorTestWithParam<MemoryAccess>
......
......@@ -3,12 +3,12 @@
// 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"
#include "src/compiler/simplified-operator.h"
#include "src/compiler/typer.h"
#include "test/unittests/compiler/compiler-test-utils.h"
#include "test/unittests/compiler/graph-unittest.h"
#include "testing/gmock-support.h"
using testing::_;
......
......@@ -7,7 +7,7 @@
#include <limits>
#include "src/compiler/operator-properties-inl.h"
#include "src/test/test-utils.h"
#include "test/unittests/test-utils.h"
namespace v8 {
namespace internal {
......
......@@ -2,8 +2,8 @@
// 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_
#ifndef V8_UNITTESTS_COMPILER_COMPILER_TEST_UTILS_H_
#define V8_UNITTESTS_COMPILER_COMPILER_TEST_UTILS_H_
#include "testing/gtest/include/gtest/gtest.h"
......@@ -54,4 +54,4 @@ namespace compiler {
} // namespace internal
} // namespace v8
#endif // V8_COMPILER_COMPILER_TEST_UTILS_H_
#endif // V8_UNITTESTS_COMPILER_COMPILER_TEST_UTILS_H_
......@@ -5,7 +5,7 @@
#include "src/compiler/graph.h"
#include "src/compiler/graph-reducer.h"
#include "src/compiler/operator.h"
#include "src/test/test-utils.h"
#include "test/unittests/test-utils.h"
#include "testing/gmock/include/gmock/gmock.h"
using testing::_;
......
......@@ -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 "src/compiler/graph-unittest.h"
#include "test/unittests/compiler/graph-unittest.h"
#include <ostream> // NOLINT(readability/streams)
......@@ -122,8 +122,8 @@ class NodeMatcher : public MatcherInterface<Node*> {
*os << "is a " << IrOpcode::Mnemonic(opcode_) << " node";
}
virtual bool MatchAndExplain(Node* node, MatchResultListener* listener) const
OVERRIDE {
virtual bool MatchAndExplain(Node* node,
MatchResultListener* listener) const OVERRIDE {
if (node == NULL) {
*listener << "which is NULL";
return false;
......@@ -158,8 +158,8 @@ class IsBranchMatcher FINAL : public NodeMatcher {
*os << ")";
}
virtual bool MatchAndExplain(Node* node, MatchResultListener* listener) const
OVERRIDE {
virtual bool MatchAndExplain(Node* node,
MatchResultListener* listener) const OVERRIDE {
return (NodeMatcher::MatchAndExplain(node, listener) &&
PrintMatchAndExplain(NodeProperties::GetValueInput(node, 0),
"value", value_matcher_, listener) &&
......@@ -190,8 +190,8 @@ class IsMergeMatcher FINAL : public NodeMatcher {
*os << ")";
}
virtual bool MatchAndExplain(Node* node, MatchResultListener* listener) const
OVERRIDE {
virtual bool MatchAndExplain(Node* node,
MatchResultListener* listener) const OVERRIDE {
return (NodeMatcher::MatchAndExplain(node, listener) &&
PrintMatchAndExplain(NodeProperties::GetControlInput(node, 0),
"control0", control0_matcher_, listener) &&
......@@ -218,8 +218,8 @@ class IsControl1Matcher FINAL : public NodeMatcher {
*os << ")";
}
virtual bool MatchAndExplain(Node* node, MatchResultListener* listener) const
OVERRIDE {
virtual bool MatchAndExplain(Node* node,
MatchResultListener* listener) const OVERRIDE {
return (NodeMatcher::MatchAndExplain(node, listener) &&
PrintMatchAndExplain(NodeProperties::GetControlInput(node),
"control", control_matcher_, listener));
......@@ -247,8 +247,8 @@ class IsFinishMatcher FINAL : public NodeMatcher {
*os << ")";
}
virtual bool MatchAndExplain(Node* node, MatchResultListener* listener) const
OVERRIDE {
virtual bool MatchAndExplain(Node* node,
MatchResultListener* listener) const OVERRIDE {
return (NodeMatcher::MatchAndExplain(node, listener) &&
PrintMatchAndExplain(NodeProperties::GetValueInput(node, 0),
"value", value_matcher_, listener) &&
......@@ -275,8 +275,8 @@ class IsConstantMatcher FINAL : public NodeMatcher {
*os << ")";
}
virtual bool MatchAndExplain(Node* node, MatchResultListener* listener) const
OVERRIDE {
virtual bool MatchAndExplain(Node* node,
MatchResultListener* listener) const OVERRIDE {
return (NodeMatcher::MatchAndExplain(node, listener) &&
PrintMatchAndExplain(OpParameter<T>(node), "value", value_matcher_,
listener));
......@@ -312,8 +312,8 @@ class IsPhiMatcher FINAL : public NodeMatcher {
*os << ")";
}
virtual bool MatchAndExplain(Node* node, MatchResultListener* listener) const
OVERRIDE {
virtual bool MatchAndExplain(Node* node,
MatchResultListener* listener) const OVERRIDE {
return (NodeMatcher::MatchAndExplain(node, listener) &&
PrintMatchAndExplain(OpParameter<MachineType>(node), "type",
type_matcher_, listener) &&
......@@ -350,8 +350,8 @@ class IsProjectionMatcher FINAL : public NodeMatcher {
*os << ")";
}
virtual bool MatchAndExplain(Node* node, MatchResultListener* listener) const
OVERRIDE {
virtual bool MatchAndExplain(Node* node,
MatchResultListener* listener) const OVERRIDE {
return (NodeMatcher::MatchAndExplain(node, listener) &&
PrintMatchAndExplain(OpParameter<size_t>(node), "index",
index_matcher_, listener) &&
......@@ -400,8 +400,8 @@ class IsCallMatcher FINAL : public NodeMatcher {
*os << ")";
}
virtual bool MatchAndExplain(Node* node, MatchResultListener* listener) const
OVERRIDE {
virtual bool MatchAndExplain(Node* node,
MatchResultListener* listener) const OVERRIDE {
return (NodeMatcher::MatchAndExplain(node, listener) &&
PrintMatchAndExplain(OpParameter<CallDescriptor*>(node),
"descriptor", descriptor_matcher_, listener) &&
......@@ -455,8 +455,8 @@ class IsLoadMatcher FINAL : public NodeMatcher {
*os << ")";
}
virtual bool MatchAndExplain(Node* node, MatchResultListener* listener) const
OVERRIDE {
virtual bool MatchAndExplain(Node* node,
MatchResultListener* listener) const OVERRIDE {
return (NodeMatcher::MatchAndExplain(node, listener) &&
PrintMatchAndExplain(OpParameter<LoadRepresentation>(node), "rep",
rep_matcher_, listener) &&
......@@ -513,8 +513,8 @@ class IsStoreMatcher FINAL : public NodeMatcher {
*os << ")";
}
virtual bool MatchAndExplain(Node* node, MatchResultListener* listener) const
OVERRIDE {
virtual bool MatchAndExplain(Node* node,
MatchResultListener* listener) const OVERRIDE {
return (NodeMatcher::MatchAndExplain(node, listener) &&
PrintMatchAndExplain(
OpParameter<StoreRepresentation>(node).machine_type(), "type",
......@@ -562,8 +562,8 @@ class IsBinopMatcher FINAL : public NodeMatcher {
*os << ")";
}
virtual bool MatchAndExplain(Node* node, MatchResultListener* listener) const
OVERRIDE {
virtual bool MatchAndExplain(Node* node,
MatchResultListener* listener) const OVERRIDE {
return (NodeMatcher::MatchAndExplain(node, listener) &&
PrintMatchAndExplain(NodeProperties::GetValueInput(node, 0), "lhs",
lhs_matcher_, listener) &&
......@@ -589,8 +589,8 @@ class IsUnopMatcher FINAL : public NodeMatcher {
*os << ")";
}
virtual bool MatchAndExplain(Node* node, MatchResultListener* listener) const
OVERRIDE {
virtual bool MatchAndExplain(Node* node,
MatchResultListener* listener) const OVERRIDE {
return (NodeMatcher::MatchAndExplain(node, listener) &&
PrintMatchAndExplain(NodeProperties::GetValueInput(node, 0),
"input", input_matcher_, listener));
......
......@@ -2,13 +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_GRAPH_UNITTEST_H_
#define V8_COMPILER_GRAPH_UNITTEST_H_
#ifndef V8_UNITTESTS_COMPILER_GRAPH_UNITTEST_H_
#define V8_UNITTESTS_COMPILER_GRAPH_UNITTEST_H_
#include "src/compiler/common-operator.h"
#include "src/compiler/graph.h"
#include "src/compiler/machine-operator.h"
#include "src/test/test-utils.h"
#include "test/unittests/test-utils.h"
#include "testing/gmock/include/gmock/gmock.h"
namespace v8 {
......@@ -140,4 +140,4 @@ Matcher<Node*> IsFloat64Sqrt(const Matcher<Node*>& input_matcher);
} // namespace internal
} // namespace v8
#endif // V8_COMPILER_GRAPH_UNITTEST_H_
#endif // V8_UNITTESTS_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 "src/compiler/instruction-selector-unittest.h"
#include "test/unittests/compiler/instruction-selector-unittest.h"
namespace v8 {
namespace internal {
......@@ -202,9 +202,9 @@ TEST_P(InstructionSelectorMemoryAccessTest, LoadWithImmediateBase) {
if (base == 0) {
ASSERT_EQ(1U, s[0]->InputCount());
} else {
ASSERT_EQ(2U, s[0]->InputCount());
ASSERT_EQ(InstructionOperand::IMMEDIATE, s[0]->InputAt(1)->kind());
EXPECT_EQ(base, s.ToInt32(s[0]->InputAt(1)));
ASSERT_EQ(2U, s[0]->InputCount());
ASSERT_EQ(InstructionOperand::IMMEDIATE, s[0]->InputAt(1)->kind());
EXPECT_EQ(base, s.ToInt32(s[0]->InputAt(1)));
}
EXPECT_EQ(1U, s[0]->OutputCount());
}
......@@ -222,9 +222,9 @@ TEST_P(InstructionSelectorMemoryAccessTest, LoadWithImmediateIndex) {
if (index == 0) {
ASSERT_EQ(1U, s[0]->InputCount());
} else {
ASSERT_EQ(2U, s[0]->InputCount());
ASSERT_EQ(InstructionOperand::IMMEDIATE, s[0]->InputAt(1)->kind());
EXPECT_EQ(index, s.ToInt32(s[0]->InputAt(1)));
ASSERT_EQ(2U, s[0]->InputCount());
ASSERT_EQ(InstructionOperand::IMMEDIATE, s[0]->InputAt(1)->kind());
EXPECT_EQ(index, s.ToInt32(s[0]->InputAt(1)));
}
EXPECT_EQ(1U, s[0]->OutputCount());
}
......@@ -256,9 +256,9 @@ TEST_P(InstructionSelectorMemoryAccessTest, StoreWithImmediateBase) {
if (base == 0) {
ASSERT_EQ(2U, s[0]->InputCount());
} else {
ASSERT_EQ(3U, s[0]->InputCount());
ASSERT_EQ(InstructionOperand::IMMEDIATE, s[0]->InputAt(1)->kind());
EXPECT_EQ(base, s.ToInt32(s[0]->InputAt(1)));
ASSERT_EQ(3U, s[0]->InputCount());
ASSERT_EQ(InstructionOperand::IMMEDIATE, s[0]->InputAt(1)->kind());
EXPECT_EQ(base, s.ToInt32(s[0]->InputAt(1)));
}
EXPECT_EQ(0U, s[0]->OutputCount());
}
......
......@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/compiler/instruction-selector-unittest.h"
#include "test/unittests/compiler/instruction-selector-unittest.h"
#include "src/compiler/compiler-test-utils.h"
#include "src/flags.h"
#include "test/unittests/compiler/compiler-test-utils.h"
namespace v8 {
namespace internal {
......
......@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef V8_COMPILER_INSTRUCTION_SELECTOR_UNITTEST_H_
#define V8_COMPILER_INSTRUCTION_SELECTOR_UNITTEST_H_
#ifndef V8_UNITTESTS_COMPILER_INSTRUCTION_SELECTOR_UNITTEST_H_
#define V8_UNITTESTS_COMPILER_INSTRUCTION_SELECTOR_UNITTEST_H_
#include <deque>
#include <set>
......@@ -11,7 +11,7 @@
#include "src/base/utils/random-number-generator.h"
#include "src/compiler/instruction-selector.h"
#include "src/compiler/raw-machine-assembler.h"
#include "src/test/test-utils.h"
#include "test/unittests/test-utils.h"
namespace v8 {
namespace internal {
......@@ -210,4 +210,4 @@ class InstructionSelectorTestWithParam
} // namespace internal
} // namespace v8
#endif // V8_COMPILER_INSTRUCTION_SELECTOR_UNITTEST_H_
#endif // V8_UNITTESTS_COMPILER_INSTRUCTION_SELECTOR_UNITTEST_H_
......@@ -2,7 +2,8 @@
// 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 "test/unittests/compiler/graph-unittest.h"
#include "src/compiler/js-builtin-reducer.h"
#include "src/compiler/js-graph.h"
#include "src/compiler/node-properties-inl.h"
......
......@@ -4,7 +4,7 @@
#include "src/compiler/js-operator.h"
#include "src/compiler/operator-properties-inl.h"
#include "src/test/test-utils.h"
#include "test/unittests/test-utils.h"
namespace v8 {
namespace internal {
......
......@@ -3,10 +3,10 @@
// found in the LICENSE file.
#include "src/base/bits.h"
#include "src/compiler/graph-unittest.h"
#include "src/compiler/js-graph.h"
#include "src/compiler/machine-operator-reducer.h"
#include "src/compiler/typer.h"
#include "test/unittests/compiler/graph-unittest.h"
namespace v8 {
namespace internal {
......
......@@ -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/unittests/compiler/graph-unittest.h"
namespace v8 {
namespace internal {
......
......@@ -5,7 +5,7 @@
#include "src/compiler/simplified-operator.h"
#include "src/compiler/operator-properties-inl.h"
#include "src/test/test-utils.h"
#include "test/unittests/test-utils.h"
namespace v8 {
namespace internal {
......
......@@ -6,7 +6,7 @@
#include "src/compiler/graph.h"
#include "src/compiler/value-numbering-reducer.h"
#include "src/test/test-utils.h"
#include "test/unittests/test-utils.h"
namespace v8 {
namespace internal {
......
......@@ -2,7 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/compiler/instruction-selector-unittest.h"
#include "test/unittests/compiler/instruction-selector-unittest.h"
#include "src/compiler/node-matchers.h"
namespace v8 {
......
......@@ -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 "src/test/test-utils.h"
#include "test/unittests/test-utils.h"
#include "src/isolate-inl.h"
......
......@@ -2,8 +2,8 @@
// 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_
#ifndef V8_UNITTESTS_TEST_UTILS_H_
#define V8_UNITTESTS_TEST_UTILS_H_
#include "include/v8.h"
#include "src/base/macros.h"
......@@ -83,4 +83,4 @@ class TestWithZone : public TestWithIsolate {
} // namespace internal
} // namespace v8
#endif // V8_TEST_TEST_UTILS_H_
#endif // V8_UNITTESTS_TEST_UTILS_H_
......@@ -9,8 +9,8 @@
'includes': ['../../build/toolchain.gypi', '../../build/features.gypi'],
'targets': [
{
'target_name': 'run-all-unittests',
'type': 'static_library',
'target_name': 'unittests',
'type': 'executable',
'variables': {
'optimize': 'max',
},
......@@ -23,15 +23,61 @@
'../..',
],
'sources': [ ### gcmole(all) ###
'base/bits-unittest.cc',
'base/cpu-unittest.cc',
'base/division-by-constant-unittest.cc',
'base/flags-unittest.cc',
'base/platform/condition-variable-unittest.cc',
'base/platform/mutex-unittest.cc',
'base/platform/platform-unittest.cc',
'base/platform/semaphore-unittest.cc',
'base/platform/time-unittest.cc',
'base/sys-info-unittest.cc',
'base/utils/random-number-generator-unittest.cc',
'compiler/change-lowering-unittest.cc',
'compiler/common-operator-unittest.cc',
'compiler/compiler-test-utils.h',
'compiler/graph-reducer-unittest.cc',
'compiler/graph-unittest.cc',
'compiler/graph-unittest.h',
'compiler/instruction-selector-unittest.cc',
'compiler/instruction-selector-unittest.h',
'compiler/js-builtin-reducer-unittest.cc',
'compiler/js-operator-unittest.cc',
'compiler/machine-operator-reducer-unittest.cc',
'compiler/machine-operator-unittest.cc',
'compiler/simplified-operator-reducer-unittest.cc',
'compiler/simplified-operator-unittest.cc',
'compiler/value-numbering-reducer-unittest.cc',
'libplatform/default-platform-unittest.cc',
'libplatform/task-queue-unittest.cc',
'libplatform/worker-thread-unittest.cc',
'heap/gc-idle-time-handler-unittest.cc',
'run-all-unittests.cc',
'test-utils.h',
'test-utils.cc',
],
'export_dependent_settings': [
'../../testing/gmock.gyp:gmock',
'../../testing/gtest.gyp:gtest',
],
'conditions': [
['v8_target_arch=="arm"', {
'sources': [ ### gcmole(arch:arm) ###
'compiler/arm/instruction-selector-arm-unittest.cc',
],
}],
['v8_target_arch=="arm64"', {
'sources': [ ### gcmole(arch:arm64) ###
'compiler/arm64/instruction-selector-arm64-unittest.cc',
],
}],
['v8_target_arch=="ia32"', {
'sources': [ ### gcmole(arch:ia32) ###
'compiler/ia32/instruction-selector-ia32-unittest.cc',
],
}],
['v8_target_arch=="x64"', {
'sources': [ ### gcmole(arch:x64) ###
'compiler/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.
......
......@@ -236,7 +236,8 @@ class CppLintProcessor(SourceFileProcessor):
or (name in CppLintProcessor.IGNORE_LINT))
def GetPathsToSearch(self):
return ['src', 'include', 'samples', join('test', 'cctest')]
return ['src', 'include', 'samples', join('test', 'cctest'),
join('test', 'unittests')]
def GetCpplintScript(self, prio_path):
for path in [prio_path] + os.environ["PATH"].split(os.pathsep):
......
......@@ -51,9 +51,8 @@ from testrunner.objects import context
ARCH_GUESS = utils.DefaultArch()
DEFAULT_TESTS = ["mjsunit", "fuzz-natives", "base-unittests",
"cctest", "compiler-unittests", "heap-unittests",
"libplatform-unittests", "message", "preparser"]
DEFAULT_TESTS = ["mjsunit", "fuzz-natives", "unittests",
"cctest", "message", "preparser"]
# Map of test name synonyms to lists of test suites. Should be ordered by
# expected runtimes (suites with slow test cases first). These groups are
......@@ -72,10 +71,7 @@ TEST_MAP = {
"webkit",
],
"unittests": [
"compiler-unittests",
"heap-unittests",
"base-unittests",
"libplatform-unittests",
"unittests",
],
}
......
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