summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAníbal Limón <anibal.limon@linaro.org>2017-11-29 11:54:30 -0600
committerMilosz Wasilewski <milosz.wasilewski@linaro.org>2017-11-29 21:14:13 +0000
commitc36cb79a51674d93db3da5e5b84b9e49dd80af56 (patch)
tree797b352217d5c764f79d7250d6bd17c34b15b6ef
parenta333adddb6ef2146268279f55cbc197eb534c940 (diff)
downloadtest-definitios-no-nfs-c36cb79a51674d93db3da5e5b84b9e49dd80af56.tar.gz
automated/utils/test-runner.py: Compile the pattern regex before use
If a pattern regex is specified is used many times to parse the stdout log to get results so is better to do a previous compile to speed up parsing. Change-Id: I9b37f35b4eded276144508b8ec255938fad19618 Signed-off-by: Aníbal Limón <anibal.limon@linaro.org>
-rwxr-xr-xautomated/utils/test-runner.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/automated/utils/test-runner.py b/automated/utils/test-runner.py
index 4632f84..af640fd 100755
--- a/automated/utils/test-runner.py
+++ b/automated/utils/test-runner.py
@@ -748,9 +748,10 @@ class ResultParser(object):
def parse_pattern(self):
with open('%s/stdout.log' % self.test['test_path'], 'r') as f:
+ rex_pattern = re.compile(r'%s' % self.pattern)
for line in f:
data = {}
- m = re.search(r'%s' % self.pattern, line)
+ m = rex_pattern.search(line)
if m:
data = m.groupdict()
for x in ['measurement', 'units']: