aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Bonnici <marc.bonnici@arm.com>2018-03-23 12:04:24 +0000
committersetrofim <setrofim@gmail.com>2018-03-26 14:08:33 +0100
commit120ea20ea0499042d5837acab4e5a1701101f297 (patch)
tree47fea73efdf61bbddff363f2226d7f4c34fa2cfb
parent72f2f8259480717c31d036047caf4380d1916121 (diff)
workloads/dhrystone: Fix crash if workload did not complete
Only try to process output from the workload if it is available.
-rw-r--r--wa/workloads/dhrystone/__init__.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/wa/workloads/dhrystone/__init__.py b/wa/workloads/dhrystone/__init__.py
index c05393f0..1958b4d1 100644
--- a/wa/workloads/dhrystone/__init__.py
+++ b/wa/workloads/dhrystone/__init__.py
@@ -100,6 +100,7 @@ class Dhrystone(Workload):
self.target.killall('dhrystone')
def run(self, context):
+ self.output = None
try:
self.output = self.target.execute(self.command,
timeout=self.timeout,
@@ -109,12 +110,16 @@ class Dhrystone(Workload):
raise
def extract_results(self, context):
- outfile = os.path.join(context.output_directory, 'dhrystone.output')
- with open(outfile, 'w') as wfh:
- wfh.write(self.output)
- context.add_artifact('dhrystone-output', outfile, 'raw', "dhrystone's stdout")
+ if self.output:
+ outfile = os.path.join(context.output_directory, 'dhrystone.output')
+ with open(outfile, 'w') as wfh:
+ wfh.write(self.output)
+ context.add_artifact('dhrystone-output', outfile, 'raw', "dhrystone's stdout")
def update_output(self, context):
+ if not self.output:
+ return
+
score_count = 0
dmips_count = 0
total_score = 0