| 416 | } |
| 417 | |
| 418 | void GDScriptTestRunner::handle_cmdline() { |
| 419 | List<String> cmdline_args = OS::get_singleton()->get_cmdline_args(); |
| 420 | |
| 421 | for (List<String>::Element *E = cmdline_args.front(); E; E = E->next()) { |
| 422 | String &cmd = E->get(); |
| 423 | if (cmd == "--gdscript-generate-tests") { |
| 424 | String path; |
| 425 | if (E->next()) { |
| 426 | path = E->next()->get(); |
| 427 | } else { |
| 428 | path = "modules/gdscript/tests/scripts"; |
| 429 | } |
| 430 | |
| 431 | GDScriptTestRunner runner(path, false, cmdline_args.find("--print-filenames") != nullptr); |
| 432 | |
| 433 | bool completed = runner.generate_outputs(); |
| 434 | int failed = completed ? 0 : -1; |
| 435 | exit(failed); |
| 436 | } |
| 437 | } |
| 438 | } |
| 439 | |
| 440 | void GDScriptTest::enable_stdout() { |
| 441 | /// @todo This could likely be handled by doctest or `tests/test_macros.h`. |
nothing calls this directly
no test coverage detected