lifting-bits / patchestry

Patchestry is a binary patching framework built with MLIR and Ghidra.
https://lifting-bits.github.io/patchestry/
Apache License 2.0
12 stars 1 forks source link

Refactor headless ghidra testing infrastructure #39

Closed xlauko closed 1 week ago

xlauko commented 1 month ago

Refactor headless ghidra testing infrastructure:

### Tasks
- [x] Refactor headless ghidra tests:
- [x] Move `script/ghidra/test` to `test/ghidra`
- [x] Instead of custom bash script use lit as a runner. Let test use something like `RUN: %decompile-headless %s <function-name> %t | %file-check  %s --input-file <output-file>` This should allow to keep tests in single file, as names of decompiled functions are embedded in RUN invocation.
- [x] Fix `TMP_OUTPUT_PATH` to use directory created by lit, this allows to run test in parallel and not overwrite single file
- [x] Refactor test `CMakeLists.txt`, e.g., do not force `Debug` globally (tests can be run also in Release mode), do not use GLOBing, let lit discover tests
kumarak commented 1 month ago

I am going to remove ghidra.cpp from test directory. If we would like to have cpp files in unit test then we can introduce it at later point.