Merge pull request #52643 from ThreeRhinosInAnElephantCostume/fixgdscript

Fix an undefined behaviour causing random test failures
This commit is contained in:
Max Hilbrunner 2021-09-13 23:29:38 +02:00 committed by GitHub
commit 7cdd8629ad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -415,6 +415,7 @@ GDScriptTest::TestResult GDScriptTest::execute_test_code(bool p_is_generating) {
TestResult result;
result.status = GDTEST_OK;
result.output = String();
result.passed = false;
Error err = OK;
@ -498,6 +499,8 @@ GDScriptTest::TestResult GDScriptTest::execute_test_code(bool p_is_generating) {
}
// Script files matching this pattern are allowed to not contain a test() function.
if (source_file.match("*.notest.gd")) {
enable_stdout();
result.passed = check_output(result.output);
return result;
}
// Test running.