Reviewers: Sven Panne,
Message:
svenpanne, ptal
Description:
Make the ParserSync test faster (and re-enable it).
Most of the run time came from testing with all possible flag combinations.
None
of the flags passed affect the test, and there are specialized tests for
testing
the features behind the flags; no need to slow down the generic test.
With these changes, run time for debug build goes from 186 s to 0.5 s.
In addition, fixed some missing commas between the test cases.
[email protected]
BUG=v8:3707
LOG=N
Please review this at https://codereview.chromium.org/766673003/
Base URL: https://chromium.googlesource.com/v8/v8.git@master
Affected files (+5, -18 lines):
M test/cctest/test-parsing.cc
Index: test/cctest/test-parsing.cc
diff --git a/test/cctest/test-parsing.cc b/test/cctest/test-parsing.cc
index
4e2f828a60c3c660edf7bef7d6814d74dd9ec06b..d1822fa3ca4d3fa03c1d5c027ed76a807b922667
100644
--- a/test/cctest/test-parsing.cc
+++ b/test/cctest/test-parsing.cc
@@ -1519,9 +1519,7 @@ void TestParserSync(const char* source,
}
-// TODO(marja) This needs to be turned into a fuzzing test, trying all
those
-// combinations below takes at least 2 orders of magnitude too long.
-DISABLED_TEST(ParserSync) {
+TEST(ParserSync) {
const char* context_data[][2] = {
{ "", "" },
{ "{", "}" },
@@ -1550,7 +1548,7 @@ DISABLED_TEST(ParserSync) {
"if (false) {} else ;",
"if (false) {} else {}",
"if (false) {} else 12",
- "if (false) ;"
+ "if (false) ;",
"if (false) {}",
"if (false) 12",
"do {} while (false)",
@@ -1570,8 +1568,8 @@ DISABLED_TEST(ParserSync) {
"with ({}) ;",
"with ({}) {}",
"with ({}) 12",
- "switch ({}) { default: }"
- "label3: "
+ "switch ({}) { default: }",
+ "label3: ",
"throw",
"throw 12",
"throw\n12",
@@ -1598,17 +1596,6 @@ DISABLED_TEST(ParserSync) {
CcTest::i_isolate()->stack_guard()->SetStackLimit(
i::GetCurrentStackPosition() - 128 * 1024);
- static const ParserFlag flags1[] = {
- kAllowHarmonyArrowFunctions,
- kAllowHarmonyClasses,
- kAllowHarmonyNumericLiterals,
- kAllowHarmonyObjectLiterals,
- kAllowHarmonyScoping,
- kAllowHarmonyModules,
- kAllowHarmonySloppy,
- kAllowLazy,
- };
-
for (int i = 0; context_data[i][0] != NULL; ++i) {
for (int j = 0; statement_data[j] != NULL; ++j) {
for (int k = 0; termination_data[k] != NULL; ++k) {
@@ -1628,7 +1615,7 @@ DISABLED_TEST(ParserSync) {
termination_data[k],
context_data[i][1]);
CHECK(length == kProgramSize);
- TestParserSync(program.start(), flags1, arraysize(flags1));
+ TestParserSync(program.start(), NULL, 0);
}
}
}
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.