diff options
| -rw-r--r-- | Makefile | 11 |
1 files changed, 8 insertions, 3 deletions
| @@ -28,6 +28,7 @@ ABS_ROOT_MAKEFILE := $(abspath $(ROOT_MAKEFILE)) | |||
| 28 | ABS_STARTING_DIR := $(dir $(ABS_STARTING_MAKEFILE)) | 28 | ABS_STARTING_DIR := $(dir $(ABS_STARTING_MAKEFILE)) |
| 29 | ABS_ROOT_DIR := $(dir $(ABS_ROOT_MAKEFILE)) | 29 | ABS_ROOT_DIR := $(dir $(ABS_ROOT_MAKEFILE)) |
| 30 | STARTING_DIR := $(subst $(ABS_ROOT_DIR),,$(ABS_STARTING_DIR)) | 30 | STARTING_DIR := $(subst $(ABS_ROOT_DIR),,$(ABS_STARTING_DIR)) |
| 31 | TEST_DIR := $(ROOT_DIR)/.build/test | ||
| 31 | 32 | ||
| 32 | MAKEFILE_INCLUDED=yes | 33 | MAKEFILE_INCLUDED=yes |
| 33 | 34 | ||
| @@ -394,7 +395,10 @@ define BUILD | |||
| 394 | fi; | 395 | fi; |
| 395 | COMMAND_false_$$(COMMAND) := \ | 396 | COMMAND_false_$$(COMMAND) := \ |
| 396 | printf "$$(MAKE_MSG)\n\n"; \ | 397 | printf "$$(MAKE_MSG)\n\n"; \ |
| 397 | $$(MAKE_CMD) $$(MAKE_VARS) SILENT=false; | 398 | $$(MAKE_CMD) $$(MAKE_VARS) SILENT=false; \ |
| 399 | if [ $$$$? -gt 0 ]; \ | ||
| 400 | then error_occured=1; \ | ||
| 401 | fi; | ||
| 398 | endef | 402 | endef |
| 399 | 403 | ||
| 400 | # Just parse all the keymaps for a specifc keyboard | 404 | # Just parse all the keymaps for a specifc keyboard |
| @@ -410,6 +414,7 @@ define BUILD_TEST | |||
| 410 | MAKE_VARS := TEST=$$(TEST_NAME) | 414 | MAKE_VARS := TEST=$$(TEST_NAME) |
| 411 | MAKE_MSG := $$(MSG_MAKE_TEST) | 415 | MAKE_MSG := $$(MSG_MAKE_TEST) |
| 412 | $$(eval $$(call BUILD)) | 416 | $$(eval $$(call BUILD)) |
| 417 | TESTS += $$(TEST_DIR)/$$(TEST_NAME).elf | ||
| 413 | endef | 418 | endef |
| 414 | 419 | ||
| 415 | define PARSE_TEST | 420 | define PARSE_TEST |
| @@ -464,8 +469,8 @@ $(SUBPROJECTS): %: %-allkm | |||
| 464 | # But we return the error code at the end, to trigger travis failures | 469 | # But we return the error code at the end, to trigger travis failures |
| 465 | +error_occured=0; \ | 470 | +error_occured=0; \ |
| 466 | $(foreach COMMAND,$(COMMANDS),$(RUN_COMMAND)) \ | 471 | $(foreach COMMAND,$(COMMANDS),$(RUN_COMMAND)) \ |
| 467 | if [ $$error_occured -gt 0 ]; then printf "$(MSG_ERRORS)" & exit $$error_occured; fi | 472 | if [ $$error_occured -gt 0 ]; then printf "$(MSG_ERRORS)" & exit $$error_occured; fi;\ |
| 468 | 473 | $(foreach TEST,$(TESTS),$(TEST)) | |
| 469 | 474 | ||
| 470 | # All should compile everything | 475 | # All should compile everything |
| 471 | .PHONY: all | 476 | .PHONY: all |
