CharmedBaryon / CommonLibSSE-NG

This is a reverse engineered library for Skyrim Special Edition and Skyrim VR.
MIT License
142 stars 32 forks source link

Enable headless failures for unit testing in CI environments. #20

Closed jpstewart closed 2 years ago

jpstewart commented 2 years ago

Previously failed tests or negative test cases would freeze the test job in GitHub Actions, due to them calling MessageBox, at which point the job waits for a person to confirm the message. Even locally, the use of TerminateProcess ended the testing.

With the use of ENABLE_COMMONLIBSSE_TESTING the behavior of a failure changes to throwing an exception, which can be caught by negative test cases, or results in a proper test failure.

This change also refactors the way in which inject/mock calls fail; they still return a bool to indicate status but now log identically to report_and_fail.