1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-19 14:31:59 +00:00

Be explicit about usage of GDScript tests

Also drop empty "image" test, and print proper error when passing wrong
test name.

Fixes #25638.
This commit is contained in:
Rémi Verschelde
2019-02-10 14:54:16 +01:00
parent f614f15506
commit c363857426
5 changed files with 8 additions and 125 deletions

View File

@@ -911,11 +911,14 @@ MainLoop *test(TestType p_type) {
List<String> cmdlargs = OS::get_singleton()->get_cmdline_args();
if (cmdlargs.empty()) {
//try editor!
return NULL;
}
String test = cmdlargs.back()->get();
if (!test.ends_with(".gd") && !test.ends_with(".gdc")) {
print_line("This test expects a path to a GDScript file as its last parameter. Got: " + test);
return NULL;
}
FileAccess *fa = FileAccess::open(test, FileAccess::READ);