Introducing make target for precommit testing: 'make precommit' that also supports parallel run: 'make -j precommit'. Introducing set of modifiers for linux target: libc_raw, musl, sanitize, valgrind. For example: 'make debug.linux-libc_raw-sanitize' or 'make release.linux-valgrind'. Removing corresponding flags.
This commit is contained in:
@@ -22,9 +22,12 @@
|
||||
# debug_release: - JERRY_NDEBUG; + optimizations; + debug symbols; + -Werror | checked release build
|
||||
# release: + JERRY_NDEBUG; + optimizations; - debug symbols; + -Werror | release build
|
||||
#
|
||||
# Target system part (after first dot):
|
||||
# Target system and modifiers part (after first dot):
|
||||
# linux - target system is linux
|
||||
# stm32f{4} - target is STM32F{4} board
|
||||
# stm32f{4} - target is STM32F{4} board
|
||||
#
|
||||
# Modifiers can be added after '-' sign.
|
||||
# For list of modifiers for PC target - see TARGET_PC_MODS, for MCU target - TARGET_MCU_MODS.
|
||||
#
|
||||
# Target action part (optional, after second dot):
|
||||
# check - run cppcheck on src folder, unit and other tests
|
||||
@@ -41,12 +44,21 @@
|
||||
export TARGET_MODES = debug debug_release release
|
||||
export TARGET_PC_SYSTEMS = linux
|
||||
export TARGET_MCU_SYSTEMS = $(addprefix stm32f,4) # now only stm32f4 is supported, to add, for example, to stm32f3, change to $(addprefix stm32f,3 4)
|
||||
export TARGET_SYSTEMS = $(TARGET_PC_SYSTEMS) $(TARGET_MCU_SYSTEMS)
|
||||
|
||||
export TARGET_PC_MODS = libc_raw musl sanitize valgrind \
|
||||
libc_raw-sanitize libc_raw-valgrind \
|
||||
musl-valgrind
|
||||
|
||||
export TARGET_MCU_MODS =
|
||||
|
||||
export TARGET_SYSTEMS = $(TARGET_PC_SYSTEMS) \
|
||||
$(TARGET_MCU_SYSTEMS) \
|
||||
$(foreach __MOD,$(TARGET_PC_MODS),$(foreach __SYSTEM,$(TARGET_PC_SYSTEMS),$(__SYSTEM)-$(__MOD))) \
|
||||
$(foreach __MOD,$(TARGET_MCU_MODS),$(foreach __SYSTEM,$(TARGET_MCU_SYSTEMS),$(__SYSTEM)-$(__MOD)))
|
||||
|
||||
# Target list
|
||||
export JERRY_TARGETS = $(foreach __MODE,$(TARGET_MODES),$(foreach __SYSTEM,$(TARGET_SYSTEMS),$(__MODE).$(__SYSTEM)))
|
||||
export TESTS_TARGET = unittests
|
||||
export PARSER_TESTS_TARGET = testparser
|
||||
export CHECK_TARGETS = $(foreach __TARGET,$(JERRY_TARGETS),$(__TARGET).check)
|
||||
export FLASH_TARGETS = $(foreach __TARGET,$(foreach __MODE,$(TARGET_MODES),$(foreach __SYSTEM,$(TARGET_MCU_SYSTEMS),$(__MODE).$(__SYSTEM))),$(__TARGET).flash)
|
||||
|
||||
@@ -60,16 +72,51 @@ export echo
|
||||
export todo
|
||||
export fixme
|
||||
export color
|
||||
export sanitize
|
||||
export valgrind
|
||||
export musl
|
||||
export libc_raw
|
||||
|
||||
all: clean $(TESTS_TARGET) $(CHECK_TARGETS)
|
||||
build: clean $(JERRY_TARGETS)
|
||||
|
||||
$(JERRY_TARGETS) $(TESTS_TARGET) $(PARSER_TESTS_TARGET) $(FLASH_TARGETS) $(CHECK_TARGETS):
|
||||
@echo $@
|
||||
@$(MAKE) -f Makefile.mk TARGET=$@ $@
|
||||
all: clean $(JERRY_TARGETS) $(TESTS_TARGET) $(CHECK_TARGETS)
|
||||
|
||||
.SILENT: commit
|
||||
|
||||
GIT_STATUS_NOT_CLEAN_MSG="Git status of current directory is not clean"
|
||||
GIT_STATUS_CONSIDER_CLEAN_MSG="Consider removing all untracked files and locally commiting all changes and running \'make precommit\' again"
|
||||
PRECOMMIT_CHECK_TARGETS_LIST= debug.linux-sanitize.check \
|
||||
debug.linux-valgrind.check \
|
||||
debug_release.linux-sanitize.check \
|
||||
debug_release.linux-valgrind.check \
|
||||
release.linux-sanitize.check \
|
||||
release.linux-musl-valgrind.check \
|
||||
release.linux-libc_raw-valgrind.check
|
||||
|
||||
git_status_pre_test_check:
|
||||
@ clear
|
||||
@ if [ "`git status --porcelain 2>&1 | wc -l`" != "0" ]; \
|
||||
then \
|
||||
echo -e "\n \e[1;90m$(GIT_STATUS_NOT_CLEAN_MSG):\n"; \
|
||||
git status ; \
|
||||
echo -e "\n\n $(GIT_STATUS_CONSIDER_CLEAN_MSG).\e[0m\n"; \
|
||||
fi
|
||||
|
||||
precommit: clean git_status_pre_test_check build
|
||||
@ echo -e "\n================ Build completed successfully. Running precommit tests ================\n"
|
||||
@ echo -e "All targets were built successfully. Starting unit tests' build and run.\n"
|
||||
@ $(MAKE) -s unittests TESTS_OPTS="--silent"
|
||||
@ echo -e "Unit tests completed successfully. Starting parse-only testing.\n"
|
||||
@ $(MAKE) -s $(PRECOMMIT_CHECK_TARGETS_LIST) TESTS_DIR=./tests/jerry TESTS_OPTS="--parse-only" OUTPUT_TO_LOG=enable
|
||||
@ echo -e "\e[0;31mFIXME:\e[0m './benchmarks/jerry parse-only' testing skipped.\n"; # $(MAKE) -s $(PRECOMMIT_CHECK_TARGETS_LIST) TESTS_DIR=./benchmarks/jerry TESTS_OPTS="--parse-only" OUTPUT_TO_LOG=enable
|
||||
@ echo -e "Parse-only testing completed successfully. Starting full tests run.\n"
|
||||
@ echo -e "\e[0;31mFIXME:\e[0m Full testing skipped.\n"; # $(MAKE) -s $(PRECOMMIT_CHECK_TARGETS_LIST) TESTS_DIR=./tests/jerry OUTPUT_TO_LOG=enable
|
||||
@ echo -e "Full testing completed successfully\n\n================\n\n"
|
||||
@ if [ "`git status --porcelain 2>&1 | grep -v -e '^?? out/$' | wc -l`" == "0" ]; \
|
||||
then \
|
||||
echo -e "\e[0;32m OK to push\e[0m"; \
|
||||
else \
|
||||
echo -e "\e[1;33m $(GIT_STATUS_NOT_CLEAN_MSG). $(GIT_STATUS_CONSIDER_CLEAN_MSG).\e[0m\n"; \
|
||||
fi;
|
||||
|
||||
$(JERRY_TARGETS) $(TESTS_TARGET) $(FLASH_TARGETS) $(CHECK_TARGETS):
|
||||
@$(MAKE) -s -f Makefile.mk TARGET=$@ $@
|
||||
|
||||
clean:
|
||||
rm -rf $(OUT_DIR)
|
||||
@ rm -rf $(OUT_DIR)
|
||||
|
||||
Reference in New Issue
Block a user