WIP Converted to per process openMSX share folder.
All checks were successful
Run test asserts / Test-Asserts (push) Successful in 2s

This commit is contained in:
Willem Cazander 2024-06-27 16:58:21 +02:00
parent d653e900f0
commit 567f91be78
18 changed files with 197 additions and 104 deletions

View file

@ -1,8 +1,6 @@
MB_AUTOEXEC_BYSELF ?= true
MB_AUTOEXEC_BYSELF_MSG ?= Generated by msxbuild Makefile
MB_AUTOEXEC_TEXTMODE ?= 80
MB_AUTOEXEC_TEXTCOLOR ?= 15,0,0
MB_AUTOEXEC_BYSELF_MSG ?= Run msxbuild:
MB_AUTOEXEC_VERSION ?= true
MB_AUTOEXEC_STARTUP_TIMEOUT ?= 60
MB_AUTOEXEC_STARTUP_EXITCODE ?= 124
@ -33,21 +31,25 @@ endef
define mb_autoexec_append_exit
$(call mb_autoexec_append_cmd,$(1),omsxctl exit 0)
endef
define mb_autoexec_append_cmd_test
define mb_autoexec_append_safe_test
$(call mb_autoexec_append_cmd,$(1),omsxctl fail_after $(MB_AUTOEXEC_TEST_TIMEOUT) seconds failed_test $(MB_AUTOEXEC_TEST_EXITCODE))
$(call mb_autoexec_append_echo,$(1),Running test '$(2)')
$(call mb_autoexec_append_cmd,$(1),$(2))
endef
define mb_autoexec_append_safe_cmd
$(call mb_autoexec_append_cmd,$(1),omsxctl fail_after $(MB_AUTOEXEC_CMD_TIMEOUT) seconds failed_cmd $(MB_AUTOEXEC_CMD_EXITCODE))
$(call mb_autoexec_append_echo,$(1),Running test '$(2)')
$(call mb_autoexec_append_cmd,$(1),$(2))
endef
define mb_autoexec_write_default
echo -n "" > $(1)/autoexec.bat
$(if $(filter true,$(MB_AUTOEXEC_BYSELF)),$(call mb_autoexec_append_rem,$(1),$(MB_AUTOEXEC_BYSELF_MSG)))
$(call mb_autoexec_append_cmd,$(1),omsxctl fail_after $(MB_AUTOEXEC_STARTUP_TIMEOUT) seconds failed_autoexec $(MB_AUTOEXEC_STARTUP_EXITCODE))
$(if $(filter 40,$(MB_AUTOEXEC_TEXTMODE)),$(call mb_autoexec_append_cmd,$(1),mode 40))
$(if $(filter 40,$(MB_AUTOEXEC_TEXTMODE)),$(call mb_autoexec_append_echo,$(1),Enabled mode 40.))
$(if $(filter 80,$(MB_AUTOEXEC_TEXTMODE)),$(call mb_autoexec_append_cmd,$(1),mode 80))
$(if $(filter 80,$(MB_AUTOEXEC_TEXTMODE)),$(call mb_autoexec_append_echo,$(1),Enabled mode 80.))
$(call mb_autoexec_append_cmd,$(1),COLOR $(MB_AUTOEXEC_TEXTCOLOR))
$(if $(filter 40,$(2)),$(call mb_autoexec_append_cmd,$(1),mode $(2)),$(call mb_autoexec_append_cmd,$(1),mode 80))
$(if $(filter 40,$(2)),$(call mb_autoexec_append_echo,$(1),Enabled mode $(2).),$(call mb_autoexec_append_echo,$(1),Enabled mode 80.))
$(call mb_autoexec_append_cmd,$(1),omsxctl fail_after $(MB_AUTOEXEC_STARTUP_TIMEOUT) seconds failed_exec $(MB_AUTOEXEC_STARTUP_EXITCODE))
$(call mb_autoexec_append_cmd,$(1),omsxctl setcolor 4 000 > NUL)
$(call mb_autoexec_append_cmd,$(1),omsxctl setcolor 15 777 > NUL)
$(if $(filter true,$(MB_AUTOEXEC_VERSION)),$(call mb_autoexec_append_cmd,$(1),ver))
$(if $(filter true,$(MB_AUTOEXEC_BYSELF)),$(call mb_autoexec_append_echo,$(1),$(MB_AUTOEXEC_BYSELF_MSG) $(notdir $(1))))
endef
define mb_autoexec_open_gui
@ -65,16 +67,12 @@ endef
define mb_autoexec_cmd
@echo === Generating autoexec.bat for command
$(call mb_autoexec_write_default,$(1))
$(call mb_autoexec_append_cmd,$(1),omsxctl fail_after $(MB_AUTOEXEC_CMD_TIMEOUT) seconds failed_cmd $(MB_AUTOEXEC_CMD_EXITCODE))
$(call mb_autoexec_append_echo,$(1),Running command '$(2)')
$(call mb_autoexec_append_cmd,$(1),$(2))
$(call mb_autoexec_append_safe_cmd,$(1),$(2))
$(call mb_autoexec_append_exit,$(1))
endef
define mb_autoexec_cmd_test
@echo === Generating autoexec.bat for command test
$(call mb_autoexec_write_default,$(1))
$(call mb_autoexec_append_cmd,$(1),omsxctl fail_after $(MB_AUTOEXEC_TEST_TIMEOUT) seconds failed_test $(MB_AUTOEXEC_TEST_EXITCODE))
$(call mb_autoexec_append_echo,$(1),Running test '$(2)')
$(call mb_autoexec_append_cmd,$(1),$(2))
$(call mb_autoexec_append_safe_test,$(1),$(2))
$(call mb_autoexec_append_exit,$(1))
endef

