mirror of
https://github.com/qmk/qmk_firmware
synced 2024-11-19 11:46:08 +00:00
Support for running and cleaning all tests
This commit is contained in:
parent
42baa6cf43
commit
1b963117fe
1 changed files with 22 additions and 11 deletions
11
Makefile
11
Makefile
|
@ -414,6 +414,7 @@ define BUILD_TEST
|
|||
MAKE_VARS := TEST=$$(TEST_NAME)
|
||||
MAKE_MSG := $$(MSG_MAKE_TEST)
|
||||
$$(eval $$(call BUILD))
|
||||
ifneq ($$(MAKE_TARGET),clean)
|
||||
TEST_EXECUTABLE := $$(TEST_DIR)/$$(TEST_NAME).elf
|
||||
TESTS += $$(TEST_NAME)
|
||||
TEST_MSG := $$(MSG_TEST)
|
||||
|
@ -424,13 +425,18 @@ define BUILD_TEST
|
|||
then error_occured=1; \
|
||||
fi; \
|
||||
printf "\n";
|
||||
endif
|
||||
endef
|
||||
|
||||
define PARSE_TEST
|
||||
TESTS :=
|
||||
TEST_NAME := $$(firstword $$(subst -, ,$$(RULE)))
|
||||
TEST_TARGET := $$(subst $$(TEST_NAME),,$$(subst $$(TEST_NAME)-,,$$(RULE)))
|
||||
ifeq ($$(TEST_NAME),all)
|
||||
MATCHED_TESTS := $$(TEST_LIST)
|
||||
else
|
||||
MATCHED_TESTS := $$(foreach TEST,$$(TEST_LIST),$$(if $$(findstring $$(TEST_NAME),$$(TEST)),$$(TEST),))
|
||||
endif
|
||||
$$(foreach TEST,$$(MATCHED_TESTS),$$(eval $$(call BUILD_TEST,$$(TEST),$$(TEST_TARGET))))
|
||||
endef
|
||||
|
||||
|
@ -494,6 +500,11 @@ all-keyboards: allkb-allsp-allkm
|
|||
.PHONY: all-keyboards-defaults
|
||||
all-keyboards-defaults: allkb-allsp-default
|
||||
|
||||
.PHONY: test
|
||||
test: test-all
|
||||
|
||||
.PHONY: test-clean
|
||||
test-clean: test-all-clean
|
||||
|
||||
# Generate the version.h file
|
||||
GIT_VERSION := $(shell git describe --abbrev=6 --dirty --always --tags 2>/dev/null || date +"%Y-%m-%d-%H:%M:%S")
|
||||
|
|
Loading…
Reference in a new issue