From 6eaa54f37bbae8cf7170057b9575aa67c634dc8f Mon Sep 17 00:00:00 2001 From: Vic Yang Date: Sat, 3 Aug 2013 04:01:39 +0800 Subject: 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: If5dce9bafc96cdb91e910cc30324ec890b5b0fd1 Original-Change-Id: I096aded2007881433d3b6414d37f8bfdc6a2c45c Signed-off-by: Vic Yang Reviewed-on: https://gerrit.chromium.org/gerrit/64367 Reviewed-by: Vincent Palatin Reviewed-by: Randall Spangler Reviewed-on: https://gerrit.chromium.org/gerrit/65766 Reviewed-by: Dave Parker Tested-by: Dave Parker --- Makefile | 5 +---- Makefile.toolchain | 2 +- include/config.h | 1 + test/test_config.h | 26 ++++++++++++++++++++++++++ test/test_config.mk | 11 ----------- 5 files changed, 29 insertions(+), 16 deletions(-) create mode 100644 test/test_config.h delete mode 100644 test/test_config.mk 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 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 -- cgit v1.2.1