Make test-list a per-board parameter

Some tests are not applicable to all boards. This change makes test-list
a per-board parameter so a test can be enabled/disabled for individual
boards. Also disable all the tests that don't compile now.

BUG=chrome-os-partner:18598
TEST=make tests for all boards
BRANCH=None

Change-Id: Id2d18e23856f5c64dbdc7c6ca5949f8ad61b5cc0
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/49452
diff --git a/Makefile b/Makefile
index 2af1aa6..485a4f9 100644
--- a/Makefile
+++ b/Makefile
@@ -37,6 +37,7 @@
 	   $(shell $(CPP) $(CPPFLAGS) -P -dN board/$(BOARD)/board.h | \
 		grep -o "CONFIG_.*")
 $(foreach c,$(_tsk_cfg) $(_flag_cfg),$(eval $(c)=y))
+$(eval BOARD_$(BOARD)=y)
 
 # Get build configuration from sub-directories
 -include private/build.mk
diff --git a/Makefile.rules b/Makefile.rules
index c6868ec..9a1f986 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -55,8 +55,8 @@
 
 utils: $(build-utils) $(host-utils)
 
-test-targets=$(foreach t,$(test-list),test-$(t))
-qemu-test-targets=$(foreach t,$(test-list),qemu-$(t))
+test-targets=$(foreach t,$(test-list-y),test-$(t))
+qemu-test-targets=$(foreach t,$(test-list-y),qemu-$(t))
 .PHONY: $(qemu-test-target) $(test-targets)
 
 $(test-targets): test-%:
diff --git a/test/build.mk b/test/build.mk
index 6155285..ead4dea 100644
--- a/test/build.mk
+++ b/test/build.mk
@@ -6,11 +6,24 @@
 # on-board test binaries build
 #
 
-test-list=pingpong timer_calib timer_dos timer_jump mutex thermal
-test-list+=power_button kb_scan scancode typematic charging flash
-test-list+=stress utils
+test-list-y=pingpong timer_calib timer_dos timer_jump mutex utils
 #disable: powerdemo
 
+# TODO(victoryang): Fix these tests:
+#    thermal power_button scancode typematic charging
+
+test-list-$(BOARD_bds)+=
+test-list-$(BOARD_daisy)+=kb_scan flash stress
+test-list-$(BOARD_mccroskey)+=flash
+test-list-$(BOARD_pit)+=kb_scan flash stress
+test-list-$(BOARD_snow)+=kb_scan flash stress
+test-list-$(BOARD_spring)+=kb_scan flash stress
+
+# Disable x86 boards until they compiles
+# TODO(victoryang): Fix them
+test-list-$(BOARD_link)=
+test-list-$(BOARD_slippy)=
+
 flash-y=flash.o
 kb_scan-y=kb_scan.o
 mutex-y=mutex.o