Index: test/mjsunit/testcfg.py |
diff --git a/test/mjsunit/testcfg.py b/test/mjsunit/testcfg.py |
index 181c8478fed289ffb6ea195279947c296a5374f3..8389696f49fabf7089035ef1c9b4c5304963be79 100644 |
--- a/test/mjsunit/testcfg.py |
+++ b/test/mjsunit/testcfg.py |
@@ -34,6 +34,7 @@ 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") |
+MODULE_PATTERN = re.compile(r"^// MODULE$", flags=re.MULTILINE) |
class MjsunitTestSuite(testsuite.TestSuite): |
@@ -80,6 +81,9 @@ class MjsunitTestSuite(testsuite.TestSuite): |
if not context.no_harness: |
files.append(os.path.join(self.root, "mjsunit.js")) |
+ |
+ if MODULE_PATTERN.search(source): |
+ files.append("--module") |
files.append(testfilename) |
flags += files |