diff options
author | Fred Sundvik <fsundvik@gmail.com> | 2016-08-21 16:29:54 +0300 |
---|---|---|
committer | Fred Sundvik <fsundvik@gmail.com> | 2016-08-27 21:57:49 +0300 |
commit | 6d7cd639a5e4503f00162c7cfa4bc7302b82c71c (patch) | |
tree | 77c21e7a32258aaa1e2c49dd4c44983510a78045 | |
parent | cfddec17d5a4ea2c3ce9afe0f15de3fa604dee63 (diff) | |
download | qmk_firmware-6d7cd639a5e4503f00162c7cfa4bc7302b82c71c.tar.gz qmk_firmware-6d7cd639a5e4503f00162c7cfa4bc7302b82c71c.zip |
Basic framework for parsing test targets
-rw-r--r-- | Makefile | 16 | ||||
-rw-r--r-- | quantum/serial_link/tests/testlist.mk | 6 | ||||
-rw-r--r-- | testlist.mk | 13 |
3 files changed, 34 insertions, 1 deletions
@@ -224,6 +224,8 @@ define PARSE_RULE | |||
224 | # PARSE_ALL_KEYBOARDS | 224 | # PARSE_ALL_KEYBOARDS |
225 | ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,allkb),true) | 225 | ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,allkb),true) |
226 | $$(eval $$(call PARSE_ALL_KEYBOARDS)) | 226 | $$(eval $$(call PARSE_ALL_KEYBOARDS)) |
227 | else ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,test),true) | ||
228 | $$(eval $$(call PARSE_TEST)) | ||
227 | # If the rule starts with the name of a known keyboard, then continue | 229 | # If the rule starts with the name of a known keyboard, then continue |
228 | # the parsing from PARSE_KEYBOARD | 230 | # the parsing from PARSE_KEYBOARD |
229 | else ifeq ($$(call TRY_TO_MATCH_RULE_FROM_LIST,$$(KEYBOARDS)),true) | 231 | else ifeq ($$(call TRY_TO_MATCH_RULE_FROM_LIST,$$(KEYBOARDS)),true) |
@@ -396,6 +398,16 @@ define PARSE_ALL_KEYMAPS | |||
396 | $$(eval $$(call PARSE_ALL_IN_LIST,PARSE_KEYMAP,$$(KEYMAPS))) | 398 | $$(eval $$(call PARSE_ALL_IN_LIST,PARSE_KEYMAP,$$(KEYMAPS))) |
397 | endef | 399 | endef |
398 | 400 | ||
401 | define PARSE_TEST | ||
402 | TEST_NAME := $$(firstword $$(subst -, ,$$(RULE))) | ||
403 | TEST_TARGET := $$(subst $$(TEST_NAME),,$$(subst $$(TEST_NAME)-,,$$(RULE))) | ||
404 | MATCHED_TESTS := $$(foreach TEST,$$(TEST_LIST),$$(if $$(findstring $$(TEST_NAME),$$(TEST)),$$(TEST),)) | ||
405 | $$(info Test name $$(TEST_NAME)) | ||
406 | $$(info Test target $$(TEST_TARGET)) | ||
407 | $$(info $$(MATCHED_TESTS)) | ||
408 | endef | ||
409 | |||
410 | |||
399 | # Set the silent mode depending on if we are trying to compile multiple keyboards or not | 411 | # Set the silent mode depending on if we are trying to compile multiple keyboards or not |
400 | # By default it's on in that case, but it can be overriden by specifying silent=false | 412 | # By default it's on in that case, but it can be overriden by specifying silent=false |
401 | # from the command line | 413 | # from the command line |
@@ -459,4 +471,6 @@ all-keyboards-defaults: allkb-allsp-default | |||
459 | GIT_VERSION := $(shell git describe --abbrev=6 --dirty --always --tags 2>/dev/null || date +"%Y-%m-%d-%H:%M:%S") | 471 | GIT_VERSION := $(shell git describe --abbrev=6 --dirty --always --tags 2>/dev/null || date +"%Y-%m-%d-%H:%M:%S") |
460 | BUILD_DATE := $(shell date +"%Y-%m-%d-%H:%M:%S") | 472 | BUILD_DATE := $(shell date +"%Y-%m-%d-%H:%M:%S") |
461 | $(shell echo '#define QMK_VERSION "$(GIT_VERSION)"' > $(ROOT_DIR)/quantum/version.h) | 473 | $(shell echo '#define QMK_VERSION "$(GIT_VERSION)"' > $(ROOT_DIR)/quantum/version.h) |
462 | $(shell echo '#define QMK_BUILDDATE "$(BUILD_DATE)"' >> $(ROOT_DIR)/quantum/version.h) \ No newline at end of file | 474 | $(shell echo '#define QMK_BUILDDATE "$(BUILD_DATE)"' >> $(ROOT_DIR)/quantum/version.h) |
475 | |||
476 | include $(ROOT_DIR)/testlist.mk \ No newline at end of file | ||
diff --git a/quantum/serial_link/tests/testlist.mk b/quantum/serial_link/tests/testlist.mk new file mode 100644 index 000000000..4a734b1e1 --- /dev/null +++ b/quantum/serial_link/tests/testlist.mk | |||
@@ -0,0 +1,6 @@ | |||
1 | TEST_LIST +=\ | ||
2 | serial_link_byte_stuffer\ | ||
3 | serial_link_frame_router\ | ||
4 | serial_link_frame_validator\ | ||
5 | serial_link_transport\ | ||
6 | serial_link_triple_buffered_object \ No newline at end of file | ||
diff --git a/testlist.mk b/testlist.mk new file mode 100644 index 000000000..1884d6d3f --- /dev/null +++ b/testlist.mk | |||
@@ -0,0 +1,13 @@ | |||
1 | include $(ROOT_DIR)/quantum/serial_link/tests/testlist.mk | ||
2 | |||
3 | define VALIDATE_TEST_LIST | ||
4 | ifneq ($1,) | ||
5 | ifeq ($$(findstring -,$1),-) | ||
6 | $$(error Test names can't contain '-', but '$1' does) | ||
7 | else | ||
8 | $$(eval $$(call VALIDATE_TEST_LIST,$$(firstword $2),$$(wordlist 2,9999,$2))) | ||
9 | endif | ||
10 | endif | ||
11 | endef | ||
12 | |||
13 | $(eval $(call VALIDATE_TEST_LIST,$(firstword $(TEST_LIST)),$(wordlist 2,9999,$(TEST_LIST)))) \ No newline at end of file | ||