diff options
author | RevoluPowered <gordon@gordonite.tech> | 2020-07-20 17:35:34 +0100 |
---|---|---|
committer | Gordon MacPherson <gordon@gordonite.tech> | 2020-07-24 13:05:33 +0100 |
commit | 579342810f5c453e91063c54ca6544300ea09090 (patch) | |
tree | b01e1478605b835e1fe903384d753b114106d51e /platform/windows/godot_windows.cpp | |
parent | 93b50a62e333cd05702fb749ebcdc18127abe01b (diff) | |
download | redot-engine-579342810f5c453e91063c54ca6544300ea09090.tar.gz |
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.
Diffstat (limited to 'platform/windows/godot_windows.cpp')
-rw-r--r-- | platform/windows/godot_windows.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/platform/windows/godot_windows.cpp b/platform/windows/godot_windows.cpp index 910059a9fc..add559a717 100644 --- a/platform/windows/godot_windows.cpp +++ b/platform/windows/godot_windows.cpp @@ -146,6 +146,8 @@ int widechar_main(int argc, wchar_t **argv) { argv_utf8[i] = wc_to_utf8(argv[i]); } + TEST_MAIN_PARAM_OVERRIDE(argc, argv_utf8) + Error err = Main::setup(argv_utf8[0], argc - 1, &argv_utf8[1]); if (err != OK) { @@ -186,10 +188,12 @@ int _main() { return result; } -int main(int _argc, char **_argv) { +int main(int argc, char **argv) { + // override the arguments for the test handler / if symbol is provided + // TEST_MAIN_OVERRIDE + // _argc and _argv are ignored // we are going to use the WideChar version of them instead - #ifdef CRASH_HANDLER_EXCEPTION __try { return _main(); |