diff options
author | Joel Challis <git@zvecr.com> | 2021-07-25 17:18:09 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-25 17:18:09 +0100 |
commit | fc9fb2c77505cf1dcf5d1f50dd61a980471b3494 (patch) | |
tree | 3dce233f23dbe991c4dee0a63eb4dc0fe9c2b6f5 /build_test.mk | |
parent | b69e7431aa2e22b4f4662c64e84ed242caac055e (diff) | |
download | qmk_firmware-fc9fb2c77505cf1dcf5d1f50dd61a980471b3494.tar.gz qmk_firmware-fc9fb2c77505cf1dcf5d1f50dd61a980471b3494.zip |
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.mk | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/build_test.mk b/build_test.mk index 77c4265f9..519c142c4 100644 --- a/build_test.mk +++ b/build_test.mk | |||
@@ -24,7 +24,6 @@ GTEST_INTERNAL_INC :=\ | |||
24 | 24 | ||
25 | $(GTEST_OUTPUT)_SRC :=\ | 25 | $(GTEST_OUTPUT)_SRC :=\ |
26 | googletest/src/gtest-all.cc\ | 26 | googletest/src/gtest-all.cc\ |
27 | googletest/src/gtest_main.cc\ | ||
28 | googlemock/src/gmock-all.cc | 27 | googlemock/src/gmock-all.cc |
29 | 28 | ||
30 | $(GTEST_OUTPUT)_DEFS := | 29 | $(GTEST_OUTPUT)_DEFS := |
@@ -35,7 +34,8 @@ CREATE_MAP := no | |||
35 | 34 | ||
36 | VPATH +=\ | 35 | VPATH +=\ |
37 | $(LIB_PATH)/googletest\ | 36 | $(LIB_PATH)/googletest\ |
38 | $(LIB_PATH)/googlemock | 37 | $(LIB_PATH)/googlemock\ |
38 | $(LIB_PATH)/printf | ||
39 | 39 | ||
40 | all: elf | 40 | all: elf |
41 | 41 | ||
@@ -43,6 +43,10 @@ VPATH += $(COMMON_VPATH) | |||
43 | PLATFORM:=TEST | 43 | PLATFORM:=TEST |
44 | PLATFORM_KEY:=test | 44 | PLATFORM_KEY:=test |
45 | 45 | ||
46 | ifeq ($(strip $(DEBUG)), 1) | ||
47 | CONSOLE_ENABLE = yes | ||
48 | endif | ||
49 | |||
46 | ifneq ($(filter $(FULL_TESTS),$(TEST)),) | 50 | ifneq ($(filter $(FULL_TESTS),$(TEST)),) |
47 | include tests/$(TEST)/rules.mk | 51 | include tests/$(TEST)/rules.mk |
48 | endif | 52 | endif |
@@ -55,6 +59,11 @@ ifneq ($(filter $(FULL_TESTS),$(TEST)),) | |||
55 | include build_full_test.mk | 59 | include build_full_test.mk |
56 | endif | 60 | endif |
57 | 61 | ||
62 | $(TEST)_SRC += \ | ||
63 | tests/test_common/main.c \ | ||
64 | $(LIB_PATH)/printf/printf.c \ | ||
65 | $(COMMON_DIR)/printf.c | ||
66 | |||
58 | $(TEST_OBJ)/$(TEST)_SRC := $($(TEST)_SRC) | 67 | $(TEST_OBJ)/$(TEST)_SRC := $($(TEST)_SRC) |
59 | $(TEST_OBJ)/$(TEST)_INC := $($(TEST)_INC) $(VPATH) $(GTEST_INC) | 68 | $(TEST_OBJ)/$(TEST)_INC := $($(TEST)_INC) $(VPATH) $(GTEST_INC) |
60 | $(TEST_OBJ)/$(TEST)_DEFS := $($(TEST)_DEFS) | 69 | $(TEST_OBJ)/$(TEST)_DEFS := $($(TEST)_DEFS) |