cts: Build CTS suites in buildall

We need to (at least) build CTS for all boards & suites supported by CTS.
This will prevent our investment from accidentally being broken.

BUG=chromium:627252
BRANCH=none
TEST=make buildall builds CTS suites

Change-Id: Ib7bceaafd5e27ce9285b9d1bf35339bf6b04ba72
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/359947
This commit is contained in:
Daisuke Nojiri
2016-07-11 16:32:59 -07:00
committed by chrome-bot
parent 49312e06cd
commit b6e7520da4

View File

@@ -100,6 +100,7 @@ buildall:
@mkdir $(FAILED_BOARDS_DIR)
@for b in $(boards); do echo 'starting' > $(FAILED_BOARDS_DIR)/$$b; done
$(MAKE) try_buildall
$(MAKE) build_cts
$(MAKE) runtests
@touch .tests-passed
@echo "$@ completed successfully!"
@@ -175,6 +176,44 @@ $(run-test-targets): run-%: host-%
hosttests: $(host-test-targets)
runtests: $(run-test-targets)
# Automatically enumerate all suites.
cts_excludes := common
cts_suites := $(filter-out $(cts_excludes), \
$(shell find cts -maxdepth 1 -mindepth 1 -type d -printf "%f "))
# Add boards below as CTS is expanded.
cts_boards := stm32l476g-eval nucleo-f072rb
.PHONY: build_cts
# 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
# Create rules for all cts-suite-board combinations. Additionally, we serialize
# targets per board: cts-x-board -> cts-y-board -> ...
# 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)) \
) \
)
cov-test-targets=$(foreach t,$(test-list-host),build/host/$(t).info)
bldversion=$(shell (./util/getversion.sh ; echo VERSION) | $(CPP) -P)