Moved all eval over own function for argument validation.
All checks were successful
Run test asserts / Test-Asserts (push) Successful in -2s

This commit is contained in:
Willem Cazander 2024-07-07 23:26:47 +02:00
parent 183b0908aa
commit 8a07c9de8d
11 changed files with 78 additions and 42 deletions

View file

@ -1,5 +1,5 @@
define mb_assert_flow_grep_binary
define __mb_assert_flow_grep_binary
$(1)/@assert-$(2): $(1)/@build
grep -q -U $(4) $(1)/$(3)
$$(call mb_make_call,mb_make_echo_assert,Assert succesfully @assert-$(2))
@ -7,10 +7,17 @@ $$(call mb_make_call,mb_doc_target,$(1)/@assert-$(2),"Asserts that $(3) output m
MB_PROJ_PHASE_TEST_DEPS += $(1)/@assert-$(2)
.PHONY: $(1)/@assert-$(2)
endef
define mb_assert_flow_grep_binary
$(if $(1),,$(error Argument 1 missing))
$(if $(2),,$(error Argument 2 missing))
$(if $(3),,$(error Argument 3 missing))
$(if $(4),,$(error Argument 4 missing))
$(eval $(call mb_make_call,__mb_assert_flow_grep_binary,$(1),$(2),$(3),$(4)))
endef
$(call mb_make_call,mb_doc_function_flow,mb_assert_flow_grep_binary,"Prints flow of single binary grep assert.","<build-dir> <test-id> <file> <grep-match>")
#$$(call mb_delete,$(1)/$(3).out)
define mb_assert_flow_bdos_grep
define __mb_assert_flow_bdos_grep
$(1)-test-$(2)/@assert: $(1)/@build
$$(call mb_make_call,mb_os_dir_create,$(1)-test-$(2))
$$(call mb_make_call,mb_os_file_copy,$(1)/$(3).com,$(1)-test-$(2))
@ -21,4 +28,11 @@ $$(call mb_make_call,mb_doc_target,$(1)-test-$(2)/@assert,"Asserts that $(3) out
MB_PROJ_PHASE_TEST_DEPS += $(1)-test-$(2)/@assert
.PHONY: $(1)-test-$(2)/@assert
endef
define mb_assert_flow_bdos_grep
$(if $(1),,$(error mb_assert_flow_bdos_grep: Argument 1 missing))
$(if $(2),,$(error Argument 2 missing))
$(if $(3),,$(error Argument 3 missing))
$(if $(4),,$(error Argument 4 missing))
$(eval $(call mb_make_call,__mb_assert_flow_bdos_grep,$(1),$(2),$(3),$(4)))
endef
$(call mb_make_call,mb_doc_function_flow,mb_assert_flow_bdos_grep,"Prints flow of single grep assert.","<build-dir> <test-id> <cmd-name> <grep-match>")

View file

@ -137,7 +137,7 @@ endef
MB_DOC_FIRE_FUNCTION_DEEP += $(call mb_make_call,_mb_doc_function4u_deep,mb_doc_target_run,"Prints formatted documention of an run target.","<name> [desc]")
define mb_doc_flow_help
define __mb_doc_flow_help
@help:
$$(if $$(filter txt,$$(MB_DOC_FORMAT)),@echo "Welcome to the $$(if $(1),$(1),MSXBUILD) help system.\\n\\nFor detailed fire help use one of the following targets;\\n")
$$(if $$(filter xml,$$(MB_DOC_FORMAT)),@echo $$(call mb_make_xml_open,$$(MB_DOC_XML_ROOT)))
@ -272,5 +272,9 @@ $$(call mb_make_call,mb_doc_target_help,@help-all,"Lists all documented informat
$$(call mb_make_call,mb_doc_target_help,@help-firemake,"Output all documention in XML for IDE integration.")
.PHONY: @help-firemake
endef
define mb_doc_flow_help
$(if $(1),,$(error $(1) missing))
$(eval $(call mb_make_call,__mb_doc_flow_help,$(1)))
endef
MB_DOC_FIRE_FUNCTION_FLOW += $(call mb_make_call,_mb_doc_function4u_flow,mb_doc_flow_help,"Prints flow of fire help target.","[project-name]")

View file

@ -27,7 +27,7 @@ endef
$(call mb_make_call,mb_doc_function,mb_flight_video_merge,"Merged all flight videos to one.","<dir>")
define mb_flight_proj_flow_video
define __mb_flight_proj_flow_video
@@flight-video-build: @build
$$(if $$(filter on,$$(MB_FLIGHT_VIDEO)),$$(call mb_make_call,mb_flight_video_merge,$(1)))
@ -63,5 +63,9 @@ $$(call mb_make_call,mb_doc_target_help,@flight-video-test,"Runs @clean and @tes
$$(call mb_make_call,mb_doc_target_help,@flight-video-package-qa,"Runs @clean and @package-qa with recorder and merges flight videos to one.")
.PHONY: @flight-video-package-qa
endef
define mb_flight_proj_flow_video
$(if $(1),,$(error $(1) missing))
$(eval $(call mb_make_call,__mb_flight_proj_flow_video,$(1)))
endef
$(call mb_make_call,mb_doc_function_flow,mb_flight_proj_flow_video,"Prints flow for adding flight video targets in project build cycle.","<path-bin>")

View file

@ -54,12 +54,6 @@ endef
$(call mb_make_call,mb_doc_function_deep,mb_make_call,"Checked origin call function wrapper.","<function> [args...]")
define mb_make_call_eval
$(eval $(call mb_make_call,$(1),$(2),$(3),$(4),$(5),$(6),$(7),$(8),$(9)))
endef
$(call mb_make_call,mb_doc_function_deep,mb_make_call_eval,"Eval and origin checked flow injector.","<function> [args...]")
define mb_make_lowercase
$(subst A,a,$(subst B,b,$(subst C,c,$(subst D,d,$(subst E,e,$(subst F,f,$(subst G,g,$(subst H,h,$(subst I,i,$(subst J,j,$(subst K,k,$(subst L,l,$(subst M,m,$(subst N,n,$(subst O,o,$(subst P,p,$(subst Q,q,$(subst R,r,$(subst S,s,$(subst T,t,$(subst U,u,$(subst V,v,$(subst W,w,$(subst X,x,$(subst Y,y,$(subst Z,z,$(1)))))))))))))))))))))))))))
endef
@ -96,9 +90,13 @@ endef
$(call mb_make_call,mb_doc_function_deep,mb_make_xml_tag_value,"Print xml tag with value inside.","<tag> [value]")
define mb_make_flow_0module
define __mb_make_flow_0module
include $$(call mb_make_call,mb_make_rwildcard,$(1),*/0module.mk)
endef
define mb_make_flow_0module
$(if $(1),,$(error $(1) missing))
$(eval $(call mb_make_call,__mb_make_flow_0module,$(1)))
endef
$(call mb_make_call,mb_doc_function_flow,mb_make_flow_0module,"Prints flow of recursive 0module.mk include.","<dir>")

View file

@ -63,24 +63,24 @@ $(call mb_make_call,mb_doc_function_deep,mb_proj_module_deps,"Convert other file
define _mb_proj_flow_step_before
$(call mb_make_call,mb_make_echo_phase,$(MB_PROJ_STEP_BEFORE_PREFIX)$@)
$(call mb_make_call,mb_make_echo_phase,$(MB_PROJ_STEP_BEFORE_PREFIX)$@)
endef
define _mb_proj_flow_step_done
$(call mb_make_call,mb_make_echo_phase,$(MB_PROJ_STEP_AFTER_PREFIX)$@)
$(if $(filter $@,$(MAKECMDGOALS)),$(call mb_make_call,mb_make_echo_good,$(MB_PROJ_STEP_DONE_PREFIX)$@))
$(call mb_make_call,mb_make_echo_phase,$(MB_PROJ_STEP_AFTER_PREFIX)$@)
$(if $(filter $@,$(MAKECMDGOALS)),$(call mb_make_call,mb_make_echo_good,$(MB_PROJ_STEP_DONE_PREFIX)$@))
endef
define _mb_proj_run_clean
$(foreach folder,$(1),$(if $(wildcard $(folder)),$(call mb_make_call,mb_make_echo_command,Removing folder $(folder));))
$(foreach folder,$(1),$(if $(wildcard $(folder)),$(call mb_make_call,mb_os_dir_delete,$(folder))))
$(foreach folder,$(1),$(if $(wildcard $(folder)),$(call mb_make_call,mb_make_echo_command,Removing folder $(folder));))
$(foreach folder,$(1),$(if $(wildcard $(folder)),$(call mb_make_call,mb_os_dir_delete,$(folder))))
endef
define _mb_proj_run_init
$(foreach folder,$(1),$(if $(wildcard $(folder)),,$(call mb_make_call,mb_make_echo_command,Creating folder $(folder));))
$(foreach folder,$(1),$(if $(wildcard $(folder)),,$(call mb_make_call,mb_os_dir_create,$(folder))))
$(foreach folder,$(1),$(if $(wildcard $(folder)),,$(call mb_make_call,mb_make_echo_command,Creating folder $(folder));))
$(foreach folder,$(1),$(if $(wildcard $(folder)),,$(call mb_make_call,mb_os_dir_create,$(folder))))
endef
define mb_proj_flow_setup
define __mb_proj_flow_setup
@@clean:
$$(call mb_make_call,_mb_proj_flow_step_before)
.PHONY: @@clean
@ -188,14 +188,18 @@ $$(call mb_make_call,mb_doc_target_help,@package-qa,"Run all packages QA of proj
@package-deploy: @@package-deploy $$(MB_PROJ_PHASE_PACKAGE_DEPLOY_DEPS)
$$(call mb_make_call,_mb_proj_flow_step_done)
$$(call mb_make_call,__mb_proj_flow_step_done)
$$(call mb_make_call,mb_doc_target_help,@package-deploy,"Deploy all the packages.")
.PHONY: @package-deploy
endef
define mb_proj_flow_setup
$(if $(1),,$(error $(1) missing))
$(eval $(call mb_make_call,__mb_proj_flow_setup,$(1)))
endef
$(call mb_make_call,mb_doc_function_flow,mb_proj_flow_setup,"Prints flow of abstract project build cycle.","<build-dirs>")
define mb_proj_flow_setup_jp
define __mb_proj_flow_setup_jp
@クリーン: @clean
$$(call mb_make_call,_mb_proj_flow_step_done)
$$(call mb_make_call,mb_doc_target_help,@,"プロジェクトのビルドフォルダーをクリーンアップします。")
@ -246,5 +250,8 @@ $$(call mb_make_call,mb_doc_target_help,@パッケージの品質保証,"すべ
$$(call mb_make_call,mb_doc_target_help,@,"パッケージをデプロイします。")
.PHONY: @パッケージのデプロイ
endef
define mb_proj_flow_setup_jp
$(eval $(call mb_make_call,__mb_proj_flow_setup_jp))
endef
$(call mb_make_call,mb_doc_function_flow,mb_proj_flow_setup_jp,"Prints flow for japanese wrapper of project build cycle.")

View file

@ -1,5 +1,5 @@
define mb_tool_m80_flow_bdos_mono
define __mb_tool_m80_flow_bdos_mono
$(1): | @init
$$(call mb_make_call,mb_os_dir_create,$(1))
$$(call mb_make_call,mb_os_dir_create,$(1)/utils)
@ -43,10 +43,16 @@ $(1)/@run: $(1)/@build
$$(call mb_make_call,mb_doc_target_run,$(1)/@run,"Run $(3).com manually with gui.")
.PHONY: $(1)/@run
endef
define mb_tool_m80_flow_bdos_mono
$(if $(1),,$(error Argument 1 missing))
$(if $(2),,$(error Argument 2 missing))
$(if $(3),,$(error Argument 3 missing))
$(eval $(call mb_make_call,__mb_tool_m80_flow_bdos_mono,$(1),$(2),$(3)))
endef
$(call mb_make_call,mb_doc_function_flow,mb_tool_m80_flow_bdos_mono,"Prints flow of m80 toolchain bdos mono file module.","<bin-dir> <src-dir> <objname>")
define mb_tool_sdcc_flow_bdos_mono
define __mb_tool_sdcc_flow_bdos_mono
$(1): | @init
$$(call mb_make_call,mb_os_dir_create,$(1))
$$(call mb_make_call,mb_doc_target_deep,$(1))
@ -81,5 +87,11 @@ $(1)/@run: $(1)/@build
$$(call mb_make_call,mb_doc_target_run,$(1)/@run,"Run $(3).com manually with gui.")
.PHONY: $(1)/@run
endef
define mb_tool_sdcc_flow_bdos_mono
$(if $(1),,$(error Argument 1 missing))
$(if $(2),,$(error Argument 2 missing))
$(if $(3),,$(error Argument 3 missing))
$(eval $(call mb_make_call,__mb_tool_sdcc_flow_bdos_mono,$(1),$(2),$(3)))
endef
$(call mb_make_call,mb_doc_function_flow,mb_tool_sdcc_flow_bdos_mono,"Prints flow of sdcc toolchain bdos mono file module.","<bin-dir> <src-dir> <objname>")