summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cts/common/board.py6
-rwxr-xr-xcts/cts.py12
2 files changed, 11 insertions, 7 deletions
diff --git a/cts/common/board.py b/cts/common/board.py
index 68d447fb51..7b09e2a9f1 100644
--- a/cts/common/board.py
+++ b/cts/common/board.py
@@ -93,7 +93,7 @@ class Board(object):
for cmd in commands:
args += ['-c', cmd]
args += ['-c', 'shutdown']
- sp.call(args)
+ return sp.call(args)
def build(self, module, ec_dir, debug=False):
"""Builds test suite module for board
@@ -116,7 +116,7 @@ class Board(object):
cmds.append('CTS_DEBUG=TRUE')
print ' '.join(cmds)
- sp.call(cmds)
+ return sp.call(cmds)
def flash(self):
"""Flashes board with most recent build ec.bin"""
@@ -125,7 +125,7 @@ class Board(object):
'init',
'reset init',
'flash write_image erase %s %s' % (image_path, self.flash_offset)]
- self.send_open_ocd_commands(cmd)
+ return self.send_open_ocd_commands(cmd)
def to_string(self):
s = ('Type: Board\n'
diff --git a/cts/cts.py b/cts/cts.py
index 983b9751d2..2999e4d06f 100755
--- a/cts/cts.py
+++ b/cts/cts.py
@@ -94,14 +94,18 @@ class Cts(object):
def build(self):
"""Build images for DUT and TH"""
- self.dut.build(self.module, self.ec_dir, self.debug)
- self.th.build(self.module, self.ec_dir, self.debug)
+ if self.dut.build(self.module, self.ec_dir, self.debug):
+ raise RuntimeError('Building module %s for DUT failed' % (self.module))
+ if self.th.build(self.module, self.ec_dir, self.debug):
+ raise RuntimeError('Building module %s for TH failed' % (self.module))
def flash_boards(self):
"""Flashes th and dut boards with their most recently build ec.bin"""
self.identify_boards()
- self.th.flash()
- self.dut.flash()
+ if self.th.flash():
+ raise RuntimeError('Flashing TH failed')
+ if self.dut.flash():
+ raise RuntimeError('Flashing DUT failed')
def setup(self):
"""Setup boards"""