mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-09-28 17:11:11 -09:00
fixed test environment tool loading to work from jar files
This commit is contained in:
@@ -58,7 +58,6 @@ import ghidra.util.*;
|
|||||||
import ghidra.util.datastruct.WeakSet;
|
import ghidra.util.datastruct.WeakSet;
|
||||||
import ghidra.util.exception.*;
|
import ghidra.util.exception.*;
|
||||||
import ghidra.util.task.*;
|
import ghidra.util.task.*;
|
||||||
import resources.ResourceManager;
|
|
||||||
import utilities.util.FileUtilities;
|
import utilities.util.FileUtilities;
|
||||||
|
|
||||||
public class TestEnv {
|
public class TestEnv {
|
||||||
@@ -496,14 +495,14 @@ public class TestEnv {
|
|||||||
protected PluginTool launchDefaultToolByName(final String toolName) {
|
protected PluginTool launchDefaultToolByName(final String toolName) {
|
||||||
AtomicReference<PluginTool> ref = new AtomicReference<>();
|
AtomicReference<PluginTool> ref = new AtomicReference<>();
|
||||||
AbstractGenericTest.runSwing(() -> {
|
AbstractGenericTest.runSwing(() -> {
|
||||||
// first try the tools in the classpath
|
|
||||||
File toolFile = ResourceManager.getResourceFile("defaultTools/" + toolName + ".tool");
|
ToolTemplate toolTemplate =
|
||||||
if (!toolFile.exists()) {
|
ToolUtils.readToolTemplate("defaultTools/" + toolName + ".tool");
|
||||||
|
if (toolTemplate == null) {
|
||||||
|
Msg.debug(this, "Unable to find tool: " + toolName);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ToolTemplate toolTemplate = ToolUtils.readToolTemplate(toolFile);
|
|
||||||
|
|
||||||
boolean wasErrorGUIEnabled = AbstractDockingTest.isUseErrorGUI();
|
boolean wasErrorGUIEnabled = AbstractDockingTest.isUseErrorGUI();
|
||||||
AbstractDockingTest.setErrorGUIEnabled(false); // disable the error GUI while launching the tool
|
AbstractDockingTest.setErrorGUIEnabled(false); // disable the error GUI while launching the tool
|
||||||
FrontEndTool frontEndToolInstance = getFrontEndTool();
|
FrontEndTool frontEndToolInstance = getFrontEndTool();
|
||||||
@@ -1074,8 +1073,7 @@ public class TestEnv {
|
|||||||
// so that the tests may limp along if this is not a serious issue--throwing the
|
// so that the tests may limp along if this is not a serious issue--throwing the
|
||||||
// exception my prevent other cleanup from taking place.
|
// exception my prevent other cleanup from taking place.
|
||||||
Msg.error(TestEnv.class, "Unable to delete project: " + projectName +
|
Msg.error(TestEnv.class, "Unable to delete project: " + projectName +
|
||||||
" in directory: " + AbstractGTest.getTestDirectoryPath(),
|
" in directory: " + AbstractGTest.getTestDirectoryPath(), new RuntimeException());
|
||||||
new RuntimeException());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user