View file

@ -1,42 +0,0 @@
# OS cmds
ifeq ($(OS),Windows_NT)
MB_RM = del /F /Q
MB_RMDIR = RMDIR /S /Q
MB_MKDIR = mkdir
MB_COPY = copy
MB_ERRIGNORE = 2>NUL || true
MB_SEP=\\
MB_CACHE ?= %LOCALAPPDATA%
else
MB_RM = rm -f
MB_RMDIR = rm -rf
MB_MKDIR = mkdir -p
MB_COPY = cp
MB_ERRIGNORE = 2>/dev/null
MB_SEP=/
MB_CACHE ?= ~/.cache
endif
# Remove space after separator
MB_PSEP = $(strip $(MB_SEP))
# Needed for comma in call arguments (like for l80.com)
MB_COMMA:=,
define mb_clean
@echo === Cleaning build folder.
test $(1) && $(MB_RMDIR) $(1)
endef
define mb_mkdir
$(MB_MKDIR) $(1)
endef
define mb_delete
test $(1) && $(MB_RM) $(1)
endef
define mb_copy
$(MB_COPY) $(1) $(2)
endef
define mb_create_dist
tar -czf $(1) -C $(2) `ls $(2)`
endef

View file

@ -1,11 +1,6 @@
MB_MSXHUB_API ?= https://msxhub.com/api
MB_MSXHUB_CACHE ?= $(MB_CACHE)/msxhub/repro-v0
# NOTE: with HDD import/export we get duplicate files after openMSX run, so force to lowercase.
define _mb_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
MB_MSXHUB_CACHE ?= $(MB_CACHE)/msxbuild/msxhub
define _mb_msxhub_file_fetch
@echo === Fetch msxhub file
@ -13,6 +8,7 @@ define _mb_msxhub_file_fetch
$(if $(wildcard $(MB_MSXHUB_CACHE)/$(subst $(MB_MSXHUB_API)/,,$(1))),,wget -O $(MB_MSXHUB_CACHE)/$(subst $(MB_MSXHUB_API)/,,$(1)) $(1))
endef
# NOTE: with HDD import/export we get duplicate files after openMSX run, so force to lowercase.
define mb_msxhub_file
$(if $(wildcard $(MB_MSXHUB_CACHE)/$(2)),,$(call _mb_msxhub_file_fetch,$(MB_MSXHUB_API)/$(2)))
$(if $(wildcard $(1)/$(call _mb_lowercase,$(notdir $(2)))),,$(call mb_copy,$(MB_MSXHUB_CACHE)/$(2),$(1)/$(call _mb_lowercase,$(notdir $(2)))))

