Added assert-all build target.

This commit is contained in:
Willem Cazander 2021-07-06 04:28:45 +02:00
parent 6cec28f1bc
commit 4b1d4e1d20
6 changed files with 32 additions and 17 deletions

View File

@ -52,9 +52,10 @@ Current set is WIP.
* mb_hex2com
* mb_hex2dat
* mb_openmsx_dos2
* mb_openmsx_macro80
* mb_msxhub_file
* mb_msxhub_get_dos2_sys
* mb_msxhub_get_dos2_com
* mb_msxhub_get_dos2
* mb_msxhub_get_macro80
* mb_assert_file_equals = note: text file only
* mb_autoexec_append_cmd
* mb_autoexec_append_echo

View File

@ -21,7 +21,7 @@ endif
# Remove space after separator
MB_PSEP = $(strip $(MB_SEP))
# Needed for comma in call arguments (like for l80.com)
# Needed for comma in call arguments (like for l80.com)
MB_COMMA:=,
define mb_clean

View File

@ -16,13 +16,11 @@ endef
define mb_msxhub_file
$(if $(wildcard $(MB_MSXHUB_CACHE)/$(subst $(MB_MSXHUB_API)/,,$(2))),,$(call _mb_msxhub_fetch_file,$(2)))
$(call mb_copy,$(MB_MSXHUB_CACHE)/$(subst $(MB_MSXHUB_API)/,,$(2)),$(dir $(1))$(call _mb_lowercase,$(notdir $(1))))
$(if $(wildcard $(dir $(1))$(call _mb_lowercase,$(notdir $(1)))),,$(call mb_copy,$(MB_MSXHUB_CACHE)/$(subst $(MB_MSXHUB_API)/,,$(2)),$(dir $(1))$(call _mb_lowercase,$(notdir $(1)))))
endef
define mb_msxhub_get_dos2_sys
define mb_msxhub_get_dos2
$(call mb_msxhub_file,$(1)/MSXDOS2.SYS,$(MB_MSXHUB_API)/MSXDOS2/2.20-1/get/MSXDOS2/MSXDOS2.SYS)
endef
define mb_msxhub_get_dos2_com
$(call mb_msxhub_file,$(1)/COMMAND2.COM,$(MB_MSXHUB_API)/MSXDOS2/2.20-1/get/MSXDOS2/COMMAND2.COM)
endef

View File

@ -33,17 +33,25 @@ define _mb_openmsx_run
JOYPORTB=$(MB_OPENMSX_JOYPORTB) \
$(MB_OPENMSX_CMD)
endef
define _mb_openmsx_run_dos
$(call mb_msxhub_file,$(1)/omsxctl.com,$(MB_MSXHUB_API)/OMSXCTL/1.0-1/get/OMSXCTL/omsxctl.com)
$(call _mb_openmsx_run,$(1))
endef
# TODO: add msx1+allversions of dos to https://github.com/fr3nd/msxhub-packages/issues/18
#define mb_openmsx_dos1
# cp build/msxdos1/* $(1)
# $(call mb_msxhub_get_dos1,$(1))
# $(call _mb_openmsx_run_dos,$(1))
#endef
define mb_openmsx_dos2
$(call mb_msxhub_get_dos2_sys,$(1))
$(call mb_msxhub_get_dos2_com,$(1))
$(call _mb_openmsx_run_dos, $(1))
$(call mb_msxhub_get_dos2,$(1))
$(call _mb_openmsx_run_dos,$(1))
endef
define mb_openmsx_macro80
$(call mb_msxhub_get_macro80,$(1))
$(call mb_openmsx_dos2,$(1))
endef

9
test/0module.mk Normal file
View File

@ -0,0 +1,9 @@
BUILD_HELP += \\n\\t* assert-all \(Run all asertion tests\)
BUILD_TEST := \
test-ahello-m80-assert \
test-ahello-sdcc-assert
.PHONY: assert-all
assert-all: $(BUILD_TEST)
@echo All assertions completed.

View File

@ -1,21 +1,20 @@
TEST_AHELLO_M80 := $(PATH_BIN)/test/ahello-m80
TEST_AHELLO_M80 := $(PATH_BIN)/test/ahello-m80
BUILD_HELP += \\n\\t* $(TEST_AHELLO_M80)/ahello.com\\n\\t* test-ahello-m80-run\\n\\t* test-ahello-m80-assert
$(TEST_AHELLO_M80):
$(call mb_mkdir,$(TEST_AHELLO_M80))
$(call mb_msxhub_get_macro80,$(TEST_AHELLO_M80))
$(TEST_AHELLO_M80)/%.mac: test/ahello-m80/%.mac | $(TEST_AHELLO_M80)
$(call mb_unix2dos,$<,$@)
$(TEST_AHELLO_M80)/ahello.rel: $(TEST_AHELLO_M80)/ahello.mac
$(call mb_autoexec_cmd,$(TEST_AHELLO_M80),m80 =ahello/Z)
$(call mb_openmsx_dos2,$(TEST_AHELLO_M80))
$(call mb_openmsx_macro80,$(TEST_AHELLO_M80))
$(TEST_AHELLO_M80)/ahello.hex: $(TEST_AHELLO_M80)/ahello.rel
$(call mb_autoexec_cmd,$(TEST_AHELLO_M80),l80 ahello$(MB_COMMA)ahello/N/X/Y/E)
$(call mb_openmsx_dos2,$(TEST_AHELLO_M80))
$(call mb_openmsx_macro80,$(TEST_AHELLO_M80))
$(TEST_AHELLO_M80)/ahello.com: $(TEST_AHELLO_M80)/ahello.hex
$(call mb_hex2com,$(TEST_AHELLO_M80)/ahello.hex,$(TEST_AHELLO_M80)/ahello.com)
@ -23,11 +22,11 @@ $(TEST_AHELLO_M80)/ahello.com: $(TEST_AHELLO_M80)/ahello.hex
.PHONY: test-ahello-m80-run
test-ahello-m80-run: $(TEST_AHELLO_M80)/ahello.com
$(call mb_autoexec_open_gui,$(TEST_AHELLO_M80))
$(call mb_openmsx_dos2,$(TEST_AHELLO_M80))
$(call mb_openmsx_macro80,$(TEST_AHELLO_M80))
.PHONY: test-ahello-m80-assert
test-ahello-m80-assert: $(TEST_AHELLO_M80)/ahello.com
$(call mb_delete,$(TEST_AHELLO_M80)/test.out)
$(call mb_autoexec_cmd_test,$(TEST_AHELLO_M80),ahello > test.out)
$(call mb_openmsx_dos2,$(TEST_AHELLO_M80))
$(call mb_openmsx_macro80,$(TEST_AHELLO_M80))
grep "M80: Hello world..." $(TEST_AHELLO_M80)/test.out