msxbuild/lib/make/mb_assert.mk
Willem Cazander d7dc7b9644
All checks were successful
Run test asserts / Test-Asserts (push) Successful in -3s
Added i18n and updated jp i18n test text.
2024-07-08 04:23:37 +02:00

34 lines
1.7 KiB
Makefile

define __mb_assert_flow_grep_binary
$(1)/@assert-$(2): $(1)/@build
grep -q -U $(4) $(1)/$(3)
$$(call mb_make_call,mb_os_echo_assert,$$(MB_I18N_ASSERT_SUCCESS) @assert-$(2))
$$(call mb_make_call,mb_doc_target,$(1)/@assert-$(2),"Asserts that $(3) output matches.")
$$(call mb_make_call,mb_proj_grow_deps_phase_test,$(1)/@assert-$(2))
.PHONY: $(1)/@assert-$(2)
endef
define mb_assert_flow_grep_binary
$(call mb_make_call,mb_make_check_arg4,mb_assert_flow_grep_binary,$(1),$(2),$(3),$(4))
$(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
$(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))
$$(call mb_make_call,mb_msxpipe_safe_test,$(1)-test-$(2),$(3) > $(3).out)
grep -q $(4) $(1)-test-$(2)/$(3).out
$$(call mb_make_call,mb_os_echo_assert,$$(MB_I18N_ASSERT_SUCCESS) $(1)-test-$(2)/@assert)
$$(call mb_make_call,mb_doc_target,$(1)-test-$(2)/@assert,"Asserts that $(3) output matches.")
$$(call mb_make_call,mb_proj_grow_deps_phase_test,$(1)-test-$(2)/@assert)
.PHONY: $(1)-test-$(2)/@assert
endef
define mb_assert_flow_bdos_grep
$(call mb_make_call,mb_make_check_arg4,mb_assert_flow_bdos_grep,$(1),$(2),$(3),$(4))
$(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>")