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