2016-08-22 14:16:08 +08:00
|
|
|
ifndef VERBOSE
|
|
|
|
.SILENT:
|
|
|
|
endif
|
|
|
|
|
|
|
|
.DEFAULT_GOAL := all
|
|
|
|
|
2022-03-08 13:58:05 +08:00
|
|
|
OPT = g
|
|
|
|
|
2021-10-28 08:07:53 +08:00
|
|
|
include paths.mk
|
|
|
|
include $(BUILDDEFS_PATH)/message.mk
|
2016-08-21 22:14:38 +08:00
|
|
|
|
2016-08-22 14:16:08 +08:00
|
|
|
TARGET=test/$(TEST)
|
|
|
|
|
|
|
|
GTEST_OUTPUT = $(BUILD_DIR)/gtest
|
|
|
|
|
2016-08-25 03:23:17 +08:00
|
|
|
TEST_OBJ = $(BUILD_DIR)/test_obj
|
|
|
|
|
|
|
|
OUTPUTS := $(TEST_OBJ)/$(TEST) $(GTEST_OUTPUT)
|
2016-08-22 14:16:08 +08:00
|
|
|
|
|
|
|
GTEST_INC := \
|
2021-11-23 10:31:01 +08:00
|
|
|
$(LIB_PATH)/googletest/googletest/include \
|
|
|
|
$(LIB_PATH)/googletest/googlemock/include
|
2020-12-28 01:36:32 +08:00
|
|
|
|
2021-11-23 10:31:01 +08:00
|
|
|
GTEST_INTERNAL_INC := \
|
|
|
|
$(LIB_PATH)/googletest/googletest \
|
2016-08-22 14:16:08 +08:00
|
|
|
$(LIB_PATH)/googletest/googlemock
|
|
|
|
|
2021-11-23 10:31:01 +08:00
|
|
|
$(GTEST_OUTPUT)_SRC := \
|
2016-08-22 14:16:08 +08:00
|
|
|
googletest/src/gtest-all.cc\
|
|
|
|
googlemock/src/gmock-all.cc
|
|
|
|
|
2020-12-28 01:36:32 +08:00
|
|
|
$(GTEST_OUTPUT)_DEFS :=
|
2016-08-22 14:16:08 +08:00
|
|
|
$(GTEST_OUTPUT)_INC := $(GTEST_INC) $(GTEST_INTERNAL_INC)
|
|
|
|
|
|
|
|
LDFLAGS += -lstdc++ -lpthread -shared-libgcc
|
2016-08-27 22:43:35 +08:00
|
|
|
CREATE_MAP := no
|
2016-08-22 14:16:08 +08:00
|
|
|
|
2021-11-23 10:31:01 +08:00
|
|
|
VPATH += \
|
|
|
|
$(LIB_PATH)/googletest \
|
|
|
|
$(LIB_PATH)/googlemock \
|
2022-07-07 15:27:50 +08:00
|
|
|
$(COMMON_VPATH) \
|
|
|
|
$(TEST_PATH)
|
2016-08-22 14:16:08 +08:00
|
|
|
|
|
|
|
all: elf
|
|
|
|
|
2017-06-17 03:01:21 +08:00
|
|
|
PLATFORM:=TEST
|
2020-03-21 13:20:04 +08:00
|
|
|
PLATFORM_KEY:=test
|
2021-12-27 18:10:07 +08:00
|
|
|
BOOTLOADER_TYPE:=none
|
2016-08-27 18:43:12 +08:00
|
|
|
|
2021-07-26 00:18:09 +08:00
|
|
|
ifeq ($(strip $(DEBUG)), 1)
|
|
|
|
CONSOLE_ENABLE = yes
|
|
|
|
endif
|
|
|
|
|
2017-06-17 03:14:47 +08:00
|
|
|
ifneq ($(filter $(FULL_TESTS),$(TEST)),)
|
2021-11-23 10:31:01 +08:00
|
|
|
include tests/test_common/build.mk
|
|
|
|
include $(TEST_PATH)/test.mk
|
2017-06-17 03:14:47 +08:00
|
|
|
endif
|
|
|
|
|
2022-02-11 01:45:51 +08:00
|
|
|
include $(BUILDDEFS_PATH)/common_features.mk
|
2021-10-28 08:07:53 +08:00
|
|
|
include $(BUILDDEFS_PATH)/generic_features.mk
|
2021-11-20 02:41:02 +08:00
|
|
|
include $(PLATFORM_PATH)/common.mk
|
2021-10-29 06:43:57 +08:00
|
|
|
include $(TMK_PATH)/protocol.mk
|
2021-06-09 15:23:21 +08:00
|
|
|
include $(QUANTUM_PATH)/debounce/tests/rules.mk
|
2021-11-27 19:19:22 +08:00
|
|
|
include $(QUANTUM_PATH)/encoder/tests/rules.mk
|
2022-12-09 00:45:30 +08:00
|
|
|
include $(QUANTUM_PATH)/os_detection/tests/rules.mk
|
2020-11-29 04:02:18 +08:00
|
|
|
include $(QUANTUM_PATH)/sequencer/tests/rules.mk
|
2022-06-27 05:18:21 +08:00
|
|
|
include $(QUANTUM_PATH)/wear_leveling/tests/rules.mk
|
2022-07-07 15:27:50 +08:00
|
|
|
include $(QUANTUM_PATH)/logging/print.mk
|
2021-11-20 02:41:02 +08:00
|
|
|
include $(PLATFORM_PATH)/test/rules.mk
|
2017-06-17 01:21:28 +08:00
|
|
|
ifneq ($(filter $(FULL_TESTS),$(TEST)),)
|
2022-02-11 01:45:51 +08:00
|
|
|
include $(BUILDDEFS_PATH)/build_full_test.mk
|
2017-06-17 01:21:28 +08:00
|
|
|
endif
|
2016-08-25 03:23:17 +08:00
|
|
|
|
2021-07-26 00:18:09 +08:00
|
|
|
$(TEST)_SRC += \
|
2022-10-23 11:30:17 +08:00
|
|
|
tests/test_common/main.cpp \
|
2021-08-04 01:49:33 +08:00
|
|
|
$(QUANTUM_PATH)/logging/print.c
|
2021-07-26 00:18:09 +08:00
|
|
|
|
2016-08-25 03:23:17 +08:00
|
|
|
$(TEST_OBJ)/$(TEST)_SRC := $($(TEST)_SRC)
|
|
|
|
$(TEST_OBJ)/$(TEST)_INC := $($(TEST)_INC) $(VPATH) $(GTEST_INC)
|
|
|
|
$(TEST_OBJ)/$(TEST)_DEFS := $($(TEST)_DEFS)
|
2017-06-17 02:38:34 +08:00
|
|
|
$(TEST_OBJ)/$(TEST)_CONFIG := $($(TEST)_CONFIG)
|
2016-08-25 03:23:17 +08:00
|
|
|
|
2021-11-20 02:41:02 +08:00
|
|
|
include $(PLATFORM_PATH)/$(PLATFORM_KEY)/platform.mk
|
2022-02-11 01:45:51 +08:00
|
|
|
include $(BUILDDEFS_PATH)/common_rules.mk
|
2016-08-22 14:16:08 +08:00
|
|
|
|
2016-08-25 03:23:17 +08:00
|
|
|
|
|
|
|
$(shell mkdir -p $(BUILD_DIR)/test 2>/dev/null)
|
|
|
|
$(shell mkdir -p $(TEST_OBJ) 2>/dev/null)
|