summaryrefslogtreecommitdiff
path: root/cts/cts.py
diff options
context:
space:
mode:
authorDaisuke Nojiri <dnojiri@chromium.org>2016-09-30 16:37:48 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-10-05 14:33:33 -0700
commita51cee362a5682e83ceee290ee878a13a4f00212 (patch)
treea2c0629bc7794c9c677006b4fcd84a64630cc60d /cts/cts.py
parente40fb3ef58a47d13418b2b6665026cf2ae5fd51e (diff)
downloadchrome-ec-a51cee362a5682e83ceee290ee878a13a4f00212.tar.gz
cts: Fail script when build or flash fails
This change makes cts.py fail when building or flashing a module for DUT or TH fails. BUG=none BRANCH=none TEST=Made cts.py fail by injecting build and flash error Change-Id: Iec1e11f4a8c261eb4c989b118df218e86cb6f5f1 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/393326 Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'cts/cts.py')
-rwxr-xr-xcts/cts.py12
1 files changed, 8 insertions, 4 deletions
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"""