diff --git a/tests/bgb_get_snapshot.py b/tests/bgb_get_snapshot.py index a4b910f..e28e9ad 100644 --- a/tests/bgb_get_snapshot.py +++ b/tests/bgb_get_snapshot.py @@ -41,25 +41,30 @@ def make_and_run(rom_relative): rom_path_full = base_path.joinpath(rom_relative) screenshot_path = rom_path_full.with_suffix('.bmp') - print("executing bgb: ", "../bgb/bgb64.exe", - "-set \"DebugSrcBrk=1\"", - "-hf", - "-stateonexit", - "-screenonexit", screenshot_path, - rom_relative) - - subprocess.call([ - "../bgb/bgb64.exe", - "-set \"DebugSrcBrk=1\"", + bgb_exe = ["wine", "../bgb/bgb64.exe"] + + if os.name == 'Windows': + bgb_exe = ["../bgb/bgb64.exe"] + + cmd = [ + *bgb_exe, + '-set DebugSrcBrk=1', "-hf", "-stateonexit", - "-screenonexit", screenshot_path, + "-screenonexit", screenshot_path.absolute().as_posix(), rom_relative, - ], - cwd=base_dir, - # stdout=subprocess.DEVNULL, - # stderr=subprocess.DEVNULL, - ) + ] + + print("executing bgb: ", cmd) + my_env = os.environ.copy() + my_env["WINEDEBUG"] = "fixme-all" + + subprocess.call(cmd, + cwd=base_dir, + env=my_env, + # stdout=subprocess.DEVNULL, + # stderr=subprocess.DEVNULL, + ) print("bgb: finished")