msxbuild/lib/make/𓃬𓍄𓋹𓀭/mb_flow_assert.mk
Willem Cazander b67ba15457
All checks were successful
Run test asserts / Test-Asserts (push) Successful in -11s
WIP moving all flow to namespace.
2024-07-12 17:59:26 +02:00

42 lines
2.3 KiB
Makefile
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

define __mb_assert_flow_grep_binary
.RECIPEPREFIX := $(MB_@RECIPE)
$(1)/@assert-$(2): $(1)/@build
$(MB_@RECIPE)grep -q -U $(4) $(1)/$(3)
$(MB_@RECIPE)$$(call mb_make_call,mb_os_echo_assert,$$(MB_I18N_ASSERT_SUCCESS) @assert-$(2))
$(MB_   )$$(call mb_make_call,mb_doc_target,$(1)/@assert-$(2),"Asserts that $(3) output matches.")
$(MB_   )$$(call mb_make_call,mb_make_target_phony,$(1)/@assert-$(2))
$(MB_   )$$(call mb_make_call,mb_proj_grow_deps_phase,@test,$(1)/@assert-$(2))
.RECIPEPREFIX := $(MB_@RECIPEPREFIX)
endef
define mb_assert_flow_grep_binary
$(MB_   )$(call mb_make_call,mb_make_check_arg4,mb_assert_flow_grep_binary,$(1),$(2),$(3),$(4))
$(MB_   )$(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
.RECIPEPREFIX := $(MB_@RECIPE)
MB__TARGET := $(1)-test-$(2)/@assert
$(1)-test-$(2)/@assert: $(1)/@build
$(MB_@RECIPE)$$(call mb_make_call,mb_os_dir_create,$(1)-test-$(2))
$(MB_@RECIPE)$$(call mb_make_call,mb_os_file_copy,$(1)/$(3).com,$(1)-test-$(2))
$(MB_@RECIPE)$$(call mb_make_call,mb_msxpipe_safe_test,$(1)-test-$(2),$(3) > $(3).out,$(5))
$(MB_@RECIPE)grep -q $(4) $(1)-test-$(2)/$(3).out
$(MB_@RECIPE)$$(call mb_make_call,mb_os_echo_assert,$$(MB_I18N_ASSERT_SUCCESS) $(1)-test-$(2)/@assert)
$(MB_   )$$(call mb_make_call,mb_doc_target,$(1)-test-$(2)/@assert,"Asserts that $(3) output matches.")
$(MB_   )$$(call mb_make_call,mb_make_target_phony,$(1)-test-$(2)/@assert)
$(MB_   )$$(call mb_make_call,mb_proj_grow_deps_phase,@test,$(1)-test-$(2)/@assert)
.RECIPEPREFIX := $(MB_@RECIPEPREFIX)
endef
define mb_assert_flow_bdos_grep
$(MB_   )$(call mb_make_call,mb_make_check_arg4,mb_assert_flow_bdos_grep,$(1),$(2),$(3),$(4))
$(MB_   )$(eval $(call mb_make_call,__mb_assert_flow_bdos_grep,$(1),$(2),$(3),$(4),$(5)))
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> [machine]")