diff options
author | Vic Yang <victoryang@chromium.org> | 2013-08-03 04:01:39 +0800 |
---|---|---|
committer | Dave Parker <dparker@chromium.org> | 2013-08-09 23:35:59 -0700 |
commit | 905aa0967f4f964975296cacd28708bba7b9d943 (patch) | |
tree | bbc5e720ce22cf797956568146879ebf956dbea4 | |
parent | 3f5293cfd45cb1f54635c1ad0c2478d930c07ae6 (diff) | |
download | chrome-ec-905aa0967f4f964975296cacd28708bba7b9d943.tar.gz |
CHERRY-PICK: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
Change-Id: I7b3fdff52c7381c8301b10f3e16dfc7fb0a1ce27
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>
Reviewed-on: https://gerrit.chromium.org/gerrit/65444
Commit-Queue: Dave Parker <dparker@chromium.org>
Reviewed-by: Dave Parker <dparker@chromium.org>
Tested-by: Dave Parker <dparker@chromium.org>
-rw-r--r-- | Makefile | 5 | ||||
-rw-r--r-- | Makefile.toolchain | 2 | ||||
-rw-r--r-- | include/config.h | 1 | ||||
-rw-r--r-- | test/test_config.h | 26 | ||||
-rw-r--r-- | test/test_config.mk | 11 |
5 files changed, 29 insertions, 16 deletions
@@ -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 3133fc0503..6be7516029 100644 --- a/include/config.h +++ b/include/config.h @@ -620,5 +620,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 |