From 579342810f5c453e91063c54ca6544300ea09090 Mon Sep 17 00:00:00 2001 From: RevoluPowered Date: Mon, 20 Jul 2020 17:35:34 +0100 Subject: 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. --- platform/linuxbsd/godot_linuxbsd.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'platform/linuxbsd/godot_linuxbsd.cpp') diff --git a/platform/linuxbsd/godot_linuxbsd.cpp b/platform/linuxbsd/godot_linuxbsd.cpp index 3ed64e9d46..e1796ccefe 100644 --- a/platform/linuxbsd/godot_linuxbsd.cpp +++ b/platform/linuxbsd/godot_linuxbsd.cpp @@ -41,6 +41,9 @@ int main(int argc, char *argv[]) { setlocale(LC_CTYPE, ""); + // We must override main when testing is enabled + TEST_MAIN_OVERRIDE + char *cwd = (char *)malloc(PATH_MAX); ERR_FAIL_COND_V(!cwd, ERR_OUT_OF_MEMORY); char *ret = getcwd(cwd, PATH_MAX); -- cgit v1.2.3