mirror of
https://github.com/WerWolv/ImHex-Patterns.git
synced 2026-03-27 23:37:04 -05:00
tests: Fix test failures after library update
This commit is contained in:
@@ -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()) {
|
||||
|
||||
@@ -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()) {
|
||||
|
||||
Reference in New Issue
Block a user