Commit fd9c2391 authored by Feng Yu's avatar Feng Yu Committed by V8 LUCI CQ

[test] Migrate cctest/test-parsing to unittests/

- move cctest/test-parsing -> unittests/parser/parsing-unittest
- move common/{scope-test-helper, unicode-helper} to unittests/parser
  directory because these are only be used by tests in unittests/parser


Bug: v8:12781
Change-Id: Ie0fb043d5df6178bbe088d140a76f606454bbf29
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3855313Reviewed-by: 's avatarMarja Hölttä <marja@chromium.org>
Commit-Queue: Feng Yu <f3n67u@gmail.com>
Cr-Commit-Position: refs/heads/main@{#82837}
parent b82cc92e
......@@ -86,9 +86,6 @@ v8_source_set("cctest_sources") {
"../common/call-tester.h",
"../common/flag-utils.h",
"../common/node-observer-tester.h",
"../common/scope-test-helper.h",
"../common/unicode-helpers.cc",
"../common/unicode-helpers.h",
"../common/value-helper.cc",
"../common/value-helper.h",
"cctest-utils.h",
......@@ -184,7 +181,6 @@ v8_source_set("cctest_sources") {
"test-lockers.cc",
"test-mementos.cc",
"test-orderedhashtable.cc",
"test-parsing.cc",
"test-profile-generator.cc",
"test-property-details.cc",
"test-ptr-compr-cage.cc",
......
......@@ -54,11 +54,6 @@
# Boot up memory use is bloated in debug mode.
'test-mark-compact/BootUpMemoryUse': [PASS, ['mode == debug', FAIL]],
# This tests only that the preparser and parser agree, so there is no point in
# running several variants. Note that this still takes ages, because there
# are actually 13 * 38 * 5 * 128 = 316160 individual tests hidden here.
'test-parsing/ParserSync': [PASS, NO_VARIANTS],
# This tests API threading, no point in running several variants.
'test-api/Threading*': [PASS, SLOW, NO_VARIANTS],
......@@ -104,7 +99,6 @@
'test-jump-table-assembler/JumpTablePatchingStress': [PASS, SLOW],
'test-strings/StringOOM*': [PASS, ['mode == debug', SKIP]],
'test-serialize/CustomSnapshotDataBlobImmortalImmovableRoots': [PASS, ['mode == debug', SKIP]],
'test-parsing/ObjectRestNegativeTestSlow': [PASS, ['mode == debug', SKIP]],
# Tests that need to run sequentially (e.g. due to memory consumption).
'test-accessors/HandleScopePop': [PASS, HEAVY],
......@@ -342,7 +336,6 @@
'test-api/ExternalArrays': [PASS, NO_VARIANTS],
# TODO(mips-team): Currently fails on mips board.
'test-parsing/TooManyArguments': [SKIP],
'test-api/Threading5': [SKIP],
'test-api/Threading6': [SKIP],
}], # 'arch == mips'
......@@ -526,7 +519,6 @@
'test-serialize/*': [SKIP],
'test-strings/*': [SKIP],
'test-field-type-tracking/*': [SKIP],
'test-parsing/*': [SKIP],
'test-page-promotion/*': [SKIP],
'test-gap-resolver/*': [SKIP],
'test-dtoa/*': [SKIP],
......
......@@ -230,9 +230,6 @@ v8_source_set("unittests_sources") {
"../common/c-signature.h",
"../common/call-tester.h",
"../common/node-observer-tester.h",
"../common/scope-test-helper.h",
"../common/unicode-helpers.cc",
"../common/unicode-helpers.h",
"../common/value-helper.cc",
"../common/value-helper.h",
"api/access-check-unittest.cc",
......@@ -490,9 +487,13 @@ v8_source_set("unittests_sources") {
"parser/ast-value-unittest.cc",
"parser/decls-unittest.cc",
"parser/parse-decision-unittest.cc",
"parser/parsing-unittest.cc",
"parser/preparser-unittest.cc",
"parser/scanner-streams-unittest.cc",
"parser/scanner-unittest.cc",
"parser/scope-test-helper.h",
"parser/unicode-helpers.cc",
"parser/unicode-helpers.h",
"profiler/circular-queue-unittest.cc",
"profiler/strings-storage-unittest.cc",
"regexp/regexp-unittest.cc",
......
......@@ -5,7 +5,7 @@
// Test specific cases of the lazy/eager-parse decision.
//
// Note that presently most unit tests for parsing are found in
// cctest/test-parsing.cc.
// parsing-unittest.cc.
#include <unordered_map>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -12,8 +12,8 @@
#include "src/parsing/parsing.h"
#include "src/parsing/preparse-data-impl.h"
#include "src/parsing/preparse-data.h"
#include "test/common/scope-test-helper.h"
#include "test/common/unicode-helpers.h"
#include "test/unittests/parser/scope-test-helper.h"
#include "test/unittests/parser/unicode-helpers.h"
#include "test/unittests/test-helpers.h"
#include "test/unittests/test-utils.h"
#include "testing/gtest/include/gtest/gtest.h"
......
......@@ -3,7 +3,7 @@
// found in the LICENSE file.
// Tests v8::internal::Scanner. Note that presently most unit tests for the
// Scanner are in cctest/test-parsing.cc, rather than here.
// Scanner are in parsing-unittest.cc, rather than here.
#include "src/parsing/scanner.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_COMMON_SCOPE_TEST_HELPER_H_
#define V8_COMMON_SCOPE_TEST_HELPER_H_
#ifndef V8_UNITTESTS_PARSER_SCOPE_TEST_HELPER_H_
#define V8_UNITTESTS_PARSER_SCOPE_TEST_HELPER_H_
#include "src/ast/scopes.h"
#include "src/ast/variables.h"
......@@ -120,4 +120,4 @@ class ScopeTestHelper {
} // namespace internal
} // namespace v8
#endif // V8_COMMON_SCOPE_TEST_HELPER_H_
#endif // V8_UNITTESTS_PARSER_SCOPE_TEST_HELPER_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/common/unicode-helpers.h"
#include "test/unittests/parser/unicode-helpers.h"
#include "src/strings/unicode-inl.h"
......
......@@ -2,12 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef V8_COMMON_UNICODE_HELPERS_H_
#define V8_COMMON_UNICODE_HELPERS_H_
#ifndef V8_UNITTESTS_PARSER_UNICODE_HELPERS_H_
#define V8_UNITTESTS_PARSER_UNICODE_HELPERS_H_
#include "src/strings/unicode.h"
int Ucs2CharLength(unibrow::uchar c);
int Utf8LengthHelper(const char* s);
#endif // V8_COMMON_UNICODE_HELPERS_H_
#endif // V8_UNITTESTS_PARSER_UNICODE_HELPERS_H_
......@@ -189,6 +189,13 @@ class WithIsolateScopeMixin : public TMixin {
}
}
void ExpectString(const char* code, const char* expected) {
v8::Local<v8::Value> result = RunJS(code);
CHECK(result->IsString());
v8::String::Utf8Value utf8(v8::Isolate::GetCurrent(), result);
CHECK_EQ(0, strcmp(expected, *utf8));
}
private:
Local<Value> RunJS(Local<String> source) {
return TryRunJS(source).ToLocalChecked();
......
......@@ -24,6 +24,14 @@
'WeakMapsTest.Shrinking': [FAIL],
'WeakSetsTest.WeakSet_Shrinking': [FAIL],
# This tests only that the preparser and parser agree, so there is no point in
# running several variants. Note that this still takes ages, because there
# are actually 13 * 38 * 5 * 128 = 316160 individual tests hidden here.
'ParsingTest.ParserSync': [PASS, NO_VARIANTS],
# Slow tests.
'ParsingTest.ObjectRestNegativeTestSlow': [PASS, ['mode == debug', SKIP]],
}], # ALWAYS
##############################################################################
......@@ -94,6 +102,12 @@
'BytecodeGeneratorTest.WideRegisters': [SKIP],
}], # arch == ppc64
##############################################################################
['arch == mips', {
# TODO(mips-team): Currently fails on mips board.
'ParsingTest.TooManyArguments': [SKIP],
}], # 'arch == mips'
##############################################################################
['system == windows and asan', {
# BUG(893437).
......@@ -303,6 +317,7 @@
'DtoaTest.*': [SKIP],
'DeclsTest.*': [SKIP],
'GlobalHandlesTest.*': [SKIP],
'ParsingTest/*': [SKIP],
}], # variant == no_wasm_traps
##############################################################################
......
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