tests: Disable imhex checks in unit tests

This commit is contained in:
Nik
2022-09-14 14:29:12 +02:00
committed by GitHub
parent caea4544ef
commit 24c003b333
3 changed files with 9 additions and 2 deletions

View File

@@ -1,3 +1,7 @@
#ifndef __IMHEX__
#error This library is only available in the ImHex Hex editor
#ifndef __PL_UNIT_TESTS__
#ifndef __IMHEX__
#error This library is only available in the ImHex Hex editor
#endif
#endif

View File

@@ -46,6 +46,8 @@ int main(int argc, char **argv) {
runtime.addPragma("eval_depth", DummyPragmaHandler);
runtime.addPragma("array_limit", DummyPragmaHandler);
runtime.addPragma("pattern_limit", DummyPragmaHandler);
runtime.addDefine("__PL_UNIT_TESTS__");
}
// Execute pattern

View File

@@ -48,6 +48,7 @@ int main(int argc, char **argv) {
runtime.setDangerousFunctionCallHandler([]{ return true; });
runtime.setIncludePaths({ includePath });
runtime.addPragma("MIME", DummyPragmaHandler);
runtime.addDefine("__PL_UNIT_TESTS__");
}
// Execute pattern