Fix GTest Expect Exit Code Return #1842
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request addresses #1720 so that while gtest expect calls will not abort, they may fail the test when the game ends.
The first thing I had to do was get rid of the default parameter on
game_end
so that extensions are able to manipulate the game end return value. This circumvents having to update all of the existing tests to ask the gtest extension for an exit code to return or whether there was a failure. It may still be useful to provide that information later though.I also had to tweak the Win32 and SDL platform's quit to just end the game rather than setting the exit code to 0, since that would preclude an extension being able to effect the game return code.
I tweaked the GTest Makefile in this too because I am tired of having to tweak it every time I want to run the extension on Windows. The package in MSYS2 only provides a dll, no static library, and thus the file extension is necessary for it to build.
Finally, I made the GTest extension set the game exit code to 43 if an expect fails (a non-assert, aka soft assert, failure). This will make it easy to quickly discern hard and soft assertion failures in the test harness.