Commit eb7c56c8 authored by Michael Achenbach's avatar Michael Achenbach Committed by Commit Bot

[test] Fix resource regexp for Android

The regexp for finding resources to be pushed to Android devices was
too lax. On empty strings it tried to check for more resources on a
directory and hung.

The last test262 roll contains tests with empty imports that started
hanging in this way.

TBR=neis@chromium.org
NOTRY=true

Bug: v8:7834
Change-Id: Ie58f1b18bdd99b7b40c1fb39b25e2f481932e0f3
Reviewed-on: https://chromium-review.googlesource.com/c/1270579Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
Reviewed-by: 's avatarMichael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56465}
parent b859988a
...@@ -43,15 +43,15 @@ RESOURCES_PATTERN = re.compile(r"//\s+Resources:(.*)") ...@@ -43,15 +43,15 @@ RESOURCES_PATTERN = re.compile(r"//\s+Resources:(.*)")
# Pattern to auto-detect files to push on Android for statements like: # Pattern to auto-detect files to push on Android for statements like:
# load("path/to/file.js") # load("path/to/file.js")
LOAD_PATTERN = re.compile( LOAD_PATTERN = re.compile(
r"(?:load|readbuffer|read)\((?:'|\")([^'\"]*)(?:'|\")\)") r"(?:load|readbuffer|read)\((?:'|\")([^'\"]+)(?:'|\")\)")
# Pattern to auto-detect files to push on Android for statements like: # Pattern to auto-detect files to push on Android for statements like:
# import "path/to/file.js" # import "path/to/file.js"
MODULE_RESOURCES_PATTERN_1 = re.compile( MODULE_RESOURCES_PATTERN_1 = re.compile(
r"(?:import|export)(?:\(| )(?:'|\")([^'\"]*)(?:'|\")") r"(?:import|export)(?:\(| )(?:'|\")([^'\"]+)(?:'|\")")
# Pattern to auto-detect files to push on Android for statements like: # Pattern to auto-detect files to push on Android for statements like:
# import foobar from "path/to/file.js" # import foobar from "path/to/file.js"
MODULE_RESOURCES_PATTERN_2 = re.compile( MODULE_RESOURCES_PATTERN_2 = re.compile(
r"(?:import|export).*from (?:'|\")([^'\"]*)(?:'|\")") r"(?:import|export).*from (?:'|\")([^'\"]+)(?:'|\")")
class TestCase(object): class TestCase(object):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment