diff options
author | Gordon MacPherson <gordon@gordonite.tech> | 2020-12-15 16:10:56 +0000 |
---|---|---|
committer | Gordon MacPherson <gordon@gordonite.tech> | 2021-03-22 18:57:08 +0000 |
commit | 6b4ff3b44b45ea2a78aa44adc50046e0750a2ae3 (patch) | |
tree | 2e20766a4ce849aa820013f165490f084ea527c3 | |
parent | 950dedbb6858458b5944523bf806e35eb4d6a5d8 (diff) |
Add unit tests for export templates
-rw-r--r-- | SConstruct | 4 | ||||
-rw-r--r-- | modules/gdscript/tests/test_gdscript.cpp | 7 | ||||
-rw-r--r-- | tests/test_text_server.h | 3 |
3 files changed, 7 insertions, 7 deletions
diff --git a/SConstruct b/SConstruct index 2281b8a77f..affb95b026 100644 --- a/SConstruct +++ b/SConstruct @@ -288,10 +288,6 @@ if env_base["target"] == "debug": # http://scons.org/doc/production/HTML/scons-user/ch06s04.html env_base.SetOption("implicit_cache", 1) -if not env_base["tools"]: - # Export templates can't run unit test tool. - env_base["tests"] = False - if env_base["no_editor_splash"]: env_base.Append(CPPDEFINES=["NO_EDITOR_SPLASH"]) diff --git a/modules/gdscript/tests/test_gdscript.cpp b/modules/gdscript/tests/test_gdscript.cpp index 898ac653f5..3cc0eee672 100644 --- a/modules/gdscript/tests/test_gdscript.cpp +++ b/modules/gdscript/tests/test_gdscript.cpp @@ -118,10 +118,10 @@ static void test_parser(const String &p_code, const String &p_script_path, const print_line(vformat("%02d:%02d: %s", error.line, error.column, error.message)); } } - +#ifdef TOOLS_ENABLED GDScriptParser::TreePrinter printer; - printer.print_tree(parser); +#endif } static void test_compiler(const String &p_code, const String &p_script_path, const Vector<String> &p_lines) { @@ -175,8 +175,9 @@ static void test_compiler(const String &p_code, const String &p_script_path, con signature += func->get_argument_name(i); } print_line(signature + ")"); - +#ifdef TOOLS_ENABLED func->disassemble(p_lines); +#endif print_line(""); print_line(""); } diff --git a/tests/test_text_server.h b/tests/test_text_server.h index d981ebd5fd..feb6942fb6 100644 --- a/tests/test_text_server.h +++ b/tests/test_text_server.h @@ -28,6 +28,8 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ +#ifdef TOOLS_ENABLED + #ifndef TEST_TEXT_SERVER_H #define TEST_TEXT_SERVER_H @@ -247,3 +249,4 @@ TEST_SUITE("[[TextServer]") { }; // namespace TestTextServer #endif // TEST_TEXT_SERVER_H +#endif // TOOLS_ENABLED |