Skip to content
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

Fix GTest Expect Exit Code Return #1842

Merged
merged 3 commits into from Aug 1, 2019
Merged

Conversation

RobertBColton
Copy link
Contributor

@RobertBColton RobertBColton commented Aug 1, 2019

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.

@RobertBColton RobertBColton added Extensions Official ENIGMA extensions or GameMaker extensions and external libraries. Universal System Resource storage and other logic universal to more than one system or extension. Continuous Integration Related to CI services utilized and the related scripts. labels Aug 1, 2019
@RobertBColton RobertBColton added the Platforms Win32, Xlib, Cocoa, SDL and other target platforms. label Aug 1, 2019
Copy link
Member

@JoshDreamland JoshDreamland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no idea why that works, unless libgtest.dll is just the library that loads the DLL.

@codecov
Copy link

codecov bot commented Aug 1, 2019

Codecov Report

Merging #1842 into master will increase coverage by 0.09%.
The diff coverage is 75%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1842      +/-   ##
==========================================
+ Coverage   24.89%   24.99%   +0.09%     
==========================================
  Files         177      177              
  Lines       16743    16776      +33     
==========================================
+ Hits         4169     4193      +24     
- Misses      12574    12583       +9
Impacted Files Coverage Δ
ENIGMAsystem/SHELL/Platforms/General/PFmain.cpp 75.92% <100%> (-4.85%) ⬇️
.../SHELL/Universal_System/Extensions/GTest/GTest.cpp 71.42% <50%> (-2.26%) ⬇️
...stem/SHELL/Universal_System/Resources/AssetArray.h 73.46% <0%> (-26.54%) ⬇️
.../SHELL/Universal_System/Resources/fonts_internal.h 30.76% <0%> (-9.24%) ⬇️
...em/SHELL/Universal_System/Resources/fontstruct.cpp 0.64% <0%> (-0.54%) ⬇️
...stem/SHELL/Universal_System/Resources/fontinit.cpp 51.42% <0%> (+0.03%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7fcb1ce...891b052. Read the comment docs.

@RobertBColton RobertBColton merged commit f57003e into master Aug 1, 2019
@RobertBColton RobertBColton deleted the fix-gtest-expect-exit branch August 1, 2019 03:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Continuous Integration Related to CI services utilized and the related scripts. Extensions Official ENIGMA extensions or GameMaker extensions and external libraries. Platforms Win32, Xlib, Cocoa, SDL and other target platforms. Universal System Resource storage and other logic universal to more than one system or extension.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants