summaryrefslogtreecommitdiff
path: root/main/tests/test_gdscript.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-02-10 15:24:32 +0100
committerGitHub <noreply@github.com>2019-02-10 15:24:32 +0100
commit26a547f7fce022dd5565c95b90c79f412943c90f (patch)
tree12532cba87c1c1b1ff44c2452692bb85d108b364 /main/tests/test_gdscript.cpp
parentf614f155063e43733c5e4c2572b4ea67b3bcc661 (diff)
parentc3638574267b0af5ca086b923e1c1777d1dd131d (diff)
Merge pull request #25762 from akien-mga/tests-gdscript
Be explicit about usage of GDScript tests
Diffstat (limited to 'main/tests/test_gdscript.cpp')
-rw-r--r--main/tests/test_gdscript.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/main/tests/test_gdscript.cpp b/main/tests/test_gdscript.cpp
index 60f9568fbd..27ff2addf3 100644
--- a/main/tests/test_gdscript.cpp
+++ b/main/tests/test_gdscript.cpp
@@ -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);