Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorEugene Tarassov2012-05-21 14:58:37 +0000
committerEugene Tarassov2012-05-21 14:59:29 +0000
commit75c2da9fb22aa03b004a851c9fab1e6d6c172ee9 (patch)
tree9989406d35433d033765c78f6d304ab480eec8eb /tests
parente281653d55ff1de3b93ad345e1708296e76e2dde (diff)
downloadorg.eclipse.tcf-75c2da9fb22aa03b004a851c9fab1e6d6c172ee9.tar.gz
org.eclipse.tcf-75c2da9fb22aa03b004a851c9fab1e6d6c172ee9.tar.xz
org.eclipse.tcf-75c2da9fb22aa03b004a851c9fab1e6d6c172ee9.zip
Bug 379189: tests: Add test to measure stepping performance
Diffstat (limited to 'tests')
-rw-r--r--tests/plugins/org.eclipse.tcf.debug.test/data/agent/win32/x86/agent.exebin1115136 -> 1115136 bytes
-rw-r--r--tests/plugins/org.eclipse.tcf.debug.test/src/org/eclipse/tcf/debug/test/SampleTest.java6
-rw-r--r--tests/plugins/org.eclipse.tcf.debug.test/src/org/eclipse/tcf/debug/test/SourceDisplayListener.java46
3 files changed, 35 insertions, 17 deletions
diff --git a/tests/plugins/org.eclipse.tcf.debug.test/data/agent/win32/x86/agent.exe b/tests/plugins/org.eclipse.tcf.debug.test/data/agent/win32/x86/agent.exe
index 38e83a620..ddc27683f 100644
--- a/tests/plugins/org.eclipse.tcf.debug.test/data/agent/win32/x86/agent.exe
+++ b/tests/plugins/org.eclipse.tcf.debug.test/data/agent/win32/x86/agent.exe
Binary files differ
diff --git a/tests/plugins/org.eclipse.tcf.debug.test/src/org/eclipse/tcf/debug/test/SampleTest.java b/tests/plugins/org.eclipse.tcf.debug.test/src/org/eclipse/tcf/debug/test/SampleTest.java
index 9969d28db..774bae212 100644
--- a/tests/plugins/org.eclipse.tcf.debug.test/src/org/eclipse/tcf/debug/test/SampleTest.java
+++ b/tests/plugins/org.eclipse.tcf.debug.test/src/org/eclipse/tcf/debug/test/SampleTest.java
@@ -20,6 +20,7 @@ import java.util.regex.Pattern;
import org.eclipse.debug.internal.ui.viewers.model.provisional.VirtualItem;
import org.eclipse.tcf.debug.test.services.IWaitForEventCache;
import org.eclipse.tcf.debug.test.services.RunControlCM;
+import org.eclipse.tcf.debug.test.services.RunControlCM.ContextState;
import org.eclipse.tcf.debug.test.util.ICache;
import org.eclipse.tcf.debug.test.util.RangeCache;
import org.eclipse.tcf.debug.test.util.Transaction;
@@ -29,6 +30,8 @@ import org.eclipse.tcf.services.IRunControl.RunControlContext;
import org.eclipse.tcf.services.IStackTrace.StackTraceContext;
import org.eclipse.tcf.services.ISymbols;
import org.eclipse.tcf.services.ISymbols.Symbol;
+import org.eclipse.test.performance.Performance;
+import org.eclipse.test.performance.PerformanceMeter;
import org.junit.Assert;
@SuppressWarnings("restriction")
@@ -103,7 +106,6 @@ public class SampleTest extends AbstractTcfUITest {
}
}
-/** DISABLED: Hangs on execution on szg-build
public void testSteppingPerformanceWithSourceDisplay() throws Exception {
initProcessModel("tcf_test_func0");
@@ -157,7 +159,7 @@ public class SampleTest extends AbstractTcfUITest {
}
}
-*/
+
private CodeArea calcPCCodeArea() throws ExecutionException, InterruptedException {
return new Transaction<CodeArea>() {
diff --git a/tests/plugins/org.eclipse.tcf.debug.test/src/org/eclipse/tcf/debug/test/SourceDisplayListener.java b/tests/plugins/org.eclipse.tcf.debug.test/src/org/eclipse/tcf/debug/test/SourceDisplayListener.java
index 62f0ea2a4..dca77dc4e 100644
--- a/tests/plugins/org.eclipse.tcf.debug.test/src/org/eclipse/tcf/debug/test/SourceDisplayListener.java
+++ b/tests/plugins/org.eclipse.tcf.debug.test/src/org/eclipse/tcf/debug/test/SourceDisplayListener.java
@@ -12,10 +12,13 @@ package org.eclipse.tcf.debug.test;
import java.util.Iterator;
+import org.eclipse.cdt.debug.internal.core.sourcelookup.CSourceNotFoundElement;
import org.eclipse.core.filesystem.URIUtil;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
+import org.eclipse.debug.ui.sourcelookup.CommonSourceNotFoundEditor;
+import org.eclipse.debug.ui.sourcelookup.CommonSourceNotFoundEditorInput;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IRegion;
@@ -25,6 +28,7 @@ import org.eclipse.jface.text.source.IAnnotationModel;
import org.eclipse.jface.text.source.IAnnotationModelListener;
import org.eclipse.tcf.services.ILineNumbers.CodeArea;
import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IFileEditorInput;
import org.eclipse.ui.IPartListener;
import org.eclipse.ui.IWorkbenchPage;
@@ -43,7 +47,7 @@ public class SourceDisplayListener implements IPartListener, IAnnotationModelLis
private static final String ANNOTATION_TOP_FRAME = "org.eclipse.tcf.debug.top_frame";
private IWorkbenchPage fPage;
- private ITextEditor fActiveEditor;
+ private IEditorPart fActiveEditor;
private IPath fExpectedFile;
private int fExpectedLine;
@@ -101,7 +105,7 @@ public class SourceDisplayListener implements IPartListener, IAnnotationModelLis
public synchronized boolean isFinished() {
if (isTimedOut()) {
- throw new RuntimeException("Timed Out: " + toString());
+ throw new RuntimeException("Timed Out: " + toString());
}
return fFileFound && fAnnotationFound;
@@ -117,8 +121,8 @@ public class SourceDisplayListener implements IPartListener, IAnnotationModelLis
fAnnotationModel.removeAnnotationModelListener(this);
}
- if (part instanceof ITextEditor) {
- fActiveEditor = ((ITextEditor)part);
+ if (part instanceof IEditorPart) {
+ fActiveEditor = ((IEditorPart)part);
checkFile();
}
}
@@ -145,6 +149,11 @@ public class SourceDisplayListener implements IPartListener, IAnnotationModelLis
location = file.getLocation();
} else if (input instanceof FileStoreEditorInput) {
location = URIUtil.toPath(((FileStoreEditorInput)input).getURI());
+ } else if (input instanceof CommonSourceNotFoundEditorInput) {
+ Object artifact = ((CommonSourceNotFoundEditorInput)input).getArtifact();
+ if (artifact instanceof CSourceNotFoundElement) {
+ location = new Path( ((CSourceNotFoundElement)artifact).getFile() );
+ }
}
if (location != null && fExpectedFile != null &&
@@ -152,11 +161,16 @@ public class SourceDisplayListener implements IPartListener, IAnnotationModelLis
{
fFileFound = true;
- IDocumentProvider docProvider = fActiveEditor.getDocumentProvider();
- fAnnotationModel = docProvider.getAnnotationModel(fActiveEditor.getEditorInput());
- fAnnotationModel.addAnnotationModelListener(this);
+ if (fActiveEditor instanceof ITextEditor) {
+ IDocumentProvider docProvider = ((ITextEditor)fActiveEditor).getDocumentProvider();
+ fAnnotationModel = docProvider.getAnnotationModel(fActiveEditor.getEditorInput());
+ fAnnotationModel.addAnnotationModelListener(this);
- checkAnnotations();
+ checkAnnotations();
+ } else if (fActiveEditor instanceof CommonSourceNotFoundEditor) {
+ // No annotation will be painted if source not found.
+ fAnnotationFound = true;
+ }
}
}
@@ -168,13 +182,15 @@ public class SourceDisplayListener implements IPartListener, IAnnotationModelLis
}
private Position calcExpectedPosition() {
- IDocument doc = fActiveEditor.getDocumentProvider().getDocument(fActiveEditor.getEditorInput());
- if (doc == null) return null;
- try {
- IRegion region = doc.getLineInformation(fExpectedLine - 1);
- return new Position(region.getOffset(), region.getLength());
- } catch (BadLocationException e) {
- }
+ if (fActiveEditor instanceof ITextEditor) {
+ IDocument doc = ((ITextEditor)fActiveEditor).getDocumentProvider().getDocument(fActiveEditor.getEditorInput());
+ if (doc == null) return null;
+ try {
+ IRegion region = doc.getLineInformation(fExpectedLine - 1);
+ return new Position(region.getOffset(), region.getLength());
+ } catch (BadLocationException e) {
+ }
+ }
return null;
}

Back to the top