Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(57)

Unified Diff: test/preparser/testcfg.py

Issue 1782173005: [testing] Move the last JS tests out of "preparser". (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_cleanup-test-preparser-2
Patch Set: Addressed comments. Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/preparser/symbols-only.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/preparser/testcfg.py
diff --git a/test/preparser/testcfg.py b/test/preparser/testcfg.py
index 2070c8cee2b2e0967fbec0f3b3235a555629b319..c55e4a85a81912b07deb32cf9e1554ae92ef0714 100644
--- a/test/preparser/testcfg.py
+++ b/test/preparser/testcfg.py
@@ -27,17 +27,11 @@
import os
-import re
from testrunner.local import testsuite
-from testrunner.local import utils
from testrunner.objects import testcase
-FLAGS_PATTERN = re.compile(r"//\s+Flags:(.*)")
-INVALID_FLAGS = ["--enable-slow-asserts"]
-
-
class PreparserTestSuite(testsuite.TestSuite):
def __init__(self, name, root):
super(PreparserTestSuite, self).__init__(name, root)
@@ -70,14 +64,6 @@ class PreparserTestSuite(testsuite.TestSuite):
def ListTests(self, context):
result = []
- # Find all .js files in this directory.
- filenames = [f[:-3] for f in os.listdir(self.root) if f.endswith(".js")]
- filenames.sort()
- for f in filenames:
- flags = [f + ".js"]
- test = testcase.TestCase(self, f, flags=flags)
- result.append(test)
-
# Find all .pyt files in this directory.
filenames = [f[:-4] for f in os.listdir(self.root) if f.endswith(".pyt")]
filenames.sort()
@@ -86,25 +72,11 @@ class PreparserTestSuite(testsuite.TestSuite):
return result
def GetFlagsForTestCase(self, testcase, context):
- first = testcase.flags[0]
- if first != "-e":
- testcase.flags[0] = os.path.join(self.root, first)
- source = self.GetSourceForTest(testcase)
- result = []
- flags_match = re.findall(FLAGS_PATTERN, source)
- for match in flags_match:
- result += match.strip().split()
- result += context.mode_flags
- result = [x for x in result if x not in INVALID_FLAGS]
- result.append(os.path.join(self.root, testcase.path + ".js"))
- return testcase.flags + result
return testcase.flags
def GetSourceForTest(self, testcase):
- if testcase.flags[0] == "-e":
- return testcase.flags[1]
- with open(testcase.flags[0]) as f:
- return f.read()
+ assert testcase.flags[0] == "-e"
+ return testcase.flags[1]
def _VariantGeneratorFactory(self):
return testsuite.StandardVariantGenerator
« no previous file with comments | « test/preparser/symbols-only.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698