tests: Fix test failures after library update

This commit is contained in:
Nik
2025-12-23 23:26:20 +01:00
committed by GitHub
parent 4646e4b965
commit 57c3dd44b8
2 changed files with 7 additions and 5 deletions

View File

@@ -98,12 +98,13 @@ int main(int argc, char **argv) {
if (missingComments)
return EXIT_FAILURE;
if (!runtime.executeString(patternFile.readString(), "<Source Code>")) {
auto exitCode = runtime.executeString(patternFile.readString(), "<Source Code>");
if (exitCode != 0) {
if (const auto &evalError = runtime.getEvalError(); evalError.has_value()) {
fmt::println("{}:{} {}", evalError->line, evalError->column, evalError->message);
}
return EXIT_FAILURE;
return exitCode;
}
if (!runtime.getPatterns().empty()) {

View File

@@ -95,8 +95,9 @@ int main(int argc, char **argv) {
// Execute pattern
fmt::println("Executing pattern {} using test file {}", patternName, wolv::util::toUTF8String(testFilePath.filename()));
if (!runtime.executeString(patternFile.readString(), "<Source Code>")) {
fmt::println("Error when executing pattern!");
auto exitCode = runtime.executeString(patternFile.readString(), "<Source Code>");
if (exitCode != 0) {
fmt::println("Non-zero exit code returned from execution. (Exit Code: {})!", exitCode);
if (const auto &compileErrors = runtime.getCompileErrors(); !compileErrors.empty()) {
for (const auto &error : compileErrors) {
@@ -106,7 +107,7 @@ int main(int argc, char **argv) {
fmt::println("{}:{} {}", evalError->line, evalError->column, evalError->message);
}
return EXIT_FAILURE;
return exitCode;
}
for (const auto &pattern : runtime.getPatterns()) {