59
lib/make/mb_msxrom.mk Normal file
View file

@ -0,0 +1,59 @@
MB_MSXROM_API ?= https://msxrom.distributedrebirth.love/calc-pi/v19.1
MB_MSXROM_CACHE ?= $(MB_CACHE)/msxbuild/msxrom
define _mb_msxrom_file_fetch
@echo === Fetch msxrom file
$(if $(wildcard $(dir $(MB_MSXROM_CACHE)/$(subst $(MB_MSXROM_API)/,,$(1)))),,$(call mb_mkdir,$(dir $(MB_MSXROM_CACHE)/$(subst $(MB_MSXROM_API)/,,$(1)))))
$(if $(wildcard $(MB_MSXROM_CACHE)/$(subst $(MB_MSXROM_API)/,,$(1))),,wget -O $(MB_MSXROM_CACHE)/$(subst $(MB_MSXROM_API)/,,$(1)) $(1))
endef
define mb_msxrom_file
$(if $(wildcard $(MB_MSXROM_CACHE)/$(2)),,$(call _mb_msxrom_file_fetch,$(MB_MSXROM_API)/$(2)))
$(if $(wildcard $(1)/$(notdir $(2))),,$(call mb_copy,$(MB_MSXROM_CACHE)/$(2),$(1)/$(notdir $(2))))
$(if $(filter true,$(3)),$(call mb_copy,$(MB_MSXROM_CACHE)/$(2),$(1)/$(notdir $(2))))
endef
define mb_msxrom_setup
$(if $(wildcard $(1)-omsx),,$(call mb_mkdir,$(1)-omsx))
$(if $(wildcard $(1)-omsx/systemroms),,$(call mb_mkdir,$(1)-omsx/systemroms))
$(if $(wildcard $(1)-omsx/systemroms/machines),,$(call mb_mkdir,$(1)-omsx/systemroms/machines))
$(if $(wildcard $(1)-omsx/systemroms/extensions),,$(call mb_mkdir,$(1)-omsx/systemroms/extensions))
endef
define mb_msxrom_extension_ide_nextor
$(call mb_msxrom_file,$(1)-omsx/systemroms/extensions,extensions/Nextor-2.1.1.SunriseIDE.ROM)
endef
define mb_msxrom_extension_rs232
$(call mb_msxrom_file,$(1)-omsx/systemroms/extensions,extensions/rs232.rom)
endef
define mb_msxrom_extension_fmpac
$(call mb_msxrom_file,$(1)-omsx/systemroms/extensions,extensions/fmpac.rom)
endef
define mb_msxrom_extension_moonsound
$(call mb_msxrom_file,$(1)-omsx/systemroms/extensions,extensions/yrw801.rom)
endef
define mb_msxrom_extension_basickun
$(call mb_msxrom_file,$(1)-omsx/systemroms/extensions,machines/sanyo/phc-70fd2_basickun.rom)
endef
define mb_msxrom_machine_Canon_V-20
$(call mb_msxrom_file,$(1)-omsx/systemroms/machines,machines/canon/v-20_basic-bios1.rom)
endef
define mb_msxrom_machine_Philips_NMS_8250
$(call mb_msxrom_file,$(1)-omsx/systemroms/machines,machines/philips/nms8250_basic-bios2.rom)
$(call mb_msxrom_file,$(1)-omsx/systemroms/machines,machines/philips/nms8250_msx2sub.rom)
$(call mb_msxrom_file,$(1)-omsx/systemroms/machines,machines/philips/nms8250_disk.rom)
endef
define mb_msxrom_machine_Boosted_MSX2_EN
$(call mb_msxrom_machine_Philips_NMS_8250,$(1))
$(call mb_msxrom_extension_fmpac,$(1))
$(call mb_msxrom_extension_moonsound,$(1))
$(call mb_msxrom_extension_basickun,$(1))
endef

