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_VARS := TEST=$$(TEST_NAME)
|
||||||
MAKE_MSG := $$(MSG_MAKE_TEST)
|
MAKE_MSG := $$(MSG_MAKE_TEST)
|
||||||
$$(eval $$(call BUILD))
|
$$(eval $$(call BUILD))
|
||||||
|
ifneq ($$(MAKE_TARGET),clean)
|
||||||
TEST_EXECUTABLE := $$(TEST_DIR)/$$(TEST_NAME).elf
|
TEST_EXECUTABLE := $$(TEST_DIR)/$$(TEST_NAME).elf
|
||||||
TESTS += $$(TEST_NAME)
|
TESTS += $$(TEST_NAME)
|
||||||
TEST_MSG := $$(MSG_TEST)
|
TEST_MSG := $$(MSG_TEST)
|
||||||
|
@ -424,13 +425,18 @@ define BUILD_TEST
|
||||||
then error_occured=1; \
|
then error_occured=1; \
|
||||||
fi; \
|
fi; \
|
||||||
printf "\n";
|
printf "\n";
|
||||||
|
endif
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define PARSE_TEST
|
define PARSE_TEST
|
||||||
TESTS :=
|
TESTS :=
|
||||||
TEST_NAME := $$(firstword $$(subst -, ,$$(RULE)))
|
TEST_NAME := $$(firstword $$(subst -, ,$$(RULE)))
|
||||||
TEST_TARGET := $$(subst $$(TEST_NAME),,$$(subst $$(TEST_NAME)-,,$$(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),))
|
MATCHED_TESTS := $$(foreach TEST,$$(TEST_LIST),$$(if $$(findstring $$(TEST_NAME),$$(TEST)),$$(TEST),))
|
||||||
|
endif
|
||||||
$$(foreach TEST,$$(MATCHED_TESTS),$$(eval $$(call BUILD_TEST,$$(TEST),$$(TEST_TARGET))))
|
$$(foreach TEST,$$(MATCHED_TESTS),$$(eval $$(call BUILD_TEST,$$(TEST),$$(TEST_TARGET))))
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
@ -494,6 +500,11 @@ all-keyboards: allkb-allsp-allkm
|
||||||
.PHONY: all-keyboards-defaults
|
.PHONY: all-keyboards-defaults
|
||||||
all-keyboards-defaults: allkb-allsp-default
|
all-keyboards-defaults: allkb-allsp-default
|
||||||
|
|
||||||
|
.PHONY: test
|
||||||
|
test: test-all
|
||||||
|
|
||||||
|
.PHONY: test-clean
|
||||||
|
test-clean: test-all-clean
|
||||||
|
|
||||||
# Generate the version.h file
|
# 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")
|
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