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