diff --git a/tests/includes/source/main.cpp b/tests/includes/source/main.cpp index 1e73209..bfe6ee8 100644 --- a/tests/includes/source/main.cpp +++ b/tests/includes/source/main.cpp @@ -98,12 +98,13 @@ int main(int argc, char **argv) { if (missingComments) return EXIT_FAILURE; - if (!runtime.executeString(patternFile.readString(), "")) { + auto exitCode = runtime.executeString(patternFile.readString(), ""); + 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()) { diff --git a/tests/patterns/source/main.cpp b/tests/patterns/source/main.cpp index 0d6abeb..7bc5a6f 100644 --- a/tests/patterns/source/main.cpp +++ b/tests/patterns/source/main.cpp @@ -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(), "")) { - fmt::println("Error when executing pattern!"); + auto exitCode = runtime.executeString(patternFile.readString(), ""); + 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()) {