mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-09-02 19:32:34 +01:00
workloads/pcmark: Fix reading results in python3
Ensure that the results file is decoded when using python3.
This commit is contained in:
@@ -14,6 +14,7 @@
|
|||||||
#
|
#
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
import sys
|
||||||
import zipfile
|
import zipfile
|
||||||
|
|
||||||
from wa import ApkUiautoWorkload
|
from wa import ApkUiautoWorkload
|
||||||
@@ -58,6 +59,8 @@ class PcMark(ApkUiautoWorkload):
|
|||||||
def update_output(self, context):
|
def update_output(self, context):
|
||||||
expected_results = len(self.regex_matches)
|
expected_results = len(self.regex_matches)
|
||||||
zf = zipfile.ZipFile(os.path.join(context.output_directory, self.result_file), 'r').read('Result.xml')
|
zf = zipfile.ZipFile(os.path.join(context.output_directory, self.result_file), 'r').read('Result.xml')
|
||||||
|
if sys.version_info[0] == 3:
|
||||||
|
zf = zf.decode(sys.stdout.encoding)
|
||||||
for line in zf.split('\n'):
|
for line in zf.split('\n'):
|
||||||
for regex in self.regex_matches:
|
for regex in self.regex_matches:
|
||||||
match = regex.search(line)
|
match = regex.search(line)
|
||||||
|
Reference in New Issue
Block a user