Class TestApplicationUtils

java.lang.Object
ghidra.framework.TestApplicationUtils

public class TestApplicationUtils extends Object
  • Constructor Details

    • TestApplicationUtils

      public TestApplicationUtils()
  • Method Details

    • getInstallationDirectory

      public static File getInstallationDirectory()
      Returns the directory containing the installation of this application. The value returned here will either be an actual installation directory or the parent directory of a cloned repository. This method will work in the various modes of operation, including:
      • Development Mode - running from a repo clone, from inside of an IDE or the command-line. In this mode a sample directory structure is:
                        /.../git_repos/ghidra_clone/ghidra/Ghidra/Features/Base/src/...
         
                        which means this method will return 'ghidra_clone'
         
      • Batch Testing Mode - running from a test server, but not from inside a complete build. This mode uses jar files for the compiled source code, but is running from within the structure of a cloned repo. In this mode a sample directory structure is:
                        /.../git_repos/ghidra_clone/ghidra/Ghidra/Features/Base/src/...
         
                        which means this method will return 'ghidra_clone'
         
      • Eclipse Release Development Mode - running from a full application release. This mode uses jar files from the installation for dependencies. The user test files are run from within an Eclipse that has been linked with the application installation. In this mode a sample directory structure is:
                        /.../Software/ghidra_10.0/Ghidra/Features/Base/lib/Base.jar
         
                        which means this method will return 'ghidra_10.0'
         
      Returns:
      the installation directory
    • getUniqueTempDir

      public static File getUniqueTempDir()
      Creates a directory that is unique for the current installation. This allows clients to have multiple clones (for development mode) or multiple installations (for release mode) on their machine, running tests from each repo simultaneously.
      Returns:
      an absolute form directory that is unique for the current installation