From e89389591d3f29905ab419cd696e9922696011d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Thu, 11 Jul 2019 10:15:01 +0200 Subject: [PATCH] [ion] Clean test.external_flash target --- ion/Makefile | 5 +---- ion/test/device/Makefile | 1 + ion/test/device/n0110/Makefile | 4 ++++ ion/test/{ => device/n0110}/external_flash.cpp | 0 ion/test/{ => device/n0110}/external_flash_tests.ld | 0 quiz/Makefile | 4 ++-- scripts/targets.device.n0110.mak | 6 +++--- 7 files changed, 11 insertions(+), 9 deletions(-) create mode 100644 ion/test/device/Makefile create mode 100644 ion/test/device/n0110/Makefile rename ion/test/{ => device/n0110}/external_flash.cpp (100%) rename ion/test/{ => device/n0110}/external_flash_tests.ld (100%) diff --git a/ion/Makefile b/ion/Makefile index 274e79c2d..6e420f78a 100644 --- a/ion/Makefile +++ b/ion/Makefile @@ -12,6 +12,7 @@ endif SFLAGS += -Iion/include/ion/keyboard/$(ION_KEYBOARD_LAYOUT) include ion/src/$(PLATFORM)/Makefile +-include ion/test/$(PLATFORM)/Makefile include ion/src/shared/tools/Makefile # We need to work around a GCC bug (concerning versions < 5.1). It is valid in @@ -42,10 +43,6 @@ tests += $(addprefix ion/test/,\ utf8_helper.cpp\ ) -TEST_EXT_FLASH_REPROGRAM ?= 0 -SFLAGS += -DTEST_EXT_FLASH_REPROGRAM=$(TEST_EXT_FLASH_REPROGRAM) -external_flash_tests += ion/test/external_flash.cpp - ifdef ION_STORAGE_LOG SFLAGS += -DION_STORAGE_LOG=1 endif diff --git a/ion/test/device/Makefile b/ion/test/device/Makefile new file mode 100644 index 000000000..8a5bed237 --- /dev/null +++ b/ion/test/device/Makefile @@ -0,0 +1 @@ +include ion/test/device/$(MODEL)/Makefile diff --git a/ion/test/device/n0110/Makefile b/ion/test/device/n0110/Makefile new file mode 100644 index 000000000..c30ebdfc5 --- /dev/null +++ b/ion/test/device/n0110/Makefile @@ -0,0 +1,4 @@ +TEST_EXT_FLASH_REPROGRAM ?= 0 +SFLAGS += -DTEST_EXT_FLASH_REPROGRAM=$(TEST_EXT_FLASH_REPROGRAM) +test_ion_external_flash_src += ion/test/$(PLATFORM)/$(MODEL)/external_flash.cpp +$(call object_for,$(test_ion_external_flash_src)): SFLAGS += $(ION_DEVICE_SFLAGS) diff --git a/ion/test/external_flash.cpp b/ion/test/device/n0110/external_flash.cpp similarity index 100% rename from ion/test/external_flash.cpp rename to ion/test/device/n0110/external_flash.cpp diff --git a/ion/test/external_flash_tests.ld b/ion/test/device/n0110/external_flash_tests.ld similarity index 100% rename from ion/test/external_flash_tests.ld rename to ion/test/device/n0110/external_flash_tests.ld diff --git a/quiz/Makefile b/quiz/Makefile index 95bcac764..a04b4acfc 100644 --- a/quiz/Makefile +++ b/quiz/Makefile @@ -4,13 +4,13 @@ QUIZ_USE_CONSOLE ?= 0 $(call object_for,quiz/src/runner.cpp): SFLAGS += -DQUIZ_USE_CONSOLE=$(QUIZ_USE_CONSOLE) define rule_for_quiz_symbols -$$(BUILD_DIR)/quiz/src/$(1)_symbols.c: $$($(1)) | $$$$(@D)/. +$$(BUILD_DIR)/quiz/src/$(subst _src,,$(1))_symbols.c: $$($(1)) | $$$$(@D)/. @ echo "AWK $$@" $$(Q) awk -f quiz/src/symbols.awk $$($(1)) > $$@ endef $(eval $(call rule_for_quiz_symbols,tests)) -$(eval $(call rule_for_quiz_symbols,external_flash_tests)) +$(eval $(call rule_for_quiz_symbols,test_ion_external_flash_src)) runner_src += $(addprefix quiz/src/, \ assertions.cpp \ diff --git a/scripts/targets.device.n0110.mak b/scripts/targets.device.n0110.mak index 3207d0ee4..c04045feb 100644 --- a/scripts/targets.device.n0110.mak +++ b/scripts/targets.device.n0110.mak @@ -1,4 +1,4 @@ -executables += test_external_flash +executables += test.external_flash -$(BUILD_DIR)/test_external_flash.$(EXE): LDSCRIPT = ion/test/external_flash_tests.ld -$(BUILD_DIR)/test_external_flash.$(EXE): $(BUILD_DIR)/quiz/src/external_flash_tests_symbols.o $(runner_objs) $(call object_for,$(tests_external_flash)) $(call object_for,$(ion_device_dfu_relocated_src)) +$(BUILD_DIR)/test.external_flash.$(EXE): LDSCRIPT = ion/test/device/n0110/external_flash_tests.ld +$(BUILD_DIR)/test.external_flash.$(EXE): $(BUILD_DIR)/quiz/src/test_ion_external_flash_symbols.o $(call object_for,$(src) $(ion_device_dfu_relocated_src) $(test_ion_external_flash_src) $(runner_src))