mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-09-25 17:00:36 -09:00
Merge remote-tracking branch 'origin/GP-0-dragonmacher-test-cleanup-update'
This commit is contained in:
@@ -21,6 +21,8 @@ import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
|
||||
import org.junit.BeforeClass;
|
||||
|
||||
import docking.test.AbstractDockingTest;
|
||||
import ghidra.GhidraTestApplicationLayout;
|
||||
import ghidra.app.events.ProgramLocationPluginEvent;
|
||||
@@ -96,6 +98,15 @@ public abstract class AbstractGhidraHeadlessIntegrationTest extends AbstractDock
|
||||
System.setProperty(GhidraScriptConstants.USER_SCRIPTS_DIR_PROPERTY, getTestDirectoryPath());
|
||||
}
|
||||
|
||||
@BeforeClass
|
||||
public static void cleanDbTestDir() {
|
||||
// keep files around in batch mode to allow tests to run faster; assume batch mode performs
|
||||
// its own cleanup; only run once per class to allow subsequent tests to be faster
|
||||
if (!BATCH_MODE) {
|
||||
TestProgramManager.cleanDbTestDir();
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean deleteProject(String directory, String name) {
|
||||
return ProjectTestUtils.deleteProject(directory, name);
|
||||
}
|
||||
|
||||
@@ -431,6 +431,12 @@ public class TestProgramManager {
|
||||
return dbTestDir;
|
||||
}
|
||||
|
||||
public static void cleanDbTestDir() {
|
||||
File dir = getDbTestDir();
|
||||
Msg.debug(TestProgramManager.class, "Deleting test db cache dir: " + dir);
|
||||
FileUtilities.deleteDir(dir);
|
||||
}
|
||||
|
||||
private static File getTestDBDirectory() {
|
||||
String testDirPath = AbstractGTest.getTestDirectoryPath();
|
||||
File dir = new File(testDirPath, DB_DIR_NAME);
|
||||
|
||||
Reference in New Issue
Block a user