View file

@ -1,7 +1,7 @@
MB_OPENMSX_PATH_BIN ?= bin
MB_OPENMSX_BOOT_TIMEOUT ?= 25
MB_OPENMSX_MACHINE ?= Philips_NMS_8250
MB_OPENMSX_MACHINE_DEF ?= Philips_NMS_8250
MB_OPENMSX_SPEED ?= $(if $(findstring turboR,$(MB_OPENMSX_MACHINE)),100,333)
MB_OPENMSX_EXTS ?=
MB_OPENMSX_EXTRA_SLOT ?= -ext slotexpander
@ -13,14 +13,24 @@ MB_OPENMSX_JOYPORTB ?=
MB_OPENMSX_SCALE_FACTOR ?= 3
MB_OPENMSX_THROTTLE ?= off
MB_OPENMSX_RENDERER ?=
MB_OPENMSX_CTLCACHE ?= $(MB_CACHE)/omsxctl
MB_OPENMSX_CTLCACHE ?= $(MB_CACHE)/msxbuild/omsxctl
# TODO: create openMSX issue to clean share: https://github.com/openMSX/openMSX/issues/1672
define _mb_openmsx_setup
define mb_openmsx_setup
$(if $(wildcard $(MB_OPENMSX_CTLCACHE)),,$(call mb_mkdir,$(MB_OPENMSX_CTLCACHE)))
$(call mb_msxhub_file,$(MB_OPENMSX_CTLCACHE),OMSXCTL/1.0-1/get/OMSXCTL/omsxctl.tcl)
$(call mb_msxhub_file,$(MB_OPENMSX_CTLCACHE),OMSXCTL/1.0-1/get/OMSXCTL/omsxctl.com)
$(if $(wildcard ~/.openMSX/share/extensions/ide-nextor.xml),,$(call mb_copy,$(PATH_MSXBUILD_REAL)/lib/openmsx/ide-nextor.xml,~/.openMSX/share/extensions/))
$(if $(wildcard $(1)-omsx),,$(call mb_mkdir,$(1)-omsx))
$(if $(wildcard $(1)-omsx/stdio.xml),,$(call mb_copy,$(PATH_MSXBUILD_REAL)/lib/openmsx/stdio.xml,$(1)-omsx))
$(if $(wildcard $(1)-omsx/scripts),,$(call mb_mkdir,$(1)-omsx/scripts))
$(if $(wildcard $(1)-omsx/scripts/boot_env.tcl),,$(call mb_copy,$(PATH_MSXBUILD_REAL)/lib/openmsx/scripts/boot_env.tcl,$(1)-omsx/scripts))
$(if $(wildcard $(1)-omsx/scripts/boot_hdd.tcl),,$(call mb_copy,$(PATH_MSXBUILD_REAL)/lib/openmsx/scripts/boot_hdd.tcl,$(1)-omsx/scripts))
$(if $(wildcard $(1)-omsx/scripts/fail_after.tcl),,$(call mb_copy,$(PATH_MSXBUILD_REAL)/lib/openmsx/scripts/fail_after.tcl,$(1)-omsx/scripts))
$(if $(wildcard $(1)-omsx/scripts/omsxctl.tcl),,$(call mb_copy,$(MB_OPENMSX_CTLCACHE)/omsxctl.tcl,$(1)-omsx/scripts))
$(if $(wildcard $(1)-omsx/extensions),,$(call mb_mkdir,$(1)-omsx/extensions))
$(if $(wildcard $(1)-omsx/extensions/ide-nextor.xml),,$(call mb_copy,$(PATH_MSXBUILD_REAL)/lib/openmsx/extensions/ide-nextor.xml,$(1)-omsx/extensions))
$(call mb_msxrom_setup,$(1))
$(call mb_msxrom_extension_ide_nextor,$(1))
$(call mb_msxrom_machine_$(2),$(1))
endef
define _mb_openmsx_run
@ -29,29 +39,25 @@ define _mb_openmsx_run
FAIL_AFTER_PATH=$(MB_OPENMSX_PATH_BIN) \
BOOT_HDD_PATH="$(1)" \
BOOT_HDD_SIZE=$(MB_OPENMSX_HDD_SIZE) \
BOOT_HDD_IMAGE="$(MB_OPENMSX_PATH_BIN)/dsk-$(notdir $(1)).img" \
BOOT_HDD_IMAGE="$(1)-omsx/disk-ide-hda.img" \
JOYPORTA=$(MB_OPENMSX_JOYPORTA) \
JOYPORTB=$(MB_OPENMSX_JOYPORTB) \
SCALE_FACTOR=$(MB_OPENMSX_SCALE_FACTOR) \
SPEED=$(MB_OPENMSX_SPEED) \
RENDERER=$(MB_OPENMSX_RENDERER) \
THROTTLE=$(MB_OPENMSX_THROTTLE) \
OPENMSX_USER_DATA="$(1)-omsx" \
$(PATH_OPENMSX)/openmsx \
-machine $(MB_OPENMSX_MACHINE) \
-machine $(2) \
$(MB_OPENMSX_EXTRA_SLOT) \
$(MB_OPENMSX_EXTRA_HDD) \
$(MB_OPENMSX_EXTRA_MEM) \
$(MB_OPENMSX_EXTS) \
-script $(MB_OPENMSX_CTLCACHE)/omsxctl.tcl \
-script $(PATH_MSXBUILD_REAL)/lib/openmsx/boot_env.tcl \
-script $(PATH_MSXBUILD_REAL)/lib/openmsx/boot_hdd.tcl \
-script $(PATH_MSXBUILD_REAL)/lib/openmsx/fail_after.tcl \
-setting $(PATH_MSXBUILD_REAL)/lib/openmsx/boot_setting.xml \
-control stdio < $(PATH_MSXBUILD_REAL)/lib/openmsx/boot_stdio.xml
-control stdio < $(1)-omsx/stdio.xml
endef
define mb_openmsx_dosctl
$(if $(wildcard $(MB_OPENMSX_CTLCACHE)/omsxctl.tcl),,$(call _mb_openmsx_setup))
$(call mb_openmsx_setup,$(1),$(if $(2),$(2),$(MB_OPENMSX_MACHINE_DEF)))
$(if $(wildcard $(1)/omsxctl.com),,$(call mb_copy,$(MB_OPENMSX_CTLCACHE)/omsxctl.com,$(1)))
$(call _mb_openmsx_run,$(1))
$(call _mb_openmsx_run,$(1),$(if $(2),$(2),$(MB_OPENMSX_MACHINE_DEF)))
endef

