Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add unit tests for export templates #44398

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -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"])

Expand Down
7 changes: 4 additions & 3 deletions modules/gdscript/tests/test_gdscript.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
RevoluPowered marked this conversation as resolved.
Show resolved Hide resolved
#endif
print_line("");
print_line("");
}
Expand Down
3 changes: 3 additions & 0 deletions tests/test_text_server.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -247,3 +249,4 @@ TEST_SUITE("[[TextServer]") {
}; // namespace TestTextServer

#endif // TEST_TEXT_SERVER_H
#endif // TOOLS_ENABLED