From 27a673f5cf75747fe73641059aae60e9b53a1c78 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 21 Aug 2016 17:14:38 +0300 Subject: The makefile actually calls build_test --- build_test.mk | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 build_test.mk (limited to 'build_test.mk') diff --git a/build_test.mk b/build_test.mk new file mode 100644 index 0000000000..37ed8b5683 --- /dev/null +++ b/build_test.mk @@ -0,0 +1,5 @@ +include common.mk + + +all: + echo Done $(TEST) \ No newline at end of file -- cgit v1.2.1 From 8a9aac6e3237a505682cc7249a8dfff6cb964343 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Mon, 22 Aug 2016 09:16:08 +0300 Subject: Rules for compiling and linking google test --- build_test.mk | 42 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-) (limited to 'build_test.mk') diff --git a/build_test.mk b/build_test.mk index 37ed8b5683..dac59a8f48 100644 --- a/build_test.mk +++ b/build_test.mk @@ -1,5 +1,43 @@ +ifndef VERBOSE +.SILENT: +endif + +.DEFAULT_GOAL := all + include common.mk +TARGET=test/$(TEST) + +GTEST_OUTPUT = $(BUILD_DIR)/gtest + +OUTPUTS := $(GTEST_OUTPUT) + +GTEST_INC := \ + $(LIB_PATH)/googletest/googletest/include\ + $(LIB_PATH)/googletest/googlemock/include\ + +GTEST_INTERNAL_INC :=\ + $(LIB_PATH)/googletest/googletest\ + $(LIB_PATH)/googletest/googlemock + +$(GTEST_OUTPUT)_SRC :=\ + googletest/src/gtest-all.cc\ + googletest/src/gtest_main.cc\ + googlemock/src/gmock-all.cc + +$(GTEST_OUTPUT)_DEFS := +$(GTEST_OUTPUT)_INC := $(GTEST_INC) $(GTEST_INTERNAL_INC) + +LDFLAGS += -lstdc++ -lpthread -shared-libgcc + +VPATH +=\ + $(LIB_PATH)/googletest\ + $(LIB_PATH)/googlemock + +all: elf + +include $(TMK_PATH)/native.mk +include $(TMK_PATH)/rules.mk + +$(shell mkdir $(BUILD_DIR)/test 2>/dev/null) -all: - echo Done $(TEST) \ No newline at end of file -- cgit v1.2.1 From 0a11460175d6a838c71343c19eb4ce4699936247 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Wed, 24 Aug 2016 22:23:17 +0300 Subject: Build actual tests, convert byte_stuffer_tests --- build_test.mk | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'build_test.mk') diff --git a/build_test.mk b/build_test.mk index dac59a8f48..1d8cb08b15 100644 --- a/build_test.mk +++ b/build_test.mk @@ -10,7 +10,9 @@ TARGET=test/$(TEST) GTEST_OUTPUT = $(BUILD_DIR)/gtest -OUTPUTS := $(GTEST_OUTPUT) +TEST_OBJ = $(BUILD_DIR)/test_obj + +OUTPUTS := $(TEST_OBJ)/$(TEST) $(GTEST_OUTPUT) GTEST_INC := \ $(LIB_PATH)/googletest/googletest/include\ @@ -36,8 +38,16 @@ VPATH +=\ all: elf +include $(QUANTUM_PATH)/serial_link/tests/rules.mk + +$(TEST_OBJ)/$(TEST)_SRC := $($(TEST)_SRC) +$(TEST_OBJ)/$(TEST)_INC := $($(TEST)_INC) $(VPATH) $(GTEST_INC) +$(TEST_OBJ)/$(TEST)_DEFS := $($(TEST)_DEFS) + include $(TMK_PATH)/native.mk include $(TMK_PATH)/rules.mk -$(shell mkdir $(BUILD_DIR)/test 2>/dev/null) + +$(shell mkdir -p $(BUILD_DIR)/test 2>/dev/null) +$(shell mkdir -p $(TEST_OBJ) 2>/dev/null) -- cgit v1.2.1 From c692fd1d55cb2103e9f7c40c8953ec92b5178c52 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 27 Aug 2016 13:43:12 +0300 Subject: More common settings for unit tests and keyboards --- build_test.mk | 3 +++ 1 file changed, 3 insertions(+) (limited to 'build_test.mk') diff --git a/build_test.mk b/build_test.mk index 1d8cb08b15..9f5d6e0af2 100644 --- a/build_test.mk +++ b/build_test.mk @@ -38,6 +38,9 @@ VPATH +=\ all: elf +VPATH += $(COMMON_VPATH) + +include $(TMK_PATH)/common.mk include $(QUANTUM_PATH)/serial_link/tests/rules.mk $(TEST_OBJ)/$(TEST)_SRC := $($(TEST)_SRC) -- cgit v1.2.1 From 42baa6cf43ab1da79887e74b9ad71379c13094f9 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 27 Aug 2016 17:43:35 +0300 Subject: Disable map file creation when building tests It causes strange linker warnings on cygwin. --- build_test.mk | 1 + 1 file changed, 1 insertion(+) (limited to 'build_test.mk') diff --git a/build_test.mk b/build_test.mk index 9f5d6e0af2..ee15a45726 100644 --- a/build_test.mk +++ b/build_test.mk @@ -31,6 +31,7 @@ $(GTEST_OUTPUT)_DEFS := $(GTEST_OUTPUT)_INC := $(GTEST_INC) $(GTEST_INTERNAL_INC) LDFLAGS += -lstdc++ -lpthread -shared-libgcc +CREATE_MAP := no VPATH +=\ $(LIB_PATH)/googletest\ -- cgit v1.2.1