View file

@ -2,15 +2,63 @@
# msxbuild.mk - Makefile helper to use with msx projects.
#
# Setup required tools paths
# Setup default tools paths
PATH_SDCC ?= /usr/bin
PATH_OPENMSX ?= /usr/bin
PATH_MSXBUILD ?= $(dir $(lastword $(MAKEFILE_LIST)))../..
PATH_MSXBUILD_REAL := $(if $(realpath $(PATH_MSXBUILD)),$(realpath $(PATH_MSXBUILD)),$(PATH_MSXBUILD))
# Include features
include $(PATH_MSXBUILD)/lib/make/mb_base.mk
# OS cmds
ifeq ($(OS),Windows_NT)
MB_RM = del /F /Q
MB_RMDIR = RMDIR /S /Q
MB_MKDIR = mkdir
MB_COPY = copy
MB_ERRIGNORE = 2>NUL || true
MB_SEP=\\
MB_CACHE ?= %LOCALAPPDATA%
else
MB_RM = rm -f
MB_RMDIR = rm -rf
MB_MKDIR = mkdir -p
MB_COPY = cp
MB_ERRIGNORE = 2>/dev/null
MB_SEP=/
MB_CACHE ?= ~/.cache
endif
# Remove space after separator
MB_PSEP = $(strip $(MB_SEP))
# Needed for comma in call arguments (like for l80.com)
MB_COMMA:=,
# Simple inline ascii lowercase
define _mb_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
define mb_clean
@echo === Cleaning build folder.
$(if $(wildcard $(1)),$(MB_RMDIR) $(1))
endef
define mb_mkdir
$(MB_MKDIR) $(1)
endef
define mb_delete
$(if $(wildcard $(1)),$(MB_RM) $(1))
endef
define mb_copy
$(MB_COPY) $(1) $(2)
endef
define mb_create_dist
@echo === Creating distribution archive.
tar -czf $(1) -C $(2) `ls $(2)`
endef
# Include extra features
include $(PATH_MSXBUILD)/lib/make/mb_autoexec.mk
include $(PATH_MSXBUILD)/lib/make/mb_msxrom.mk
include $(PATH_MSXBUILD)/lib/make/mb_msxhub.mk
include $(PATH_MSXBUILD)/lib/make/mb_packages.mk
include $(PATH_MSXBUILD)/lib/make/mb_openmsx.mk

