[jumbo] add unittests jumbo support

TBR=jkummerow@chromium.org

Bug: chromium:746958
Change-Id: I7500b6206c4ceb087672de5b61b7e7ad234bb425
Reviewed-on: https://chromium-review.googlesource.com/690397
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48213}
This commit is contained in:
Mostyn Bramley-Moore 2017-09-28 19:55:52 +02:00 committed by Commit Bot
parent e52b4a6284
commit d6ead37d26
21 changed files with 234 additions and 190 deletions

View File

@ -7,6 +7,30 @@ import("../../gni/v8.gni")
v8_executable("unittests") {
testonly = true
# TODO(machenbach): Translate from gyp.
#['OS=="aix"', {
# 'ldflags': [ '-Wl,-bbigtoc' ],
#}],
deps = [
":unittests_sources",
"../..:v8_for_testing",
"../..:v8_libbase",
"../..:v8_libplatform",
"//build/config:exe_and_shlib_deps",
"//build/win:default_exe_manifest",
"//testing/gmock",
"//testing/gtest",
]
configs = [
"../..:external_config",
"../..:internal_config_base",
]
}
v8_source_set("unittests_sources") {
testonly = true
sources = [
"../../test/common/wasm/wasm-macro-gen.h",
"../../testing/gmock-support.h",
@ -168,6 +192,15 @@ v8_executable("unittests") {
"zone/zone-unittest.cc",
]
if (use_jumbo_build) {
jumbo_excluded_sources = [
# TODO(mostynb@opera.com): figure out how to make this build in both
# modes. Template issues on windows if we add a functional_unittest
# namespace as with the other files.
"base/functional-unittest.cc",
]
}
if (v8_current_cpu == "arm") {
sources += [ "compiler/arm/instruction-selector-arm-unittest.cc" ]
} else if (v8_current_cpu == "arm64") {
@ -191,11 +224,6 @@ v8_executable("unittests") {
"../..:internal_config_base",
]
# TODO(machenbach): Translate from gyp.
#['OS=="aix"', {
# 'ldflags': [ '-Wl,-bbigtoc' ],
#}],
deps = [
"../..:v8_for_testing",
"../..:v8_libbase",

View File

@ -11,6 +11,7 @@
#include "test/unittests/test-utils.h"
namespace v8 {
namespace remote_object_unittest {
typedef TestWithIsolate RemoteObjectTest;
@ -115,4 +116,5 @@ TEST_F(RemoteObjectTest, ClassOf) {
EXPECT_STREQ("test_class", *result);
}
} // namespace remote_object_unittest
} // namespace v8

View File

@ -10,6 +10,7 @@
namespace v8 {
namespace base {
namespace logging_unittest {
namespace {
@ -243,5 +244,6 @@ TEST(LoggingDeathTest, V8_DcheckCanBeOverridden) {
"Dread pirate");
}
} // namespace logging_unittest
} // namespace base
} // namespace v8

View File

@ -8,6 +8,7 @@
namespace v8 {
namespace base {
namespace template_utils_unittest {
////////////////////////////
// Test make_array.
@ -100,5 +101,6 @@ static_assert(has_output_operator<TestClass2>::value,
static_assert(!has_output_operator<const TestClass2>::value,
"const TestClass2 can not be output");
} // namespace template_utils_unittest
} // namespace base
} // namespace v8

View File

@ -17,6 +17,7 @@ using testing::StrictMock;
namespace v8 {
namespace internal {
namespace compiler {
namespace common_operator_reducer_unittest {
class CommonOperatorReducerTest : public GraphTest {
public:
@ -491,6 +492,7 @@ TEST_F(CommonOperatorReducerTest, SelectToFloat64Abs) {
EXPECT_THAT(r.replacement(), IsFloat64Abs(p0));
}
} // namespace common_operator_reducer_unittest
} // namespace compiler
} // namespace internal
} // namespace v8

View File

@ -13,7 +13,7 @@
namespace v8 {
namespace internal {
namespace compiler {
namespace common_operator_unittest {
// -----------------------------------------------------------------------------
// Shared operators.
@ -387,6 +387,7 @@ TEST_F(CommonOperatorTest, Projection) {
}
}
} // namespace common_operator_unittest
} // namespace compiler
} // namespace internal
} // namespace v8

View File

@ -14,6 +14,7 @@ using testing::StrictMock;
namespace v8 {
namespace internal {
namespace compiler {
namespace dead_code_elimination_unittest {
class DeadCodeEliminationTest : public GraphTest {
public:
@ -368,6 +369,7 @@ TEST_F(DeadCodeEliminationTest, TerminateWithDeadControlInput) {
EXPECT_THAT(r.replacement(), IsDead());
}
} // namespace dead_code_elimination_unittest
} // namespace compiler
} // namespace internal
} // namespace v8

View File

@ -21,6 +21,7 @@ using testing::UnorderedElementsAre;
namespace v8 {
namespace internal {
namespace compiler {
namespace graph_reducer_unittest {
namespace {
@ -872,6 +873,7 @@ TEST_F(GraphReducerTest, Order) {
}
}
} // namespace graph_reducer_unittest
} // namespace compiler
} // namespace internal
} // namespace v8

View File

@ -10,6 +10,7 @@
namespace v8 {
namespace internal {
namespace compiler {
namespace instruction_unittest {
namespace {
@ -170,6 +171,7 @@ TEST_F(InstructionTest, PrepareInsertAfter) {
}
}
} // namespace instruction_unittest
} // namespace compiler
} // namespace internal
} // namespace v8

View File

@ -11,6 +11,7 @@
namespace v8 {
namespace internal {
namespace compiler {
namespace js_operator_unittest {
// -----------------------------------------------------------------------------
// Shared operators.
@ -112,6 +113,7 @@ TEST_P(JSSharedOperatorTest, Properties) {
INSTANTIATE_TEST_CASE_P(JSOperatorTest, JSSharedOperatorTest,
::testing::ValuesIn(kSharedOperators));
} // namespace js_operator_unittest
} // namespace compiler
} // namespace internal
} // namespace v8

View File

@ -12,6 +12,7 @@ using testing::Contains;
namespace v8 {
namespace internal {
namespace compiler {
namespace node_cache_unittest {
typedef GraphTest NodeCacheTest;
@ -154,6 +155,7 @@ TEST_F(NodeCacheTest, GetCachedNodes_int64) {
}
}
} // namespace node_cache_unittest
} // namespace compiler
} // namespace internal
} // namespace v8

View File

@ -14,6 +14,7 @@ using testing::IsNull;
namespace v8 {
namespace internal {
namespace compiler {
namespace node_properties_unittest {
class NodePropertiesTest : public TestWithZone {
public:
@ -118,6 +119,7 @@ TEST_F(NodePropertiesTest, CollectControlProjections_Switch) {
EXPECT_EQ(if_default, result[2]);
}
} // namespace node_properties_unittest
} // namespace compiler
} // namespace internal
} // namespace v8

File diff suppressed because it is too large Load Diff

View File

@ -19,6 +19,7 @@ using testing::BitEq;
namespace v8 {
namespace internal {
namespace compiler {
namespace simplified_operator_reducer_unittest {
class SimplifiedOperatorReducerTest : public GraphTest {
public:
@ -498,6 +499,7 @@ TEST_F(SimplifiedOperatorReducerTest, ObjectIsSmiWithNumberConstant) {
}
}
} // namespace simplified_operator_reducer_unittest
} // namespace compiler
} // namespace internal
} // namespace v8

View File

@ -22,6 +22,7 @@ using testing::IsNaN;
namespace v8 {
namespace internal {
namespace compiler {
namespace typed_optimization_unittest {
namespace {
@ -219,6 +220,7 @@ TEST_F(TypedOptimizationTest, JSToBooleanWithNonZeroPlainNumber) {
EXPECT_THAT(r.replacement(), IsTrueConstant());
}
} // namespace typed_optimization_unittest
} // namespace compiler
} // namespace internal
} // namespace v8

View File

@ -11,6 +11,7 @@ using testing::StrictMock;
namespace v8 {
namespace platform {
namespace default_platform_unittest {
namespace {
@ -166,5 +167,6 @@ TEST(DefaultPlatformTest, PendingIdleTasksAreDestroyedOnShutdown) {
}
}
} // namespace default_platform_unittest
} // namespace platform
} // namespace v8

View File

@ -13,6 +13,7 @@ using testing::StrictMock;
namespace v8 {
namespace platform {
namespace task_queue_unittest {
namespace {
@ -56,5 +57,6 @@ TEST(TaskQueueTest, TerminateMultipleReaders) {
thread2.Join();
}
} // namespace task_queue_unittest
} // namespace platform
} // namespace v8

View File

@ -24,6 +24,25 @@ struct MockTask : public Task {
} // namespace
// Needs to be in v8::platform due to BlockUntilQueueEmptyForTesting
// being private.
TEST(WorkerThreadTest, PostSingleTask) {
TaskQueue queue;
WorkerThread thread1(&queue);
WorkerThread thread2(&queue);
InSequence s;
StrictMock<MockTask>* task = new StrictMock<MockTask>;
EXPECT_CALL(*task, Run());
EXPECT_CALL(*task, Die());
queue.Append(task);
// The next call should not time out.
queue.BlockUntilQueueEmptyForTesting();
queue.Terminate();
}
namespace worker_thread_unittest {
TEST(WorkerThreadTest, Basic) {
static const size_t kNumTasks = 10;
@ -44,21 +63,6 @@ TEST(WorkerThreadTest, Basic) {
queue.Terminate();
}
TEST(WorkerThreadTest, PostSingleTask) {
TaskQueue queue;
WorkerThread thread1(&queue);
WorkerThread thread2(&queue);
InSequence s;
StrictMock<MockTask>* task = new StrictMock<MockTask>;
EXPECT_CALL(*task, Run());
EXPECT_CALL(*task, Die());
queue.Append(task);
// The next call should not time out.
queue.BlockUntilQueueEmptyForTesting();
queue.Terminate();
}
} // namespace worker_thread_unittest
} // namespace platform
} // namespace v8

View File

@ -22,6 +22,7 @@
namespace v8 {
namespace internal {
namespace wasm {
namespace function_body_decoder_unittest {
#define B1(a) WASM_BLOCK(a)
#define B2(a, b) WASM_BLOCK(a, b)
@ -2950,6 +2951,7 @@ TEST_F(BytecodeIteratorTest, WithLocalDecls) {
#undef EXPECT_VERIFIES
#undef EXPECT_FAILURE
} // namespace function_body_decoder_unittest
} // namespace wasm
} // namespace internal
} // namespace v8

View File

@ -15,6 +15,7 @@
namespace v8 {
namespace internal {
namespace wasm {
namespace module_decoder_unittest {
#define WASM_INIT_EXPR_I32V_1(val) WASM_I32V_1(val), kExprEnd
#define WASM_INIT_EXPR_I32V_2(val) WASM_I32V_2(val), kExprEnd
@ -1812,6 +1813,7 @@ TEST_F(WasmModuleCustomSectionTest, TwoKnownTwoUnknownSections) {
#undef EXPECT_OFF_END_FAILURE
#undef EXPECT_OK
} // namespace module_decoder_unittest
} // namespace wasm
} // namespace internal
} // namespace v8

View File

@ -10,8 +10,9 @@
namespace v8 {
namespace internal {
namespace wasm {
namespace wasm_heap_unittest {
class DisjointAllocationPoolTest : public testing::Test {
class DisjointAllocationPoolTest : public ::testing::Test {
public:
Address A(size_t n) { return reinterpret_cast<Address>(n); }
void CheckLooksLike(const DisjointAllocationPool& mem,
@ -150,6 +151,7 @@ TEST_F(DisjointAllocationPoolTest, MergingSkipLargerSrcWithGap) {
CheckLooksLike(a, {{10, 15}, {20, 35}, {36, 40}});
}
} // namespace wasm_heap_unittest
} // namespace wasm
} // namespace internal
} // namespace v8