From ab7610ae79fd41691b7d69ff7abbac4adc72f99b Mon Sep 17 00:00:00 2001 From: Uwe Stieber Date: Mon, 2 Feb 2015 08:08:21 +0100 Subject: Target Explorer: Attempt to use agent from tcf-agent-x86Linux-master build job --- .../data/agent/linux/x86_64/agent | Bin 1849754 -> 0 bytes .../data/agent/win32/x86_64/agent.exe | Bin 1687040 -> 0 bytes .../data/helloWorld/win32/x86_64/helloWorld.exe | Bin 8192 -> 0 bytes .../plugins/org.eclipse.tcf.te.tests/pom.xml | 1 + .../src/org/eclipse/tcf/te/tests/tcf/TcfTestCase.java | 13 ++++++++++++- .../eclipse/tcf/te/tests/utils/UtilityTestCase.java | 9 ++++++++- 6 files changed, 21 insertions(+), 2 deletions(-) delete mode 100644 target_explorer/plugins/org.eclipse.tcf.te.tests/data/agent/linux/x86_64/agent delete mode 100644 target_explorer/plugins/org.eclipse.tcf.te.tests/data/agent/win32/x86_64/agent.exe delete mode 100644 target_explorer/plugins/org.eclipse.tcf.te.tests/data/helloWorld/win32/x86_64/helloWorld.exe (limited to 'target_explorer') diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tests/data/agent/linux/x86_64/agent b/target_explorer/plugins/org.eclipse.tcf.te.tests/data/agent/linux/x86_64/agent deleted file mode 100644 index 580ab90cd..000000000 Binary files a/target_explorer/plugins/org.eclipse.tcf.te.tests/data/agent/linux/x86_64/agent and /dev/null differ diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tests/data/agent/win32/x86_64/agent.exe b/target_explorer/plugins/org.eclipse.tcf.te.tests/data/agent/win32/x86_64/agent.exe deleted file mode 100644 index d7684cf4f..000000000 Binary files a/target_explorer/plugins/org.eclipse.tcf.te.tests/data/agent/win32/x86_64/agent.exe and /dev/null differ diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tests/data/helloWorld/win32/x86_64/helloWorld.exe b/target_explorer/plugins/org.eclipse.tcf.te.tests/data/helloWorld/win32/x86_64/helloWorld.exe deleted file mode 100644 index 607dba83e..000000000 Binary files a/target_explorer/plugins/org.eclipse.tcf.te.tests/data/helloWorld/win32/x86_64/helloWorld.exe and /dev/null differ diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tests/pom.xml b/target_explorer/plugins/org.eclipse.tcf.te.tests/pom.xml index 7f6a231f5..9c58b314f 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tests/pom.xml +++ b/target_explorer/plugins/org.eclipse.tcf.te.tests/pom.xml @@ -59,6 +59,7 @@ ${basedir}/tracing/.options + ${basedir}/.agent/agent org.eclipse.platform.ide ${tycho.testArgLine} ${ui.test.vmargs} diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/tcf/TcfTestCase.java b/target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/tcf/TcfTestCase.java index d0a394a5a..0c815e138 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/tcf/TcfTestCase.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/tcf/TcfTestCase.java @@ -19,6 +19,7 @@ import java.util.Map; import java.util.concurrent.atomic.AtomicReference; import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.Path; import org.eclipse.tcf.core.TransientPeer; import org.eclipse.tcf.protocol.IPeer; import org.eclipse.tcf.protocol.JSON; @@ -48,6 +49,8 @@ public class TcfTestCase extends CoreTestCase { protected IPeer peer; // The peer model instance protected IPeerNode peerNode; + // The test agent location + private IPath agentLocation; /* (non-Javadoc) * @see org.eclipse.tcf.te.tests.CoreTestCase#setUp() @@ -239,7 +242,15 @@ public class TcfTestCase extends CoreTestCase { * @return The agent location or null if not found. */ protected IPath getAgentLocation() { - return getDataLocation("agent", true, true); //$NON-NLS-1$ + if (agentLocation == null) { + String agentPath = System.getProperty("tcf.agent.path"); //$NON-NLS-1$ + if (agentPath != null && !"".equals(agentPath.trim())) { //$NON-NLS-1$ + agentLocation = new Path(agentPath); + } else { + agentLocation = getDataLocation("agent", true, true); //$NON-NLS-1$ + } + } + return agentLocation; } /** diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/utils/UtilityTestCase.java b/target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/utils/UtilityTestCase.java index df4dd89f4..597c7731f 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/utils/UtilityTestCase.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/utils/UtilityTestCase.java @@ -17,6 +17,7 @@ import junit.framework.TestSuite; import org.eclipse.cdt.utils.elf.Elf; import org.eclipse.cdt.utils.elf.Elf.ELFhdr; import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.Platform; import org.eclipse.tcf.te.core.cdt.elf.ElfUtils; import org.eclipse.tcf.te.runtime.utils.Host; @@ -52,7 +53,13 @@ public class UtilityTestCase extends CoreTestCase { if (!Host.isLinuxHost()) return; // Use the Linux agent to test the ELF utilities - IPath path = getDataLocation("agent", true, true); //$NON-NLS-1$ + IPath path = null; + String agentPath = System.getProperty("tcf.agent.path"); //$NON-NLS-1$ + if (agentPath != null && !"".equals(agentPath.trim())) { //$NON-NLS-1$ + path = new Path(agentPath); + } else { + path = getDataLocation("agent", true, true); //$NON-NLS-1$ + } assertNotNull("Unexpected null value from getDataLocation()", path); //$NON-NLS-1$ path = path.append("agent"); //$NON-NLS-1$ assertTrue("Test ELF file does not exist or is not readable", path.toFile().canRead()); //$NON-NLS-1$ -- cgit v1.2.3