diff options
-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 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 |