diff options
author | George Marques <george@gmarqu.es> | 2023-04-26 11:12:47 -0300 |
---|---|---|
committer | RĂ©mi Verschelde <rverschelde@gmail.com> | 2023-04-27 08:41:36 +0200 |
commit | ee9a268fd77844d1cf36cf74adb3c008f701b011 (patch) | |
tree | 49ede80cc238b2cae40c19e7287718e1588d708f /modules/gdscript | |
parent | 1b7457237702aa754232b1d5b8a49f83a267f7eb (diff) |
GDScript: Use default path in test generator if not provided
Since it's almost always used with the same path, assume it is running
from the Godot source root.
(cherry picked from commit 221deb1cc130d176c499ebc67db83e7018eafd55)
Diffstat (limited to 'modules/gdscript')
-rw-r--r-- | modules/gdscript/tests/gdscript_test_runner.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/modules/gdscript/tests/gdscript_test_runner.cpp b/modules/gdscript/tests/gdscript_test_runner.cpp index 57405aa1ce..6299e5d584 100644 --- a/modules/gdscript/tests/gdscript_test_runner.cpp +++ b/modules/gdscript/tests/gdscript_test_runner.cpp @@ -350,13 +350,13 @@ void GDScriptTestRunner::handle_cmdline() { for (List<String>::Element *E = cmdline_args.front(); E; E = E->next()) { String &cmd = E->get(); if (cmd == "--gdscript-generate-tests") { - if (E->next() == nullptr) { - ERR_PRINT("Needed a path for the test files."); - exit(-1); + String path; + if (E->next()) { + path = E->next()->get(); + } else { + path = "modules/gdscript/tests/scripts"; } - const String &path = E->next()->get(); - GDScriptTestRunner runner(path, false, cmdline_args.find("--print-filenames") != nullptr); bool completed = runner.generate_outputs(); |