Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Tarassov2012-04-12 19:39:10 +0000
committerEugene Tarassov2012-04-12 19:40:28 +0000
commit44d9a02ce04e830978e5f88be58f943efe5f6162 (patch)
tree1484d4e6de7c87e7f7baf6cef687b6abc0b07265 /plugins
parent74480f079f0ef060cd03abcc8b4196b458815fd3 (diff)
downloadorg.eclipse.tcf-44d9a02ce04e830978e5f88be58f943efe5f6162.tar.gz
org.eclipse.tcf-44d9a02ce04e830978e5f88be58f943efe5f6162.tar.xz
org.eclipse.tcf-44d9a02ce04e830978e5f88be58f943efe5f6162.zip
TCF Tests: better (simpler) run control code
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/tests/RunControl.java20
-rw-r--r--plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/tests/TestExpressions.java9
2 files changed, 5 insertions, 24 deletions
diff --git a/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/tests/RunControl.java b/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/tests/RunControl.java
index b33098760..0bf37934b 100644
--- a/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/tests/RunControl.java
+++ b/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/tests/RunControl.java
@@ -66,11 +66,6 @@ class RunControl {
public void contextSuspended(final String id, String pc, String reason, Map<String,Object> params) {
if (enable_trace) System.out.println("" + channel_id + " suspended " + id);
suspended_ctx_ids.add(id);
- Protocol.invokeLater(new Runnable() {
- public void run() {
- resume(id, IRunControl.RM_RESUME);
- }
- });
}
public void contextResumed(String id) {
@@ -90,7 +85,6 @@ class RunControl {
}
for (String id : suspended_ids) {
suspended_ctx_ids.add(id);
- resume(id, IRunControl.RM_RESUME);
}
}
@@ -155,31 +149,19 @@ class RunControl {
}
else {
if (suspended) suspended_ctx_ids.add(id);
- getStateDone();
}
}
}));
}
- getStateDone();
}
}
}));
}
- getStateDone();
}
}
}));
}
- private void getStateDone() {
- if (get_state_cmds.size() > 0) return;
- if (channel.getState() != IChannel.STATE_OPEN) return;
- if (suspended_ctx_ids.size() > 0) {
- String[] arr = suspended_ctx_ids.toArray(new String[suspended_ctx_ids.size()]);
- resume(arr[rnd.nextInt(arr.length)], IRunControl.RM_RESUME);
- }
- }
-
private void startTimer() {
Protocol.invokeLater(50, new Runnable() {
public void run() {
@@ -312,7 +294,7 @@ class RunControl {
test_id.equals(ctx.getCreatorID())) {
String thread_id = ctx.getID();
test_suite.getCanceledTests().put(thread_id, test_id);
- resume(thread_id, 0);
+ resume(thread_id, IRunControl.RM_RESUME);
}
}
}
diff --git a/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/tests/TestExpressions.java b/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/tests/TestExpressions.java
index 9155a6936..0c14241b3 100644
--- a/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/tests/TestExpressions.java
+++ b/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/tests/TestExpressions.java
@@ -67,6 +67,7 @@ class TestExpressions implements ITCFTest,
private final Map<String,ISymbols.Symbol> expr_sym = new HashMap<String,ISymbols.Symbol>();
private final Map<String,String[]> expr_chld = new HashMap<String,String[]>();
private final Set<String> expr_to_dispose = new HashSet<String>();
+ private int timer = 0;
private static String[] global_var_names = {
"tcf_test_char",
@@ -159,14 +160,13 @@ class TestExpressions implements ITCFTest,
test_id = list[rnd.nextInt(list.length)];
runTest();
Protocol.invokeLater(100, new Runnable() {
- int cnt = 0;
public void run() {
if (!test_suite.isActive(TestExpressions.this)) return;
- cnt++;
+ timer++;
if (test_suite.cancel) {
exit(null);
}
- else if (cnt < 600) {
+ else if (timer < 600) {
if (test_done && !cancel_test_sent) {
test_rc.cancel(test_ctx_id);
cancel_test_sent = true;
@@ -211,6 +211,7 @@ class TestExpressions implements ITCFTest,
@SuppressWarnings("unchecked")
private void runTest() {
+ timer = 0;
if (bp_id == null) {
bp.set(null, new IBreakpoints.DoneCommand() {
public void doneCommand(IToken token, Exception error) {
@@ -363,7 +364,6 @@ class TestExpressions implements ITCFTest,
BigInteger pc1 = new BigInteger(suspended_pc);
if (!pc0.equals(pc1)) {
waiting_suspend = true;
- test_rc.resume(thread_id, IRunControl.RM_RESUME);
return;
}
run_to_bp_done = true;
@@ -590,7 +590,6 @@ class TestExpressions implements ITCFTest,
return;
}
test_done = true;
- test_rc.resume(thread_id, IRunControl.RM_RESUME);
}
private void exit(Throwable x) {

Back to the top