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) |