瀏覽代碼

GDScript: Fix error handler for tests

This changes the error message to be more clear on the output files and
also fixes an issue with the relative path of the offending file that
was not trimmed correctly.
George Marques 4 年之前
父節點
當前提交
ffdb3cccd2
共有 1 個文件被更改,包括 3 次插入4 次删除
  1. 3 4
      modules/gdscript/tests/gdscript_test_runner.cpp

+ 3 - 4
modules/gdscript/tests/gdscript_test_runner.cpp

@@ -257,6 +257,7 @@ bool GDScriptTestRunner::make_tests() {
 
 
 	ERR_FAIL_COND_V_MSG(err != OK, false, "Could not open specified test directory.");
 	ERR_FAIL_COND_V_MSG(err != OK, false, "Could not open specified test directory.");
 
 
+	source_dir = dir->get_current_dir() + "/"; // Make it absolute path.
 	return make_tests_for_dir(dir->get_current_dir());
 	return make_tests_for_dir(dir->get_current_dir());
 }
 }
 
 
@@ -361,11 +362,9 @@ void GDScriptTest::error_handler(void *p_this, const char *p_function, const cha
 			break;
 			break;
 	}
 	}
 
 
-	builder.append("\n>> ");
-	builder.append(p_function);
-	builder.append("\n>> ");
+	builder.append("\n>> on function: ");
 	builder.append(p_function);
 	builder.append(p_function);
-	builder.append("\n>> ");
+	builder.append("()\n>> ");
 	builder.append(String(p_file).trim_prefix(self->base_dir));
 	builder.append(String(p_file).trim_prefix(self->base_dir));
 	builder.append("\n>> ");
 	builder.append("\n>> ");
 	builder.append(itos(p_line));
 	builder.append(itos(p_line));