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

Unified Diff: test/intl/testcfg.py

Issue 1812673005: Use ICU case conversion/transliterator for case conversion behind a flag (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Yang's comment addressed - return right away for no-change Created 4 years, 7 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/intl/testcfg.py b/test/intl/testcfg.py
index 6e4b4f15df9e5977fa9fcac47de3f1c3d9e98473..c7f17bbb5706f60e4da61135a2f9aeff2f9176e6 100644
--- a/test/intl/testcfg.py
+++ b/test/intl/testcfg.py
@@ -26,10 +26,12 @@
# 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:(.*)")
class IntlTestSuite(testsuite.TestSuite):
@@ -55,7 +57,11 @@ class IntlTestSuite(testsuite.TestSuite):
return tests
def GetFlagsForTestCase(self, testcase, context):
+ source = self.GetSourceForTest(testcase)
flags = ["--allow-natives-syntax"] + context.mode_flags
+ flags_match = re.findall(FLAGS_PATTERN, source)
+ for match in flags_match:
+ flags += match.strip().split()
files = []
files.append(os.path.join(self.root, "assert.js"))
@@ -71,6 +77,10 @@ class IntlTestSuite(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 IntlTestSuite(name, root)

Powered by Google App Engine
This is Rietveld 408576698