summaryrefslogtreecommitdiff
path: root/modules/gdscript
diff options
context:
space:
mode:
authorGeorge Marques <george@gmarqu.es>2021-05-24 14:17:20 -0300
committerGeorge Marques <george@gmarqu.es>2021-05-24 14:17:20 -0300
commitffdb3cccd2a80417475826151d93529893809850 (patch)
tree2e5d46568e858f76db2e07b65bdcf15f8f2b492b /modules/gdscript
parentf2d55f3c0fabcd4ba4c14d56a6abd4627ebafc4a (diff)
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.
Diffstat (limited to 'modules/gdscript')
-rw-r--r--modules/gdscript/tests/gdscript_test_runner.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/modules/gdscript/tests/gdscript_test_runner.cpp b/modules/gdscript/tests/gdscript_test_runner.cpp
index 76ae43e792..e20e427597 100644
--- a/modules/gdscript/tests/gdscript_test_runner.cpp
+++ b/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.");
+ source_dir = dir->get_current_dir() + "/"; // Make it absolute path.
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;
}
- builder.append("\n>> ");
- builder.append(p_function);
- builder.append("\n>> ");
+ builder.append("\n>> on function: ");
builder.append(p_function);
- builder.append("\n>> ");
+ builder.append("()\n>> ");
builder.append(String(p_file).trim_prefix(self->base_dir));
builder.append("\n>> ");
builder.append(itos(p_line));