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

Unified Diff: test/intl/testcfg.py

Issue 18687003: Import intl test suite from v8-i18n project (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 5 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
Index: test/intl/testcfg.py
diff --git a/test/mjsunit/testcfg.py b/test/intl/testcfg.py
similarity index 60%
copy from test/mjsunit/testcfg.py
copy to test/intl/testcfg.py
index c960ce6b30107e167ad4576f24d0e29594444fd8..d25683bed2c752500054f73b60107b1a7bebddff 100644
--- a/test/mjsunit/testcfg.py
+++ b/test/intl/testcfg.py
@@ -1,4 +1,4 @@
-# Copyright 2008 the V8 project authors. All rights reserved.
+# Copyright 2013 the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
@@ -26,20 +26,15 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import os
-import re
from testrunner.local import testsuite
from testrunner.objects import testcase
-FLAGS_PATTERN = re.compile(r"//\s+Flags:(.*)")
-FILES_PATTERN = re.compile(r"//\s+Files:(.*)")
-SELF_SCRIPT_PATTERN = re.compile(r"//\s+Env: TEST_FILE_NAME")
-
-class MjsunitTestSuite(testsuite.TestSuite):
+class IntlTestSuite(testsuite.TestSuite):
def __init__(self, name, root):
- super(MjsunitTestSuite, self).__init__(name, root)
+ super(IntlTestSuite, self).__init__(name, root)
def ListTests(self, context):
tests = []
@@ -49,36 +44,21 @@ class MjsunitTestSuite(testsuite.TestSuite):
dirs.sort()
files.sort()
for filename in files:
- if filename.endswith(".js") and filename != "mjsunit.js":
+ if (filename.endswith(".js") and filename != "assert.js" and
+ filename != "utils.js"):
testname = os.path.join(dirname[len(self.root) + 1:], filename[:-3])
test = testcase.TestCase(self, testname)
tests.append(test)
return tests
def GetFlagsForTestCase(self, testcase, context):
- source = self.GetSourceForTest(testcase)
flags = [] + context.mode_flags
- flags_match = re.findall(FLAGS_PATTERN, source)
- for match in flags_match:
- flags += match.strip().split()
- files_list = [] # List of file names to append to command arguments.
- files_match = FILES_PATTERN.search(source);
- # Accept several lines of 'Files:'.
- while True:
- if files_match:
- files_list += files_match.group(1).strip().split()
- files_match = FILES_PATTERN.search(source, files_match.end())
- else:
- break
- files = [ os.path.normpath(os.path.join(self.root, '..', '..', f))
- for f in files_list ]
- testfilename = os.path.join(self.root, testcase.path + self.suffix())
- if SELF_SCRIPT_PATTERN.search(source):
- env = ["-e", "TEST_FILE_NAME=\"%s\"" % testfilename.replace("\\", "\\\\")]
- files = env + files
- files.append(os.path.join(self.root, "mjsunit.js"))
- files.append(testfilename)
+ files = []
+ files.append(os.path.join(self.root, "assert.js"))
+ files.append(os.path.join(self.root, "utils.js"))
+ files.append(os.path.join(self.root, "date-format", "utils.js"))
+ files.append(os.path.join(self.root, testcase.path + self.suffix()))
flags += files
if context.isolates:
@@ -87,11 +67,6 @@ class MjsunitTestSuite(testsuite.TestSuite):
return testcase.flags + flags
- def GetSourceForTest(self, testcase):
- filename = os.path.join(self.root, testcase.path + self.suffix())
- with open(filename) as f:
- return f.read()
-
def GetSuite(name, root):
- return MjsunitTestSuite(name, root)
+ return IntlTestSuite(name, root)

Powered by Google App Engine
This is Rietveld 408576698