Merge remote-tracking branch 'origin/GP-2677_Dan_testFixes-2022-08-03-1'

This commit is contained in:
Ryan Kurtz 2023-08-03 09:52:30 -04:00
commit fd3c351297
5 changed files with 19 additions and 7 deletions

View File

@ -62,6 +62,11 @@ dependencies {
testImplementation project(path: ':FunctionGraph', configuration: 'testArtifacts')
testImplementation project(path: ':PDB', configuration: 'testArtifacts')
testImplementation project(path: ':GnuDemangler', configuration: 'testArtifacts')
testImplementation project(path: ':Framework-TraceModeling', configuration: 'testArtifacts')
testImplementation project(path: ':Framework-AsyncComm', configuration: 'testArtifacts')
testImplementation project(path: ':Framework-Debugging', configuration: 'testArtifacts')
testImplementation project(path: ':Debugger', configuration: 'testArtifacts')
}
// For Java 9, we must explicitly export references to the internal classes we are using.
@ -72,3 +77,8 @@ ext.addExports([
'java.desktop/sun.swing=ALL-UNNAMED',
'java.desktop/sun.java2d=ALL-UNNAMED'
])
integrationTest {
dependsOn { project(':Debugger-agent-gdb').installPyPackage }
dependsOn { project(':Debugger-agent-lldb').installPyPackage }
}

View File

@ -82,7 +82,7 @@ public abstract class AbstractGdbTraceRmiTest extends AbstractGhidraHeadedDebugg
private Path outFile;
private Path errFile;
@BeforeClass
// @BeforeClass
public static void setupPython() throws Throwable {
new ProcessBuilder("gradle", "Debugger-agent-gdb:installPyPackage")
.directory(TestApplicationUtils.getInstallationDirectory())

View File

@ -25,7 +25,6 @@ import java.util.List;
import org.junit.Ignore;
import org.junit.Test;
import agent.gdb.model.GdbLinuxSpecimen;
import ghidra.app.plugin.core.debug.utils.ManagedDomainObject;
import ghidra.dbg.target.TargetExecutionStateful.TargetExecutionState;
import ghidra.dbg.testutil.DummyProc;
@ -146,11 +145,12 @@ public class GdbHooksTest extends AbstractGdbTraceRmiTest {
@Test
public void testOnNewThread() throws Exception {
String cloneExit = DummyProc.which("expCloneExit");
try (GdbAndTrace conn = startAndSyncGdb()) {
conn.execute("""
file %s
break work
start""".formatted(GdbLinuxSpecimen.CLONE_EXIT.getCommandLine()));
start""".formatted(cloneExit));
waitForPass(() -> {
TraceObject inf = tb.obj("Inferiors[1]");
assertNotNull(inf);

View File

@ -86,7 +86,7 @@ public abstract class AbstractLldbTraceRmiTest extends AbstractGhidraHeadedDebug
private Path outFile;
private Path errFile;
@BeforeClass
// @BeforeClass
public static void setupPython() throws Throwable {
new ProcessBuilder("gradle", "Debugger-agent-lldb:installPyPackage")
.directory(TestApplicationUtils.getInstallationDirectory())

View File

@ -29,8 +29,8 @@ import java.util.Objects;
import org.junit.Ignore;
import org.junit.Test;
import agent.gdb.model.GdbLinuxSpecimen;
import ghidra.app.plugin.core.debug.utils.ManagedDomainObject;
import ghidra.dbg.testutil.DummyProc;
import ghidra.dbg.util.PathPattern;
import ghidra.dbg.util.PathPredicates;
import ghidra.program.model.address.AddressSpace;
@ -85,9 +85,10 @@ public class LldbHooksTest extends AbstractLldbTraceRmiTest {
// TODO: This passes if you single-step through it but fails on some transactional stuff if run
//@Test
public void testOnNewThread() throws Exception {
String cloneExit = DummyProc.which("expCloneExit");
try (LldbAndTrace conn = startAndSyncLldb()) {
start(conn, "%s".formatted(GdbLinuxSpecimen.CLONE_EXIT.getCommandLine()));
start(conn, "%s".formatted(cloneExit));
conn.execute("break set -n work");
waitForPass(() -> {
TraceObject proc = tb.objAny("Processes[]");
@ -112,10 +113,11 @@ public class LldbHooksTest extends AbstractLldbTraceRmiTest {
// TODO: This passes if you single-step through it but fails on some transactional stuff if run
//@Test
public void testOnThreadSelected() throws Exception {
String cloneExit = DummyProc.which("expCloneExit");
try (LldbAndTrace conn = startAndSyncLldb()) {
traceManager.openTrace(tb.trace);
start(conn, "%s".formatted(GdbLinuxSpecimen.CLONE_EXIT.getCommandLine()));
start(conn, "%s".formatted(cloneExit));
conn.execute("break set -n work");
waitForPass(() -> {