feat: updated engine
This commit is contained in:
parent
cbe99774ff
commit
f4cf6b3999
6607 changed files with 910135 additions and 430025 deletions
|
|
@ -39,18 +39,18 @@
|
|||
#include "core/config/project_settings.h"
|
||||
#include "core/core_globals.h"
|
||||
#include "core/io/dir_access.h"
|
||||
#include "core/io/file_access_pack.h"
|
||||
#include "core/io/file_access.h"
|
||||
#include "core/io/resource_loader.h"
|
||||
#include "core/io/resource_uid.h"
|
||||
#include "core/object/class_db.h"
|
||||
#include "core/os/os.h"
|
||||
#include "core/string/string_builder.h"
|
||||
#include "scene/resources/packed_scene.h"
|
||||
|
||||
#include "tests/test_macros.h"
|
||||
|
||||
namespace GDScriptTests {
|
||||
|
||||
void init_autoloads() {
|
||||
HashMap<StringName, ProjectSettings::AutoloadInfo> autoloads = ProjectSettings::get_singleton()->get_autoload_list();
|
||||
|
||||
// First pass, add the constants so they exist before any script is loaded.
|
||||
for (const KeyValue<StringName, ProjectSettings::AutoloadInfo> &E : ProjectSettings::get_singleton()->get_autoload_list()) {
|
||||
const ProjectSettings::AutoloadInfo &info = E.value;
|
||||
|
|
@ -573,9 +573,21 @@ GDScriptTest::TestResult GDScriptTest::execute_test_code(bool p_is_generating) {
|
|||
result.status = GDTEST_ANALYZER_ERROR;
|
||||
result.output = get_text_for_status(result.status) + "\n";
|
||||
|
||||
// Errors are stored in the order they were added, which may not match the source code.
|
||||
// Here we sort only by lines, preserving the original order for columns.
|
||||
// So, within a single line, the primary error is printed first, not cascading ones.
|
||||
struct SortErrors {
|
||||
_FORCE_INLINE_ bool operator()(const GDScriptParser::ParserError &p_a, const GDScriptParser::ParserError &p_b) const {
|
||||
return p_a.start_line < p_b.start_line;
|
||||
}
|
||||
};
|
||||
|
||||
List<GDScriptParser::ParserError> errors = List<GDScriptParser::ParserError>(parser.get_errors());
|
||||
errors.sort_custom<SortErrors>();
|
||||
|
||||
StringBuilder error_string;
|
||||
for (const GDScriptParser::ParserError &error : parser.get_errors()) {
|
||||
error_string.append(vformat(">> ERROR at line %d: %s\n", error.line, error.message));
|
||||
for (const GDScriptParser::ParserError &error : errors) {
|
||||
error_string.append(vformat(">> ERROR at line %d: %s\n", error.start_line, error.message));
|
||||
}
|
||||
result.output += error_string.as_string();
|
||||
if (!p_is_generating) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue