Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoreutarass2011-02-22 19:48:56 +0000
committereutarass2011-02-22 19:48:56 +0000
commit749b94bcae2faf05372db7614d0c1147b63ed75e (patch)
tree9079498f23f7bc80dfd3af1c1352e353de1eaf6b
parent8c18fad47dc127122d7b38855f44e6ad152cdd65 (diff)
downloadorg.eclipse.tcf-749b94bcae2faf05372db7614d0c1147b63ed75e.tar.gz
org.eclipse.tcf-749b94bcae2faf05372db7614d0c1147b63ed75e.tar.xz
org.eclipse.tcf-749b94bcae2faf05372db7614d0c1147b63ed75e.zip
TCF Tests: added initialization of file path mapping in run control test
-rw-r--r--plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/tests/TCFTestSuite.java4
-rw-r--r--plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/tests/TestRCBP1.java32
2 files changed, 33 insertions, 3 deletions
diff --git a/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/tests/TCFTestSuite.java b/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/tests/TCFTestSuite.java
index 57b01a988..70b85419f 100644
--- a/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/tests/TCFTestSuite.java
+++ b/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/tests/TCFTestSuite.java
@@ -130,7 +130,7 @@ public class TCFTestSuite {
int i = 0;
listener.progress("Running Run Control Test...", ++count_done, count_total);
for (IChannel channel : channels) {
- active_tests.put(new TestRCBP1(TCFTestSuite.this, channel, i++), channel);
+ active_tests.put(new TestRCBP1(TCFTestSuite.this, channel, i++, path_map), channel);
}
}
});
@@ -151,7 +151,7 @@ public class TCFTestSuite {
switch (i % 4) {
case 0: test = new TestEcho(TCFTestSuite.this, channels[i]); break;
case 1: test = new TestAttachTerminate(TCFTestSuite.this, channels[i]); break;
- case 2: test = new TestRCBP1(TCFTestSuite.this, channels[i], i); break;
+ case 2: test = new TestRCBP1(TCFTestSuite.this, channels[i], i, path_map); break;
case 3: test = new TestFileSystem(TCFTestSuite.this, channels[i], i); break;
}
active_tests.put(test, channels[i]);
diff --git a/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/tests/TestRCBP1.java b/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/tests/TestRCBP1.java
index b783c0f7b..76c3f0518 100644
--- a/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/tests/TestRCBP1.java
+++ b/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/tests/TestRCBP1.java
@@ -29,6 +29,7 @@ import org.eclipse.tm.tcf.services.IDiagnostics;
import org.eclipse.tm.tcf.services.IDisassembly;
import org.eclipse.tm.tcf.services.ILineNumbers;
import org.eclipse.tm.tcf.services.IMemory;
+import org.eclipse.tm.tcf.services.IPathMap;
import org.eclipse.tm.tcf.services.IRegisters;
import org.eclipse.tm.tcf.services.IRunControl;
import org.eclipse.tm.tcf.services.ISymbols;
@@ -37,6 +38,7 @@ import org.eclipse.tm.tcf.services.IDisassembly.IDisassemblyLine;
import org.eclipse.tm.tcf.services.ILineNumbers.CodeArea;
import org.eclipse.tm.tcf.services.IMemory.MemoryContext;
import org.eclipse.tm.tcf.services.IMemory.MemoryError;
+import org.eclipse.tm.tcf.services.IPathMap.PathMapRule;
import org.eclipse.tm.tcf.services.IRegisters.RegistersContext;
import org.eclipse.tm.tcf.services.IRunControl.RunControlContext;
import org.eclipse.tm.tcf.services.ISymbols.Symbol;
@@ -45,6 +47,7 @@ class TestRCBP1 implements ITCFTest, IRunControl.RunControlListener {
private final TCFTestSuite test_suite;
private final int channel_id;
+ private final List<PathMapRule> path_map;
private final IDiagnostics diag;
private final ISymbols syms;
private final IMemory mm;
@@ -53,6 +56,7 @@ class TestRCBP1 implements ITCFTest, IRunControl.RunControlListener {
private final IBreakpoints bp;
private final ILineNumbers ln;
private final IDisassembly ds;
+ private final IPathMap pm;
private final Map<String,IRunControl.RunControlContext> threads = new HashMap<String,IRunControl.RunControlContext>();
private final Map<String,SuspendedContext> suspended = new HashMap<String,SuspendedContext>();
private final Map<String,SuspendedContext> suspended_prev = new HashMap<String,SuspendedContext>();
@@ -69,6 +73,7 @@ class TestRCBP1 implements ITCFTest, IRunControl.RunControlListener {
private String[] test_list;
private boolean rcbp1_found;
+ private boolean path_map_done;
private String test_ctx_id; // Test context ID
private IRunControl.RunControlContext test_context;
private String main_thread_id;
@@ -163,9 +168,10 @@ class TestRCBP1 implements ITCFTest, IRunControl.RunControlListener {
}
};
- TestRCBP1(TCFTestSuite test_suite, IChannel channel, int channel_id) {
+ TestRCBP1(TCFTestSuite test_suite, IChannel channel, int channel_id, List<PathMapRule> path_map) {
this.test_suite = test_suite;
this.channel_id = channel_id;
+ this.path_map = path_map;
diag = channel.getRemoteService(IDiagnostics.class);
syms = channel.getRemoteService(ISymbols.class);
mm = channel.getRemoteService(IMemory.class);
@@ -174,6 +180,7 @@ class TestRCBP1 implements ITCFTest, IRunControl.RunControlListener {
bp = channel.getRemoteService(IBreakpoints.class);
ln = channel.getRemoteService(ILineNumbers.class);
ds = channel.getRemoteService(IDisassembly.class);
+ pm = channel.getRemoteService(IPathMap.class);
}
public void start() {
@@ -192,6 +199,10 @@ class TestRCBP1 implements ITCFTest, IRunControl.RunControlListener {
getTestList();
return;
}
+ if (!path_map_done) {
+ setPathMap();
+ return;
+ }
if (!bp_reset_done) {
resetBreakpoints();
return;
@@ -279,6 +290,25 @@ class TestRCBP1 implements ITCFTest, IRunControl.RunControlListener {
});
}
+ private void setPathMap() {
+ if (pm == null || path_map == null) {
+ path_map_done = true;
+ runTest();
+ return;
+ }
+ pm.set(path_map.toArray(new PathMapRule[path_map.size()]), new IPathMap.DoneSet() {
+ public void doneSet(IToken token, Exception error) {
+ if (error != null) {
+ exit(error);
+ }
+ else {
+ path_map_done = true;
+ runTest();
+ }
+ }
+ });
+ }
+
private void resetBreakpoints() {
if (bp == null) {
bp_reset_done = true;

Back to the top