New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Event interpreter unit testing #646
Comments
Made some progress DynRPG code repo: https://github.com/Ghabry/dynrpg-eventtracer Changes made to Player: https://github.com/Ghabry/easyrpg-player/tree/event_unittest |
Almost finished, I need some help from automake experts ;) @fdelapena @carstene1ns The TESTS need a different working directory: How to supply command line arguments to tests? At least --project-path will be required. https://github.com/Ghabry/easyrpg-player/blob/event_unittest/Makefile.am#L328 |
Move Route logging is now implemented in DynRPG plugin (via custom ASM code). |
What do you think? Should the traces (the log files) be stored in the event-test game or in the tests folder of player? |
How worth is separating event trace tests from Player tests? About running tests from the |
Well, many tests will fail (e.g. FileFinder) because they require a valid project. So it doesn't really matter if the trace files are in the game project or in player, both must be kept on sync. |
Ok, then I guess the best option is have it in the separate repository and keep its own Automake build files to keep Player's "make check" work properly without those game-dependent tests. |
Just noticed, that I don't need command line at all... The project_path can be overwritten via Env var RPG_GAME_PATH :D, upps |
Well there is still this issue around. For really serious serious testing there are different things that could be checked. As we are much more advanced now we can go deep into testing:
Required RPG_RT hooking. Outside of DynRPG - Should be universal.
|
What might be easier to maintain is a comprehensive set of unit tests. By black box testing, using RE tools, and the github issue list, we can understand the RPG_RT behavior and come up with a set of tests. Once we have the correct behavior encoded in unit tests, we don't need to maintain playback recordings to compare with RPG_RT. The biggest blocker to having a test suite is the use of global variables. This makes it very difficult to setup a mock environment to do isolated tests of components. Our code is in much better shape now than in previous generations, but we still have way too many tangled dependencies. Refactoring our code for testability will also force us to modularize our code. We should also do fuzz testing against our interpreter. We can fuzz the input parameter array. This will harden our engine against crashing on bad interpreter code and expose edge case behaviors. So to summarize:
|
Many times we observed now that old interpreter issues that got fixed are broken due to new bugfixes.
Because the interpreter is the most fragile part of our Player I would suggest new "unit tests" which consist of a minimal database, and a single (or 2 for teleporting) map file containing an event.
Things to do:
Tests could be executed by using --map-id and --new-game
The text was updated successfully, but these errors were encountered: