瀏覽代碼

Properly detect `--test` command-line argument

Do not prematurely parse anything which beings with `--test`
to run doctest. This allows other commands to be run, such as
`--test-gdscript` or other custom arguments.
Andrii Doroshenko (Xrayez) 5 年之前
父節點
當前提交
6a495f4d04
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      main/main.cpp

+ 1 - 1
main/main.cpp

@@ -372,7 +372,7 @@ void Main::print_help(const char *p_binary) {
 int Main::test_entrypoint(int argc, char *argv[], bool &tests_need_run) {
 #ifdef TESTS_ENABLED
 	for (int x = 0; x < argc; x++) {
-		if (strncmp(argv[x], "--test", 6) == 0) {
+		if ((strncmp(argv[x], "--test", 6) == 0) && (strlen(argv[x]) == 6)) {
 			tests_need_run = true;
 			OS::get_singleton()->initialize();
 			StringName::setup();