Replies: 1 comment
-
|
We can possibly add some code to our test application to make this easier. For now I will describe how you can make this work in your environment using the concept we refer to as a shadow repo. We take advantage of this in dev mode. Our repo has various modules that we discover at load time. If you have defined any peer repos, we will search for any same-named module in all of the sibling repos. In this example, our 'ghidra' repo has the path: The notes below are based upon our setup, with our repo, which I refer to as 'ghidra'. I'm not sure exactly how you have your repo setup, so the steps my need to be changed a bit. Create a Shadow RepoCreate a repo for test files that contains all of your test data. This new test repo can be shared by your various dev repos by checking it out as a sibling repo anywhere you have your dev repo. This repo should contain the same path as above, with a data folder: These can then be accessed in your test like this: and Use the Shadow RepoCheckout the test repo as a sibling to your repo, for example: (In this example 'ghidra' is our repo and 'test.repo.name' is the test data repo). To have ghidra use this repo, you need to create a file that lives in the ghidra repo named This is the folder name of the repo root folder that is the sibling to our 'ghidra' repo. When you run your tests, they should then pick up the shadow module in the test repo. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm developing extensions in stand-alone repositories. Testing via subclasses of
AbstractGhidraHeadedIntegrationTestgenerally works, but one problem I'm currently struggling with is elegantly loading.gzfFiles that are stored somewhere in the repository to get aPrograminstance.In theory there is a nice API for this:
In practice
TestEnv#getProgramseems to rely on the existence of aTestResourcesmodule in the application root, which doesn't exist when running a Ghidra release with an extension loaded.GhidraApplicationLayout#findGhidraModulesallows adding external modules via aghidra.external.modulesproperty, butGhidraTestApplicationLayout#findGhidraModulesdoes not.Is there some way to have a dedicated folder for GZF files in my extension, that I can easily load from, but that is also not shipped as part of the plugin when building the extension?
Beta Was this translation helpful? Give feedback.
All reactions