Support for running and cleaning all tests
This commit is contained in:
parent
42baa6cf43
commit
1b963117fe
33
Makefile
33
Makefile
|
@ -414,23 +414,29 @@ 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))
|
||||||
TEST_EXECUTABLE := $$(TEST_DIR)/$$(TEST_NAME).elf
|
ifneq ($$(MAKE_TARGET),clean)
|
||||||
TESTS += $$(TEST_NAME)
|
TEST_EXECUTABLE := $$(TEST_DIR)/$$(TEST_NAME).elf
|
||||||
TEST_MSG := $$(MSG_TEST)
|
TESTS += $$(TEST_NAME)
|
||||||
$$(TEST_NAME)_COMMAND := \
|
TEST_MSG := $$(MSG_TEST)
|
||||||
printf "$$(TEST_MSG)\n"; \
|
$$(TEST_NAME)_COMMAND := \
|
||||||
$$(TEST_EXECUTABLE); \
|
printf "$$(TEST_MSG)\n"; \
|
||||||
if [ $$$$? -gt 0 ]; \
|
$$(TEST_EXECUTABLE); \
|
||||||
then error_occured=1; \
|
if [ $$$$? -gt 0 ]; \
|
||||||
fi; \
|
then error_occured=1; \
|
||||||
printf "\n";
|
fi; \
|
||||||
|
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)))
|
||||||
MATCHED_TESTS := $$(foreach TEST,$$(TEST_LIST),$$(if $$(findstring $$(TEST_NAME),$$(TEST)),$$(TEST),))
|
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))))
|
$$(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 New Issue