summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDuncan Laurie <dlaurie@chromium.org>2013-08-09 13:46:22 -0700
committerChromeBot <chrome-bot@google.com>2013-08-09 13:52:05 -0700
commit76e74eea760aedb424912a2c98e7c650094dcb9e (patch)
tree04dab1f5f8c3bb6650580514a8ad41fb76f344a6
parentd49f38caf848bda5bff7d5d56ec6edce0a79e999 (diff)
downloadchrome-ec-76e74eea760aedb424912a2c98e7c650094dcb9e.tar.gz
Remove proxy config flags for unit tests
This moves per-test config flags from test_config.mk to test_config.h, where one can define/undefine config flags for individual test. BUG=chrome-os-partner:19235 TEST=Pass all tests BRANCH=None Original-Change-Id: I096aded2007881433d3b6414d37f8bfdc6a2c45c Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/64367 Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> (cherry picked from commit 19e30d9c7d1eed48e94952e5e73fdeb7d703656e) Change-Id: I97d5c6ebce2d10a81b7c990d4d39986a702b8499 Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/65373
-rw-r--r--Makefile5
-rw-r--r--Makefile.toolchain2
-rw-r--r--include/config.h1
-rw-r--r--test/test_config.h26
-rw-r--r--test/test_config.mk11
5 files changed, 29 insertions, 16 deletions
diff --git a/Makefile b/Makefile
index 582d0a5c16..8cd526109c 100644
--- a/Makefile
+++ b/Makefile
@@ -17,11 +17,8 @@ include Makefile.toolchain
# Get CHIP name
include board/$(BOARD)/build.mk
-# Get test configuration
-include test/test_config.mk
-
# Transform the configuration into make variables
-includes=include core/$(CORE)/include $(dirs) $(out)
+includes=include core/$(CORE)/include $(dirs) $(out) test
ifeq "$(TEST_BUILD)" "y"
_tsk_lst:=$(shell echo "CONFIG_TASK_LIST CONFIG_TEST_TASK_LIST" | \
$(CPP) -P -Iboard/$(BOARD) -Itest \
diff --git a/Makefile.toolchain b/Makefile.toolchain
index 2686ceb45a..1bc6246c3a 100644
--- a/Makefile.toolchain
+++ b/Makefile.toolchain
@@ -30,7 +30,7 @@ CFLAGS_TEST=$(if $(TEST_BUILD),-DTEST_BUILD \
-DTEST_TASKFILE=$(PROJECT).tasklist,) \
$(if $(EMU_BUILD),-DEMU_BUILD) \
$(if $($(PROJECT)-scale),-DTEST_TIME_SCALE=$($(PROJECT)-scale)) \
- $(CFLAGS-$(PROJECT))
+ -DTEST_$(PROJECT)
CFLAGS_COVERAGE=$(if $(TEST_COVERAGE),-fprofile-arcs -ftest-coverage \
-DTEST_COVERAGE,)
CFLAGS_DEFINE=-DOUTDIR=$(out) -DCHIP=$(CHIP) -DBOARD_TASKFILE=ec.tasklist \
diff --git a/include/config.h b/include/config.h
index 219a2c82bc..e028319216 100644
--- a/include/config.h
+++ b/include/config.h
@@ -623,5 +623,6 @@
*/
#include "config_chip.h"
#include "board.h"
+#include "test_config.h"
#endif /* __CROS_EC_CONFIG_H */
diff --git a/test/test_config.h b/test/test_config.h
new file mode 100644
index 0000000000..827a82642f
--- /dev/null
+++ b/test/test_config.h
@@ -0,0 +1,26 @@
+/* Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+/* Per-test config flags */
+
+#ifndef __CROS_EC_TEST_CONFIG_H
+#define __CROS_EC_TEST_CONFIG_H
+
+#ifdef TEST_kb_8042
+#undef CONFIG_KEYBOARD_PROTOCOL_MKBP
+#define CONFIG_KEYBOARD_PROTOCOL_8042
+#endif
+
+#ifdef TEST_sbs_charging
+#define CONFIG_BATTERY_MOCK
+#define CONFIG_CHARGER
+#define CONFIG_CHARGER_INPUT_CURRENT 4032
+#endif
+
+#ifdef TEST_adapter
+#define CONFIG_EXTPOWER_FALCO
+#endif
+
+#endif /* __CROS_EC_TEST_CONFIG_H */
diff --git a/test/test_config.mk b/test/test_config.mk
deleted file mode 100644
index 50214feed7..0000000000
--- a/test/test_config.mk
+++ /dev/null
@@ -1,11 +0,0 @@
-# -*- makefile -*-
-# Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-#
-# per-test configuration
-#
-
-CFLAGS-kb_8042=-DTEST_KB_8042
-CFLAGS-sbs_charging=-DTEST_SMART_BATTERY_CHARGER
-CFLAGS-adapter=-DTEST_EXTPOWER_FALCO