View file

@ -1,8 +0,0 @@
<!DOCTYPE settings SYSTEM 'settings.dtd'>
<settings>
<settings>
<setting id="save_settings_on_exit">false</setting>
<setting id="sound_driver">null</setting>
</settings>
<bindings/>
</settings>

View file

@ -1,7 +0,0 @@
<openmsx-control>
<!--
When booting 'openmsx -control stdio < boot_stdio.xml'
It starts then in power off mode and without renderer for fast booting.
-->
<command>set power on</command>
</openmsx-control>

8
lib/openmsx/settings.xml Normal file
View file

@ -0,0 +1,8 @@
<!DOCTYPE settings SYSTEM 'settings.dtd'>
<settings>
<settings>
<setting id="save_settings_on_exit">false</setting>
<setting id="sound_driver">null</setting>
</settings>
<bindings/>
</settings>

3
lib/openmsx/stdio.xml Normal file
View file

@ -0,0 +1,3 @@
<openmsx-control>
<command>set power on</command>
</openmsx-control>

View file

@ -4,7 +4,8 @@ BUILD_TEST := \
test-ahello-m80-assert \
test-ahello-sdcc-assert \
test-dist-qa-dos1-assert \
test-dist-qa-dos2-assert
test-dist-qa-dos2-assert \
test-dist-qa-msx1-assert
.PHONY: assert-all
assert-all: $(BUILD_TEST)

View file

@ -18,10 +18,9 @@ test-dist-qa-dos1-run: | $(TEST_DIST_QA_DOS1_DEPS)
.PHONY: test-dist-qa-dos1-assert
test-dist-qa-dos1-assert: | $(TEST_DIST_QA_DOS1_DEPS)
$(call mb_delete,$(TEST_DIST_QA_DOS1)/test.out)
$(call mb_autoexec_write_default,$(TEST_DIST_QA_DOS1))
$(call mb_autoexec_append_cmd_test,$(TEST_DIST_QA_DOS1),ahello1)
$(call mb_autoexec_append_cmd_test,$(TEST_DIST_QA_DOS1),ahello2)
$(call mb_autoexec_append_safe_test,$(TEST_DIST_QA_DOS1),ahello1)
$(call mb_autoexec_append_safe_test,$(TEST_DIST_QA_DOS1),ahello2)
$(call mb_autoexec_append_exit,$(TEST_DIST_QA_DOS1))
$(call mb_openmsx_dosctl,$(TEST_DIST_QA_DOS1))

