Commit 044549b9 authored by ripp's avatar ripp Committed by Commit bot

Fixed extraction of emulated devices name

The adb_logcat_* scripts are extract attached devices names with
pattern 'w+', but it only works for real devices. Emulated devices
have names in form of 'emulator-5554' and '-' sign is not matched
by 'w+' parrent. This causes to logcat output to be missed while
tests are running

R=frankf@chromium.org, craigdh@chromium.org

TEST=Run tests with only emulators attached, ensure that resulting
log contains logcal output

Review URL: https://codereview.chromium.org/661843003

Cr-Commit-Position: refs/heads/master@{#300242}
parent 48ab3a66
......@@ -83,7 +83,7 @@ def GetAttachedDevices(adb_cmd):
stderr=subprocess.PIPE).communicate()
if err:
logging.warning('adb device error %s', err.strip())
return re.findall('^(\w+)\tdevice$', out, re.MULTILINE)
return re.findall('^(\S+)\tdevice$', out, re.MULTILINE)
except TimeoutException:
logging.warning('"adb devices" command timed out')
return []
......
......@@ -78,7 +78,7 @@ def FindLogFiles(base_dir):
Returns:
Mapping of device_id to a sorted list of file paths for a given device
"""
logcat_filter = re.compile(r'^logcat_(\w+)_(\d+)$')
logcat_filter = re.compile(r'^logcat_(\S+)_(\d+)$')
# list of tuples (<device_id>, <seq num>, <full file path>)
filtered_list = []
for cur_file in os.listdir(base_dir):
......
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