Package ghidra
Class GhidraTestApplicationLayout
java.lang.Object
utility.application.ApplicationLayout
ghidra.GhidraApplicationLayout
ghidra.GhidraTestApplicationLayout
The Ghidra test application layout defines the customizable elements of the Ghidra
application's directory structure when running a test.
This layout exists because tests often need to provide their own user settings directory, rather than using Ghidra's default.
-
Field Summary
Fields inherited from class utility.application.ApplicationLayout
applicationInstallationDir, applicationProperties, applicationRootDirs, extensionArchiveDir, extensionInstallationDirs, modules, patchDir, userCacheDir, userSettingsDir, userTempDir
-
Constructor Summary
ConstructorDescriptionGhidraTestApplicationLayout
(File userSettingsDir) Constructs a new Ghidra application layout object with the provided user settings directory. -
Method Summary
Modifier and TypeMethodDescriptionprotected ResourceFile
Returns the directory where all Ghidra extension archives are stored.protected List
<ResourceFile> Returns a prioritized list of directories where Ghidra extensions are installed.Finds the modules for this Ghidra application layout.protected ResourceFile
Returns the directory that allows users to add jar and class files to override existing distribution filesReturns patterns that will be used to check against each discovered module.Methods inherited from class ghidra.GhidraApplicationLayout
findGhidraApplicationInstallationDir, findGhidraApplicationRootDirs
Methods inherited from class utility.application.ApplicationLayout
getApplicationInstallationDir, getApplicationProperties, getApplicationRootDirs, getExtensionArchiveDir, getExtensionInstallationDirs, getModules, getPatchDir, getUserCacheDir, getUserSettingsDir, getUserTempDir, inSingleJarMode
-
Constructor Details
-
GhidraTestApplicationLayout
Constructs a new Ghidra application layout object with the provided user settings directory.This layout is useful when running Ghidra tests.
- Parameters:
userSettingsDir
- The custom user settings directory to use.- Throws:
FileNotFoundException
- if there was a problem getting a user directory.IOException
- if there was a problem getting the application properties.
-
-
Method Details
-
findExtensionArchiveDirectory
Description copied from class:GhidraApplicationLayout
Returns the directory where all Ghidra extension archives are stored. This should be at the following location:
{install dir}/Extensions/Ghidra
- Overrides:
findExtensionArchiveDirectory
in classGhidraApplicationLayout
- Returns:
- the archive folder, or null if can't be determined
-
findExtensionInstallationDirectories
Description copied from class:GhidraApplicationLayout
Returns a prioritized list of directories where Ghidra extensions are installed. These should be at the following locations:
[user settings dir]/Extensions
[application install dir]/Ghidra/Extensions
(Release Mode)ghidra/Ghidra/Extensions
(Development Mode)
- Overrides:
findExtensionInstallationDirectories
in classGhidraApplicationLayout
- Returns:
- the install folder, or null if can't be determined
-
findPatchDirectory
Description copied from class:GhidraApplicationLayout
Returns the directory that allows users to add jar and class files to override existing distribution files- Overrides:
findPatchDirectory
in classGhidraApplicationLayout
- Returns:
- the patch dir; null if not in a distribution
-
findGhidraModules
Description copied from class:GhidraApplicationLayout
Finds the modules for this Ghidra application layout.- Overrides:
findGhidraModules
in classGhidraApplicationLayout
- Returns:
- The modules for this Ghidra application layout.
- Throws:
IOException
- if there was a problem finding the modules on disk.
-
getDependentModulePatterns
Returns patterns that will be used to check against each discovered module. Matching module paths will be included as modules to be used during testing. By default, only modules that match the classpath entries are included. If your tests needs modules not referenced by the classpath, then you can override this method and add any module patterns needed.The pattern is any desired text that will be matched against. If you wish to use path separators, be sure to do so in a platform-dependent manner.
- Returns:
- the patterns
-