View file

@ -21,8 +21,8 @@ test-dist-qa-dos2-assert: | $(TEST_DIST_QA_DOS2_DEPS)
$(call mb_delete,$(TEST_DIST_QA_DOS2)/ahello1.out)
$(call mb_delete,$(TEST_DIST_QA_DOS2)/ahello2.out)
$(call mb_autoexec_write_default,$(TEST_DIST_QA_DOS2))
$(call mb_autoexec_append_cmd_test,$(TEST_DIST_QA_DOS2),ahello1 > ahello1.out)
$(call mb_autoexec_append_cmd_test,$(TEST_DIST_QA_DOS2),ahello2 > ahello2.out)
$(call mb_autoexec_append_safe_test,$(TEST_DIST_QA_DOS2),ahello1 > ahello1.out)
$(call mb_autoexec_append_safe_test,$(TEST_DIST_QA_DOS2),ahello2 > ahello2.out)
$(call mb_autoexec_append_exit,$(TEST_DIST_QA_DOS2))
$(call mb_openmsx_dosctl,$(TEST_DIST_QA_DOS2))
grep "M80: Hello world..." $(TEST_DIST_QA_DOS2)/ahello1.out

View file

@ -0,0 +1,32 @@
TEST_DIST_QA_MSX1_MACHINE ?= Canon_V-20
TEST_DIST_QA_MSX1 := $(PATH_BIN)/test/dist-qa-msx1
TEST_DIST_QA_MSX1_DEPS := $(subst dist,dist-qa-msx1,$(TEST_DIST_DEPS))
BUILD_HELP += \\n\\t* test-dist-qa-msx1-run\\n\\t* test-dist-qa-msx1-assert
$(TEST_DIST_QA_MSX1):
$(call mb_mkdir,$(TEST_DIST_QA_MSX1))
$(call mb_package_emuctl,$(TEST_DIST_QA_MSX1))
$(call mb_package_dos2,$(TEST_DIST_QA_MSX1))
$(TEST_DIST_QA_MSX1)/%: bin/test/dist/% | $(TEST_DIST_QA_MSX1) $(TEST_DIST_DEPS)
$(call mb_copy,$<,$@)
.PHONY: test-dist-qa-msx1-run
test-dist-qa-msx1-run: | $(TEST_DIST_QA_MSX1_DEPS)
$(call mb_autoexec_write_default,$(TEST_DIST_QA_MSX1),40)
$(call mb_autoexec_append_stop_fail,$(TEST_DIST_QA_MSX1))
$(call mb_autoexec_append_gui_mode,$(TEST_DIST_QA_MSX1))
$(call mb_openmsx_dosctl,$(TEST_DIST_QA_MSX1),$(TEST_DIST_QA_MSX1_MACHINE))
.PHONY: test-dist-qa-msx1-assert
test-dist-qa-msx1-assert: | $(TEST_DIST_QA_MSX1_DEPS)
$(call mb_delete,$(TEST_DIST_QA_MSX1)/ahello1.out)
$(call mb_delete,$(TEST_DIST_QA_MSX1)/ahello2.out)
$(call mb_autoexec_write_default,$(TEST_DIST_QA_MSX1),40)
$(call mb_autoexec_append_safe_test,$(TEST_DIST_QA_MSX1),ahello1 > ahello1.out)
$(call mb_autoexec_append_safe_test,$(TEST_DIST_QA_MSX1),ahello2 > ahello2.out)
$(call mb_autoexec_append_exit,$(TEST_DIST_QA_MSX1))
$(call mb_openmsx_dosctl,$(TEST_DIST_QA_MSX1),$(TEST_DIST_QA_MSX1_MACHINE))
grep "M80: Hello world..." $(TEST_DIST_QA_MSX1)/ahello1.out
grep "SDCC: Hello world..." $(TEST_DIST_QA_MSX1)/ahello2.out