Skip to content

Created cheat save file generator for testing purposes.

username-removed-1096594 requested to merge traas/open-adventure:master into master

What I was trying to do before was fragile; I committed a save file that was hacked. However, if the game_t or save_t ever changed, that could break the test.

So I created a new make target: cheat, which creates a binary called cheat. Cheat uses the advent structures and functions to generate a legitimate save file with numdie = -1000. Then we use that to run tests.

I had to modify suspend() to seperate out as savefile() the part that generates the save file from the part that asks for user input, so I could call that directly from the main() in cheat. I also made a new make target, and execute the cheat binary in tests/Makefile

If this is not the approach to achieve coverage that you want to see, let me know.

Merge request reports