summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile5
-rw-r--r--Makefile.rules11
-rw-r--r--cts/common/board.py6
-rwxr-xr-xcts/cts.py9
4 files changed, 16 insertions, 15 deletions
diff --git a/Makefile b/Makefile
index 3b5c4e70d4..912c6ab64d 100644
--- a/Makefile
+++ b/Makefile
@@ -23,7 +23,12 @@ endif
PROJECT?=ec
# Output directory for build objects
+ifdef CTS_MODULE
+# CTS builds need different directories per board per suite.
+out?=build/$(BOARD)/cts_$(CTS_MODULE)
+else
out?=build/$(BOARD)
+endif
# File containing configuration information
config=$(out)/.config
diff --git a/Makefile.rules b/Makefile.rules
index 4f11ba1e55..4d028149e7 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -185,17 +185,10 @@ cts_boards := stm32l476g-eval nucleo-f072rb
# Create CTS rule automatically for given suite and board
# $1: suite name
# $2: board name
-# $3: suite name used in the previous loop
define make-cts =
-ifneq ($$(filter $(1),$$(cts_suites)),)
-ifneq ($$(filter $(3),$$(cts_suites)),)
-# Serialize builds
-cts-$(1)-$(2): cts-$(3)-$(2)
-endif
build_cts: cts-$(1)-$(2)
cts-$(1)-$(2):
$$(MAKE) CTS_MODULE=$(1) BOARD=$(2)
-endif
# Do not remove this blank line
endef
@@ -205,8 +198,8 @@ endef
# If we don't serialize targets, parallel make fails because all suites
# try to produce ec.bin in the same directory (e.g. build/stm32l476g-eval).
$(foreach b, $(cts_boards), \
- $(foreach s, $(cts_suites) none, \
- $(eval $(call make-cts,$(s),$(b),$(prev)) prev:=$(s)) \
+ $(foreach s, $(cts_suites), \
+ $(eval $(call make-cts,$(s),$(b))) \
) \
)
diff --git a/cts/common/board.py b/cts/common/board.py
index a36ca1a3a7..42479e6de3 100644
--- a/cts/common/board.py
+++ b/cts/common/board.py
@@ -109,8 +109,7 @@ class Board(object):
'--directory=' + ec_dir,
'BOARD=' + self.board,
'CTS_MODULE=' + module,
- '-j',
- '-B']
+ '-j']
if debug:
cmds.append('CTS_DEBUG=TRUE')
@@ -118,9 +117,8 @@ class Board(object):
print ' '.join(cmds)
return sp.call(cmds)
- def flash(self):
+ def flash(self, image_path):
"""Flashes board with most recent build ec.bin"""
- image_path = os.path.join('build', self.board, 'ec.bin')
cmd = ['reset_config connect_assert_srst',
'init',
'reset init',
diff --git a/cts/cts.py b/cts/cts.py
index 6a02b065bc..2d2e824cbc 100755
--- a/cts/cts.py
+++ b/cts/cts.py
@@ -101,10 +101,15 @@ class Cts(object):
def flash_boards(self):
"""Flashes th and dut boards with their most recently build ec.bin"""
+ cts_module = 'cts_' + self.module
+ image_path = os.path.join('build', self.th.board, cts_module, 'ec.bin')
self.identify_boards()
- if self.th.flash():
+ print 'Flashing TH with', image_path
+ if self.th.flash(image_path):
raise RuntimeError('Flashing TH failed')
- if self.dut.flash():
+ image_path = os.path.join('build', self.dut.board, cts_module, 'ec.bin')
+ print 'Flashing DUT with', image_path
+ if self.dut.flash(image_path):
raise RuntimeError('Flashing DUT failed')
def setup(self):