t Add unit testing to Godot using DocTest and added to GitHub Actions CI

Implements exit codes into the engine so tests can return their statuses.
Ideally we don't do this, and we use FIXUP logic to 'begin' and 'end' the engine execution for tests specifically.

Since realistically we're initialising the engine here we don't want to do that, since String should not require an engine startup to test a single header.

This lowers the complexity of running the unit tests and even for
physics should be possible to implement such a fix.
This commit is contained in:
RevoluPowered 2020-07-20 17:35:34 +01:00 committed by Gordon MacPherson
parent 93b50a62e3
commit 579342810f
24 changed files with 7417 additions and 1397 deletions

View file

@ -131,6 +131,10 @@ int main(int argc, char *argv[]) {
/* clang-format on */
os = new OS_JavaScript();
// We must override main when testing is enabled
TEST_MAIN_OVERRIDE
Main::setup(argv[0], argc - 1, &argv[1], false);
emscripten_set_main_loop(main_loop_callback, -1, false);
emscripten_pause_main_loop(); // Will need to wait for FS sync.