mirror of
https://github.com/WerWolv/ImHex-Patterns.git
synced 2026-03-28 07:47:02 -05:00
tests: Fixed build with new pattern language changes
This commit is contained in:
@@ -52,16 +52,8 @@ int main(int argc, char **argv) {
|
||||
runtime.setIncludePaths({ includePath });
|
||||
runtime.addPragma("MIME", DummyPragmaHandler);
|
||||
runtime.addDefine("__PL_UNIT_TESTS__");
|
||||
}
|
||||
|
||||
// Execute pattern
|
||||
if (!runtime.executeString(patternFile.readString())) {
|
||||
fmt::print("Error during execution!\n");
|
||||
|
||||
if (const auto &hardError = runtime.getError(); hardError.has_value())
|
||||
fmt::print("Hard error: {}:{} - {}\n\n", hardError->line, hardError->column, hardError->message);
|
||||
|
||||
for (const auto &[level, message] : runtime.getConsoleLog()) {
|
||||
|
||||
runtime.setLogCallback([](auto level, const std::string &message) {
|
||||
switch (level) {
|
||||
using enum pl::core::LogConsole::Level;
|
||||
case Debug: fmt::print(" [DEBUG] "); break;
|
||||
@@ -71,7 +63,16 @@ int main(int argc, char **argv) {
|
||||
}
|
||||
|
||||
fmt::print("{}\n", message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// Execute pattern
|
||||
if (!runtime.executeString(patternFile.readString())) {
|
||||
fmt::print("Error during execution!\n");
|
||||
|
||||
if (const auto &hardError = runtime.getError(); hardError.has_value())
|
||||
fmt::print("Hard error: {}:{} - {}\n\n", hardError->line, hardError->column, hardError->message);
|
||||
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user