summaryrefslogtreecommitdiffstats
path: root/build_test.mk
diff options
context:
space:
mode:
authorJoel Challis <git@zvecr.com>2021-07-25 17:18:09 +0100
committerGitHub <noreply@github.com>2021-07-25 17:18:09 +0100
commitfc9fb2c77505cf1dcf5d1f50dd61a980471b3494 (patch)
tree3dce233f23dbe991c4dee0a63eb4dc0fe9c2b6f5 /build_test.mk
parentb69e7431aa2e22b4f4662c64e84ed242caac055e (diff)
Allow output of logging when running unit tests (#13556)
* Initial pass at enabling logging for unit tests * Add to docs * Bind debug for more test types * Force everything * Tidy up slightly
Diffstat (limited to 'build_test.mk')
-rw-r--r--build_test.mk13
1 files changed, 11 insertions, 2 deletions
diff --git a/build_test.mk b/build_test.mk
index 77c4265f93..519c142c42 100644
--- a/build_test.mk
+++ b/build_test.mk
@@ -24,7 +24,6 @@ GTEST_INTERNAL_INC :=\
$(GTEST_OUTPUT)_SRC :=\
googletest/src/gtest-all.cc\
- googletest/src/gtest_main.cc\
googlemock/src/gmock-all.cc
$(GTEST_OUTPUT)_DEFS :=
@@ -35,7 +34,8 @@ CREATE_MAP := no
VPATH +=\
$(LIB_PATH)/googletest\
- $(LIB_PATH)/googlemock
+ $(LIB_PATH)/googlemock\
+ $(LIB_PATH)/printf
all: elf
@@ -43,6 +43,10 @@ VPATH += $(COMMON_VPATH)
PLATFORM:=TEST
PLATFORM_KEY:=test
+ifeq ($(strip $(DEBUG)), 1)
+CONSOLE_ENABLE = yes
+endif
+
ifneq ($(filter $(FULL_TESTS),$(TEST)),)
include tests/$(TEST)/rules.mk
endif
@@ -55,6 +59,11 @@ ifneq ($(filter $(FULL_TESTS),$(TEST)),)
include build_full_test.mk
endif
+$(TEST)_SRC += \
+ tests/test_common/main.c \
+ $(LIB_PATH)/printf/printf.c \
+ $(COMMON_DIR)/printf.c
+
$(TEST_OBJ)/$(TEST)_SRC := $($(TEST)_SRC)
$(TEST_OBJ)/$(TEST)_INC := $($(TEST)_INC) $(VPATH) $(GTEST_INC)
$(TEST_OBJ)/$(TEST)_DEFS := $($(TEST)_DEFS)