-
Notifications
You must be signed in to change notification settings - Fork 320
Command Line Lua and Headless Emulation #526
Comments
This is actually already supported - I added this a while ago at another person's request but never added proper documentation for it. Try this in a command prompt: In the script, use emu.stop(exitcode) to return an exit code for the process. You can also specify a timeout in seconds with /timeout=100 The one thing you can't do is write output to the console - but it shouldn't be too hard to add if needed. |
I'm not certain what it could be but that gives me a guaranteed critical error and mesen crashes immediately. Even if the lua script contains only the emu.stop, is completely empty or if I provide any of your example scripts. The scripting works fine when run from the GUI but running them from the command line always provides this same error:
Is there a version aside from |
It's possible that the feature was broken in subsequent releases (nobody has actually been using this, afaik). You could try 0.9.4-0.9.6 to see if one of those work. I'll take a look at the crash when I get back home in a few weeks. |
Thanks for the help. I'll see which version works as expected and then take a quick look at the relevant diffs, see if I can't spot something obvious. |
The crash was caused by changes I did when adding support for VS Dual System. |
Caveat: I'm not sure how difficult this would be to implement as I haven't really dug into the codebase, but if it's doable I believe it would be of use to developers.
Feature Request
Details
I would love to see the ability to launch lua scripts from the command line and, in addition, run 'headless' emulation. I think these features would be a huge boon to developers and would really add to the already fantastic dev features.
I have found myself using Lua scripts during development to do run tests (using lua-unit) as it's a great way of verifying that subroutines function correctly in all cases, that inputs are always handled correctly, etc. Generally my tests will put the system into a known state, jump into a subroutine and then test the state upon the completion of the routine. This type of automated testing would benefit from a CLI option.
In addition, since there would be no need for manual I/O interaction, it would be excellent to allow these tests to run in a headless mode where the Mesen gui is not used at all and the lua script simply outputs to the terminal. This would allow for scripts or CI runners to easily run triggered tests upon building, commiting, etc.
The text was updated successfully, but these errors were encountered: