diff options
Diffstat (limited to 'deps/v8/tools/testrunner/local/statusfile.py')
-rw-r--r-- | deps/v8/tools/testrunner/local/statusfile.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/deps/v8/tools/testrunner/local/statusfile.py b/deps/v8/tools/testrunner/local/statusfile.py index e4778326a9..db07a62885 100644 --- a/deps/v8/tools/testrunner/local/statusfile.py +++ b/deps/v8/tools/testrunner/local/statusfile.py @@ -300,6 +300,8 @@ JS_TEST_PATHS = { 'webkit': [[]], } +FILE_EXTENSIONS = [".js", ".mjs"] + def PresubmitCheck(path): with open(path) as f: contents = ReadContent(f.read()) @@ -326,8 +328,11 @@ def PresubmitCheck(path): _assert('*' not in rule or (rule.count('*') == 1 and rule[-1] == '*'), "Only the last character of a rule key can be a wildcard") if basename in JS_TEST_PATHS and '*' not in rule: - _assert(any(os.path.exists(os.path.join(os.path.dirname(path), - *(paths + [rule + ".js"]))) + def _any_exist(paths): + return any(os.path.exists(os.path.join(os.path.dirname(path), + *(paths + [rule + ext]))) + for ext in FILE_EXTENSIONS) + _assert(any(_any_exist(paths) for paths in JS_TEST_PATHS[basename]), "missing file for %s test %s" % (basename, rule)) return status["success"] |