From bfd37ab267554e92f95a2da0b0cd710fe86e6a05 Mon Sep 17 00:00:00 2001 From: "bmeurer@chromium.org" Date: Wed, 1 Oct 2014 08:34:25 +0000 Subject: [PATCH] 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 --- Makefile | 4 +- build/all.gyp | 5 +- src/DEPS | 3 +- src/base/base.gyp | 46 -------- src/compiler/compiler.gyp | 61 ----------- src/heap/heap.gyp | 52 --------- src/libplatform/libplatform.gyp | 39 ------- src/test/DEPS | 3 - src/test/test.gyp | 71 ------------- test/base-unittests/base-unittests.status | 6 -- test/compiler-unittests/compiler-unittests.status | 6 -- test/heap-unittests/heap-unittests.status | 6 -- test/unittests/DEPS | 4 + {src => test/unittests}/base/bits-unittest.cc | 0 {src => test/unittests}/base/cpu-unittest.cc | 0 .../base/division-by-constant-unittest.cc | 0 {src => test/unittests}/base/flags-unittest.cc | 0 .../base/platform/condition-variable-unittest.cc | 0 .../unittests}/base/platform/mutex-unittest.cc | 0 .../unittests}/base/platform/platform-unittest.cc | 0 .../unittests}/base/platform/semaphore-unittest.cc | 0 .../unittests}/base/platform/time-unittest.cc | 0 {src => test/unittests}/base/sys-info-unittest.cc | 0 .../base/utils/random-number-generator-unittest.cc | 0 .../arm/instruction-selector-arm-unittest.cc | 2 +- .../arm64/instruction-selector-arm64-unittest.cc | 84 +++++++++------ .../compiler/change-lowering-unittest.cc | 4 +- .../compiler/common-operator-unittest.cc | 2 +- .../unittests}/compiler/compiler-test-utils.h | 6 +- .../unittests}/compiler/graph-reducer-unittest.cc | 2 +- {src => test/unittests}/compiler/graph-unittest.cc | 54 +++++----- {src => test/unittests}/compiler/graph-unittest.h | 8 +- .../ia32/instruction-selector-ia32-unittest.cc | 20 ++-- .../compiler/instruction-selector-unittest.cc | 4 +- .../compiler/instruction-selector-unittest.h | 8 +- .../compiler/js-builtin-reducer-unittest.cc | 3 +- .../unittests}/compiler/js-operator-unittest.cc | 2 +- .../compiler/machine-operator-reducer-unittest.cc | 2 +- .../compiler/machine-operator-unittest.cc | 0 .../simplified-operator-reducer-unittest.cc | 2 +- .../compiler/simplified-operator-unittest.cc | 2 +- .../compiler/value-numbering-reducer-unittest.cc | 2 +- .../x64/instruction-selector-x64-unittest.cc | 3 +- .../heap/gc-idle-time-handler-unittest.cc | 0 .../libplatform/default-platform-unittest.cc | 0 .../unittests}/libplatform/task-queue-unittest.cc | 0 .../libplatform/worker-thread-unittest.cc | 0 {src/test => test/unittests}/run-all-unittests.cc | 0 {src/test => test/unittests}/test-utils.cc | 2 +- {src/test => test/unittests}/test-utils.h | 6 +- test/unittests/unittests.gyp | 117 +++++++++++++++++++++ .../unittests.status} | 0 tools/presubmit.py | 3 +- tools/run-tests.py | 10 +- 54 files changed, 249 insertions(+), 405 deletions(-) delete mode 100644 src/base/base.gyp delete mode 100644 src/compiler/compiler.gyp delete mode 100644 src/heap/heap.gyp delete mode 100644 src/libplatform/libplatform.gyp delete mode 100644 src/test/DEPS delete mode 100644 src/test/test.gyp delete mode 100644 test/base-unittests/base-unittests.status delete mode 100644 test/compiler-unittests/compiler-unittests.status delete mode 100644 test/heap-unittests/heap-unittests.status create mode 100644 test/unittests/DEPS rename {src => test/unittests}/base/bits-unittest.cc (100%) rename {src => test/unittests}/base/cpu-unittest.cc (100%) rename {src => test/unittests}/base/division-by-constant-unittest.cc (100%) rename {src => test/unittests}/base/flags-unittest.cc (100%) rename {src => test/unittests}/base/platform/condition-variable-unittest.cc (100%) rename {src => test/unittests}/base/platform/mutex-unittest.cc (100%) rename {src => test/unittests}/base/platform/platform-unittest.cc (100%) rename {src => test/unittests}/base/platform/semaphore-unittest.cc (100%) rename {src => test/unittests}/base/platform/time-unittest.cc (100%) rename {src => test/unittests}/base/sys-info-unittest.cc (100%) rename {src => test/unittests}/base/utils/random-number-generator-unittest.cc (100%) rename {src => test/unittests}/compiler/arm/instruction-selector-arm-unittest.cc (99%) rename {src => test/unittests}/compiler/arm64/instruction-selector-arm64-unittest.cc (97%) rename {src => test/unittests}/compiler/change-lowering-unittest.cc (99%) rename {src => test/unittests}/compiler/common-operator-unittest.cc (99%) rename {src => test/unittests}/compiler/compiler-test-utils.h (91%) rename {src => test/unittests}/compiler/graph-reducer-unittest.cc (98%) rename {src => test/unittests}/compiler/graph-unittest.cc (93%) rename {src => test/unittests}/compiler/graph-unittest.h (97%) rename {src => test/unittests}/compiler/ia32/instruction-selector-ia32-unittest.cc (96%) rename {src => test/unittests}/compiler/instruction-selector-unittest.cc (99%) rename {src => test/unittests}/compiler/instruction-selector-unittest.h (96%) rename {src => test/unittests}/compiler/js-builtin-reducer-unittest.cc (99%) rename {src => test/unittests}/compiler/js-operator-unittest.cc (99%) rename {src => test/unittests}/compiler/machine-operator-reducer-unittest.cc (99%) rename {src => test/unittests}/compiler/machine-operator-unittest.cc (100%) rename {src => test/unittests}/compiler/simplified-operator-reducer-unittest.cc (99%) rename {src => test/unittests}/compiler/simplified-operator-unittest.cc (99%) rename {src => test/unittests}/compiler/value-numbering-reducer-unittest.cc (99%) rename {src => test/unittests}/compiler/x64/instruction-selector-x64-unittest.cc (99%) rename {src => test/unittests}/heap/gc-idle-time-handler-unittest.cc (100%) rename {src => test/unittests}/libplatform/default-platform-unittest.cc (100%) rename {src => test/unittests}/libplatform/task-queue-unittest.cc (100%) rename {src => test/unittests}/libplatform/worker-thread-unittest.cc (100%) rename {src/test => test/unittests}/run-all-unittests.cc (100%) rename {src/test => test/unittests}/test-utils.cc (96%) rename {src/test => test/unittests}/test-utils.h (93%) create mode 100644 test/unittests/unittests.gyp rename test/{libplatform-unittests/libplatform-unittests.status => unittests/unittests.status} (100%) diff --git a/Makefile b/Makefile index 2fbe1ba..70162df 100644 --- a/Makefile +++ b/Makefile @@ -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) diff --git a/build/all.gyp b/build/all.gyp index 1e420fa..d6ffac9 100644 --- a/build/all.gyp +++ b/build/all.gyp @@ -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"', { diff --git a/src/DEPS b/src/DEPS index 260f5b2..4dbb3c7 100644 --- a/src/DEPS +++ b/src/DEPS @@ -3,8 +3,7 @@ include_rules = [ "-src/compiler", "+src/compiler/pipeline.h", "-src/libplatform", - "-include/libplatform", - "+testing", + "-include/libplatform" ] specific_include_rules = { diff --git a/src/base/base.gyp b/src/base/base.gyp deleted file mode 100644 index e391e2e..0000000 --- a/src/base/base.gyp +++ /dev/null @@ -1,46 +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. - -{ - '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', - ], - }], - ], - }, - ], -} diff --git a/src/compiler/compiler.gyp b/src/compiler/compiler.gyp deleted file mode 100644 index 2a831d8..0000000 --- a/src/compiler/compiler.gyp +++ /dev/null @@ -1,61 +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. - -{ - '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', - ], - }], - ], - }, - ], -} diff --git a/src/heap/heap.gyp b/src/heap/heap.gyp deleted file mode 100644 index 2970eb8..0000000 --- a/src/heap/heap.gyp +++ /dev/null @@ -1,52 +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. - -{ - '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', - ], - }], - ], - }, - ], -} diff --git a/src/libplatform/libplatform.gyp b/src/libplatform/libplatform.gyp deleted file mode 100644 index 4321da7..0000000 --- a/src/libplatform/libplatform.gyp +++ /dev/null @@ -1,39 +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. - -{ - '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', - ], - }], - ], - }, - ], -} diff --git a/src/test/DEPS b/src/test/DEPS deleted file mode 100644 index 13855ec..0000000 --- a/src/test/DEPS +++ /dev/null @@ -1,3 +0,0 @@ -include_rules = [ - "+include/libplatform/libplatform.h" -] diff --git a/src/test/test.gyp b/src/test/test.gyp deleted file mode 100644 index f4c6a5e..0000000 --- a/src/test/test.gyp +++ /dev/null @@ -1,71 +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. - -{ - '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'], - }], - ], - }, - ], -} diff --git a/test/base-unittests/base-unittests.status b/test/base-unittests/base-unittests.status deleted file mode 100644 index d439913..0000000 --- a/test/base-unittests/base-unittests.status +++ /dev/null @@ -1,6 +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. - -[ -] diff --git a/test/compiler-unittests/compiler-unittests.status b/test/compiler-unittests/compiler-unittests.status deleted file mode 100644 index d439913..0000000 --- a/test/compiler-unittests/compiler-unittests.status +++ /dev/null @@ -1,6 +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. - -[ -] diff --git a/test/heap-unittests/heap-unittests.status b/test/heap-unittests/heap-unittests.status deleted file mode 100644 index d439913..0000000 --- a/test/heap-unittests/heap-unittests.status +++ /dev/null @@ -1,6 +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. - -[ -] diff --git a/test/unittests/DEPS b/test/unittests/DEPS new file mode 100644 index 0000000..4df37f8 --- /dev/null +++ b/test/unittests/DEPS @@ -0,0 +1,4 @@ +include_rules = [ + "+src", + "+testing" +] diff --git a/src/base/bits-unittest.cc b/test/unittests/base/bits-unittest.cc similarity index 100% rename from src/base/bits-unittest.cc rename to test/unittests/base/bits-unittest.cc diff --git a/src/base/cpu-unittest.cc b/test/unittests/base/cpu-unittest.cc similarity index 100% rename from src/base/cpu-unittest.cc rename to test/unittests/base/cpu-unittest.cc diff --git a/src/base/division-by-constant-unittest.cc b/test/unittests/base/division-by-constant-unittest.cc similarity index 100% rename from src/base/division-by-constant-unittest.cc rename to test/unittests/base/division-by-constant-unittest.cc diff --git a/src/base/flags-unittest.cc b/test/unittests/base/flags-unittest.cc similarity index 100% rename from src/base/flags-unittest.cc rename to test/unittests/base/flags-unittest.cc diff --git a/src/base/platform/condition-variable-unittest.cc b/test/unittests/base/platform/condition-variable-unittest.cc similarity index 100% rename from src/base/platform/condition-variable-unittest.cc rename to test/unittests/base/platform/condition-variable-unittest.cc diff --git a/src/base/platform/mutex-unittest.cc b/test/unittests/base/platform/mutex-unittest.cc similarity index 100% rename from src/base/platform/mutex-unittest.cc rename to test/unittests/base/platform/mutex-unittest.cc diff --git a/src/base/platform/platform-unittest.cc b/test/unittests/base/platform/platform-unittest.cc similarity index 100% rename from src/base/platform/platform-unittest.cc rename to test/unittests/base/platform/platform-unittest.cc diff --git a/src/base/platform/semaphore-unittest.cc b/test/unittests/base/platform/semaphore-unittest.cc similarity index 100% rename from src/base/platform/semaphore-unittest.cc rename to test/unittests/base/platform/semaphore-unittest.cc diff --git a/src/base/platform/time-unittest.cc b/test/unittests/base/platform/time-unittest.cc similarity index 100% rename from src/base/platform/time-unittest.cc rename to test/unittests/base/platform/time-unittest.cc diff --git a/src/base/sys-info-unittest.cc b/test/unittests/base/sys-info-unittest.cc similarity index 100% rename from src/base/sys-info-unittest.cc rename to test/unittests/base/sys-info-unittest.cc diff --git a/src/base/utils/random-number-generator-unittest.cc b/test/unittests/base/utils/random-number-generator-unittest.cc similarity index 100% rename from src/base/utils/random-number-generator-unittest.cc rename to test/unittests/base/utils/random-number-generator-unittest.cc diff --git a/src/compiler/arm/instruction-selector-arm-unittest.cc b/test/unittests/compiler/arm/instruction-selector-arm-unittest.cc similarity index 99% rename from src/compiler/arm/instruction-selector-arm-unittest.cc rename to test/unittests/compiler/arm/instruction-selector-arm-unittest.cc index 8296073..c898847 100644 --- a/src/compiler/arm/instruction-selector-arm-unittest.cc +++ b/test/unittests/compiler/arm/instruction-selector-arm-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 "src/compiler/instruction-selector-unittest.h" +#include "test/unittests/compiler/instruction-selector-unittest.h" namespace v8 { namespace internal { diff --git a/src/compiler/arm64/instruction-selector-arm64-unittest.cc b/test/unittests/compiler/arm64/instruction-selector-arm64-unittest.cc similarity index 97% rename from src/compiler/arm64/instruction-selector-arm64-unittest.cc rename to test/unittests/compiler/arm64/instruction-selector-arm64-unittest.cc index 73c5d8d..79cf6aa 100644 --- a/src/compiler/arm64/instruction-selector-arm64-unittest.cc +++ b/test/unittests/compiler/arm64/instruction-selector-arm64-unittest.cc @@ -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 - -#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 diff --git a/src/compiler/change-lowering-unittest.cc b/test/unittests/compiler/change-lowering-unittest.cc similarity index 99% rename from src/compiler/change-lowering-unittest.cc rename to test/unittests/compiler/change-lowering-unittest.cc index 7b0fab2..c135def 100644 --- a/src/compiler/change-lowering-unittest.cc +++ b/test/unittests/compiler/change-lowering-unittest.cc @@ -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::_; diff --git a/src/compiler/common-operator-unittest.cc b/test/unittests/compiler/common-operator-unittest.cc similarity index 99% rename from src/compiler/common-operator-unittest.cc rename to test/unittests/compiler/common-operator-unittest.cc index 5001770..571d696 100644 --- a/src/compiler/common-operator-unittest.cc +++ b/test/unittests/compiler/common-operator-unittest.cc @@ -7,7 +7,7 @@ #include #include "src/compiler/operator-properties-inl.h" -#include "src/test/test-utils.h" +#include "test/unittests/test-utils.h" namespace v8 { namespace internal { diff --git a/src/compiler/compiler-test-utils.h b/test/unittests/compiler/compiler-test-utils.h similarity index 91% rename from src/compiler/compiler-test-utils.h rename to test/unittests/compiler/compiler-test-utils.h index 437abd6..6ce28f9 100644 --- a/src/compiler/compiler-test-utils.h +++ b/test/unittests/compiler/compiler-test-utils.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_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_ diff --git a/src/compiler/graph-reducer-unittest.cc b/test/unittests/compiler/graph-reducer-unittest.cc similarity index 98% rename from src/compiler/graph-reducer-unittest.cc rename to test/unittests/compiler/graph-reducer-unittest.cc index 2729d58..4cd4dd9 100644 --- a/src/compiler/graph-reducer-unittest.cc +++ b/test/unittests/compiler/graph-reducer-unittest.cc @@ -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::_; diff --git a/src/compiler/graph-unittest.cc b/test/unittests/compiler/graph-unittest.cc similarity index 93% rename from src/compiler/graph-unittest.cc rename to test/unittests/compiler/graph-unittest.cc index 7fa97f1..ee00889 100644 --- a/src/compiler/graph-unittest.cc +++ b/test/unittests/compiler/graph-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 "src/compiler/graph-unittest.h" +#include "test/unittests/compiler/graph-unittest.h" #include // NOLINT(readability/streams) @@ -122,8 +122,8 @@ class NodeMatcher : public MatcherInterface { *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(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(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(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(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(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(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)); diff --git a/src/compiler/graph-unittest.h b/test/unittests/compiler/graph-unittest.h similarity index 97% rename from src/compiler/graph-unittest.h rename to test/unittests/compiler/graph-unittest.h index b821165..c59c669 100644 --- a/src/compiler/graph-unittest.h +++ b/test/unittests/compiler/graph-unittest.h @@ -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 IsFloat64Sqrt(const Matcher& input_matcher); } // namespace internal } // namespace v8 -#endif // V8_COMPILER_GRAPH_UNITTEST_H_ +#endif // V8_UNITTESTS_COMPILER_GRAPH_UNITTEST_H_ diff --git a/src/compiler/ia32/instruction-selector-ia32-unittest.cc b/test/unittests/compiler/ia32/instruction-selector-ia32-unittest.cc similarity index 96% rename from src/compiler/ia32/instruction-selector-ia32-unittest.cc rename to test/unittests/compiler/ia32/instruction-selector-ia32-unittest.cc index 540584c..a5c4201 100644 --- a/src/compiler/ia32/instruction-selector-ia32-unittest.cc +++ b/test/unittests/compiler/ia32/instruction-selector-ia32-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 "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()); } diff --git a/src/compiler/instruction-selector-unittest.cc b/test/unittests/compiler/instruction-selector-unittest.cc similarity index 99% rename from src/compiler/instruction-selector-unittest.cc rename to test/unittests/compiler/instruction-selector-unittest.cc index 2b02412..6d866c4 100644 --- a/src/compiler/instruction-selector-unittest.cc +++ b/test/unittests/compiler/instruction-selector-unittest.cc @@ -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 { diff --git a/src/compiler/instruction-selector-unittest.h b/test/unittests/compiler/instruction-selector-unittest.h similarity index 96% rename from src/compiler/instruction-selector-unittest.h rename to test/unittests/compiler/instruction-selector-unittest.h index 3e7f63a..4f2cdbc 100644 --- a/src/compiler/instruction-selector-unittest.h +++ b/test/unittests/compiler/instruction-selector-unittest.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_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 #include @@ -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_ diff --git a/src/compiler/js-builtin-reducer-unittest.cc b/test/unittests/compiler/js-builtin-reducer-unittest.cc similarity index 99% rename from src/compiler/js-builtin-reducer-unittest.cc rename to test/unittests/compiler/js-builtin-reducer-unittest.cc index 22311a6..c72978f 100644 --- a/src/compiler/js-builtin-reducer-unittest.cc +++ b/test/unittests/compiler/js-builtin-reducer-unittest.cc @@ -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" diff --git a/src/compiler/js-operator-unittest.cc b/test/unittests/compiler/js-operator-unittest.cc similarity index 99% rename from src/compiler/js-operator-unittest.cc rename to test/unittests/compiler/js-operator-unittest.cc index fda1402..061a597 100644 --- a/src/compiler/js-operator-unittest.cc +++ b/test/unittests/compiler/js-operator-unittest.cc @@ -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 { diff --git a/src/compiler/machine-operator-reducer-unittest.cc b/test/unittests/compiler/machine-operator-reducer-unittest.cc similarity index 99% rename from src/compiler/machine-operator-reducer-unittest.cc rename to test/unittests/compiler/machine-operator-reducer-unittest.cc index 5a76342..4d3df88 100644 --- a/src/compiler/machine-operator-reducer-unittest.cc +++ b/test/unittests/compiler/machine-operator-reducer-unittest.cc @@ -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 { diff --git a/src/compiler/machine-operator-unittest.cc b/test/unittests/compiler/machine-operator-unittest.cc similarity index 100% rename from src/compiler/machine-operator-unittest.cc rename to test/unittests/compiler/machine-operator-unittest.cc diff --git a/src/compiler/simplified-operator-reducer-unittest.cc b/test/unittests/compiler/simplified-operator-reducer-unittest.cc similarity index 99% rename from src/compiler/simplified-operator-reducer-unittest.cc rename to test/unittests/compiler/simplified-operator-reducer-unittest.cc index 739264e..fb09731 100644 --- a/src/compiler/simplified-operator-reducer-unittest.cc +++ b/test/unittests/compiler/simplified-operator-reducer-unittest.cc @@ -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 { diff --git a/src/compiler/simplified-operator-unittest.cc b/test/unittests/compiler/simplified-operator-unittest.cc similarity index 99% rename from src/compiler/simplified-operator-unittest.cc rename to test/unittests/compiler/simplified-operator-unittest.cc index 422e64f..dcabc1a 100644 --- a/src/compiler/simplified-operator-unittest.cc +++ b/test/unittests/compiler/simplified-operator-unittest.cc @@ -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 { diff --git a/src/compiler/value-numbering-reducer-unittest.cc b/test/unittests/compiler/value-numbering-reducer-unittest.cc similarity index 99% rename from src/compiler/value-numbering-reducer-unittest.cc rename to test/unittests/compiler/value-numbering-reducer-unittest.cc index 8db6458..f12bd33 100644 --- a/src/compiler/value-numbering-reducer-unittest.cc +++ b/test/unittests/compiler/value-numbering-reducer-unittest.cc @@ -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 { diff --git a/src/compiler/x64/instruction-selector-x64-unittest.cc b/test/unittests/compiler/x64/instruction-selector-x64-unittest.cc similarity index 99% rename from src/compiler/x64/instruction-selector-x64-unittest.cc rename to test/unittests/compiler/x64/instruction-selector-x64-unittest.cc index 6bf15fd..7f52e44 100644 --- a/src/compiler/x64/instruction-selector-x64-unittest.cc +++ b/test/unittests/compiler/x64/instruction-selector-x64-unittest.cc @@ -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 { diff --git a/src/heap/gc-idle-time-handler-unittest.cc b/test/unittests/heap/gc-idle-time-handler-unittest.cc similarity index 100% rename from src/heap/gc-idle-time-handler-unittest.cc rename to test/unittests/heap/gc-idle-time-handler-unittest.cc diff --git a/src/libplatform/default-platform-unittest.cc b/test/unittests/libplatform/default-platform-unittest.cc similarity index 100% rename from src/libplatform/default-platform-unittest.cc rename to test/unittests/libplatform/default-platform-unittest.cc diff --git a/src/libplatform/task-queue-unittest.cc b/test/unittests/libplatform/task-queue-unittest.cc similarity index 100% rename from src/libplatform/task-queue-unittest.cc rename to test/unittests/libplatform/task-queue-unittest.cc diff --git a/src/libplatform/worker-thread-unittest.cc b/test/unittests/libplatform/worker-thread-unittest.cc similarity index 100% rename from src/libplatform/worker-thread-unittest.cc rename to test/unittests/libplatform/worker-thread-unittest.cc diff --git a/src/test/run-all-unittests.cc b/test/unittests/run-all-unittests.cc similarity index 100% rename from src/test/run-all-unittests.cc rename to test/unittests/run-all-unittests.cc diff --git a/src/test/test-utils.cc b/test/unittests/test-utils.cc similarity index 96% rename from src/test/test-utils.cc rename to test/unittests/test-utils.cc index 1041465..a3532dd 100644 --- a/src/test/test-utils.cc +++ b/test/unittests/test-utils.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 "src/test/test-utils.h" +#include "test/unittests/test-utils.h" #include "src/isolate-inl.h" diff --git a/src/test/test-utils.h b/test/unittests/test-utils.h similarity index 93% rename from src/test/test-utils.h rename to test/unittests/test-utils.h index 05d1ea6..e08974a 100644 --- a/src/test/test-utils.h +++ b/test/unittests/test-utils.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_ diff --git a/test/unittests/unittests.gyp b/test/unittests/unittests.gyp new file mode 100644 index 0000000..3bd558e --- /dev/null +++ b/test/unittests/unittests.gyp @@ -0,0 +1,117 @@ +# 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': 'unittests', + 'type': 'executable', + 'variables': { + 'optimize': 'max', + }, + 'dependencies': [ + '../../testing/gmock.gyp:gmock', + '../../testing/gtest.gyp:gtest', + '../../tools/gyp/v8.gyp:v8_libplatform', + ], + 'include_dirs': [ + '../..', + ], + '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', + ], + '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. + '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'], + }], + ], + }, + ], +} diff --git a/test/libplatform-unittests/libplatform-unittests.status b/test/unittests/unittests.status similarity index 100% rename from test/libplatform-unittests/libplatform-unittests.status rename to test/unittests/unittests.status diff --git a/tools/presubmit.py b/tools/presubmit.py index 8a6ff2a..3b58084 100755 --- a/tools/presubmit.py +++ b/tools/presubmit.py @@ -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): diff --git a/tools/run-tests.py b/tools/run-tests.py index c8481e6..670e574 100755 --- a/tools/run-tests.py +++ b/tools/run-tests.py @@ -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", ], } -- 2.7.4