Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorElliott Baron2009-04-03 20:46:54 +0000
committerElliott Baron2009-04-03 20:46:54 +0000
commitd89c8a82b498e3c479a176709d15528da7335b71 (patch)
treeb24b238bbbbcfc5dde5dddfb12f1ce6cf1cd4b3a /valgrind/org.eclipse.linuxtools.valgrind.tests
parent5cdda8162a2551053606c4a92103b9c0cdcd28a1 (diff)
downloadorg.eclipse.linuxtools-d89c8a82b498e3c479a176709d15528da7335b71.tar.gz
org.eclipse.linuxtools-d89c8a82b498e3c479a176709d15528da7335b71.tar.xz
org.eclipse.linuxtools-d89c8a82b498e3c479a176709d15528da7335b71.zip
Added opening an editor from detailed snapshots in Massif plugin's chart. Working around race condition in platform, and revised test project building to use a job scheduled with buildRule. Updated version numbers to 0.2.0.
Diffstat (limited to 'valgrind/org.eclipse.linuxtools.valgrind.tests')
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.tests/ChangeLog12
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.tests/META-INF/MANIFEST.MF2
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.tests/src/org/eclipse/linuxtools/valgrind/tests/AbstractValgrindTest.java1
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.tests/src/org/eclipse/linuxtools/valgrind/tests/ValgrindStubCommand.java6
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.tests/src/org/eclipse/linuxtools/valgrind/tests/ValgrindStubProcess.java82
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.tests/src/org/eclipse/linuxtools/valgrind/tests/ValgrindStubStreamsProxy.java21
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.tests/src/org/eclipse/linuxtools/valgrind/tests/ValgrindTestLaunchDelegate.java29
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.tests/src/org/eclipse/linuxtools/valgrind/tests/ValgrindTestLaunchPlugin.java2
8 files changed, 103 insertions, 52 deletions
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.tests/ChangeLog b/valgrind/org.eclipse.linuxtools.valgrind.tests/ChangeLog
index ff2252333b..b9845fe4e0 100644
--- a/valgrind/org.eclipse.linuxtools.valgrind.tests/ChangeLog
+++ b/valgrind/org.eclipse.linuxtools.valgrind.tests/ChangeLog
@@ -1,3 +1,15 @@
+2009-04-03 Elliott Baron <ebaron@redhat.com>
+
+ * ValgrindStubStreamsProxy.java: New file.
+ * META-INF/MANIFEST.MF: 0.2.0 version.
+ * ValgrindStubCommand.java (getProcess): Return null.
+ * ValgrindStubProcess.java: Stub implementation of IProcess.
+ * ValgrindTestLaunchDelegate.java (getValgrindCommand): No longer
+ passed exit code.
+ (createNewProcess): Hook into ValgrindStubProcess.
+ * ValgrindTestLaunchPlugin.java (getValgrindCommand): No longer
+ passed exit code.
+
2009-04-02 Elliott Baron <ebaron@redhat.com>
* ValgrindTestLaunchDelegate.java (getValgrindCommand): Reading error code
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.tests/META-INF/MANIFEST.MF b/valgrind/org.eclipse.linuxtools.valgrind.tests/META-INF/MANIFEST.MF
index 422d91455b..6d9e35c7fb 100644
--- a/valgrind/org.eclipse.linuxtools.valgrind.tests/META-INF/MANIFEST.MF
+++ b/valgrind/org.eclipse.linuxtools.valgrind.tests/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name.0
Bundle-SymbolicName: org.eclipse.linuxtools.valgrind.tests;singleton:=true
-Bundle-Version: 0.1.0.qualifier
+Bundle-Version: 0.2.0.qualifier
Bundle-Vendor: %Bundle-Vendor.0
Bundle-Localization: plugin
Bundle-ActivationPolicy: lazy
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.tests/src/org/eclipse/linuxtools/valgrind/tests/AbstractValgrindTest.java b/valgrind/org.eclipse.linuxtools.valgrind.tests/src/org/eclipse/linuxtools/valgrind/tests/AbstractValgrindTest.java
index 27524e22d7..b5a11d017b 100644
--- a/valgrind/org.eclipse.linuxtools.valgrind.tests/src/org/eclipse/linuxtools/valgrind/tests/AbstractValgrindTest.java
+++ b/valgrind/org.eclipse.linuxtools.valgrind.tests/src/org/eclipse/linuxtools/valgrind/tests/AbstractValgrindTest.java
@@ -102,7 +102,6 @@ public abstract class AbstractValgrindTest extends AbstractTest {
ValgrindTestLaunchDelegate delegate = new ValgrindTestLaunchDelegate();
launch = new Launch(config, ILaunchManager.PROFILE_MODE, null);
- System.out.println(testName);
DebugPlugin.getDefault().getLaunchManager().addLaunch(launch);
launches.add(launch);
delegate.launch(config, ILaunchManager.PROFILE_MODE, launch, null);
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.tests/src/org/eclipse/linuxtools/valgrind/tests/ValgrindStubCommand.java b/valgrind/org.eclipse.linuxtools.valgrind.tests/src/org/eclipse/linuxtools/valgrind/tests/ValgrindStubCommand.java
index 67103599d6..02fc7c8e34 100644
--- a/valgrind/org.eclipse.linuxtools.valgrind.tests/src/org/eclipse/linuxtools/valgrind/tests/ValgrindStubCommand.java
+++ b/valgrind/org.eclipse.linuxtools.valgrind.tests/src/org/eclipse/linuxtools/valgrind/tests/ValgrindStubCommand.java
@@ -18,10 +18,6 @@ import org.eclipse.linuxtools.valgrind.core.ValgrindCommand;
public class ValgrindStubCommand extends ValgrindCommand {
protected int exitcode;
- public ValgrindStubCommand(int exitcode) {
- this.exitcode = exitcode;
- }
-
@Override
public String whichValgrind() throws IOException {
return "/path/to/valgrind"; //$NON-NLS-1$
@@ -35,6 +31,6 @@ public class ValgrindStubCommand extends ValgrindCommand {
@Override
public Process getProcess() {
- return new ValgrindStubProcess(exitcode);
+ return null;
}
}
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.tests/src/org/eclipse/linuxtools/valgrind/tests/ValgrindStubProcess.java b/valgrind/org.eclipse.linuxtools.valgrind.tests/src/org/eclipse/linuxtools/valgrind/tests/ValgrindStubProcess.java
index e1cc6e65bf..2720b4aa2b 100644
--- a/valgrind/org.eclipse.linuxtools.valgrind.tests/src/org/eclipse/linuxtools/valgrind/tests/ValgrindStubProcess.java
+++ b/valgrind/org.eclipse.linuxtools.valgrind.tests/src/org/eclipse/linuxtools/valgrind/tests/ValgrindStubProcess.java
@@ -10,59 +10,69 @@
*******************************************************************************/
package org.eclipse.linuxtools.valgrind.tests;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
+import java.util.HashMap;
+import java.util.Map;
-public class ValgrindStubProcess extends Process {
+import org.eclipse.debug.core.DebugException;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.model.IProcess;
+import org.eclipse.debug.core.model.IStreamsProxy;
+
+public class ValgrindStubProcess implements IProcess {
+ protected Map<String, String> attributes;
+ protected ILaunch launch;
+ protected String label;
+ protected IStreamsProxy streamsProxy;
protected int exitcode;
- public ValgrindStubProcess(int exitcode) {
+ public ValgrindStubProcess(ILaunch launch, String label, int exitcode) {
+ attributes = new HashMap<String, String>();
+ streamsProxy = new ValgrindStubStreamsProxy();
+ this.launch = launch;
+ this.label = label;
this.exitcode = exitcode;
+
+ launch.addProcess(this);
}
- @Override
- public void destroy() {
+ public String getAttribute(String key) {
+ return attributes.get(key);
}
- @Override
- public int exitValue() {
- System.out.println("java.lang.Process Exit Code=" + exitcode);
+ public int getExitValue() throws DebugException {
return exitcode;
}
- @Override
- public InputStream getErrorStream() {
- return new InputStream() {
- @Override
- public int read() throws IOException {
- return -1;
- }
- };
+ public String getLabel() {
+ return label;
}
- @Override
- public InputStream getInputStream() {
- return new InputStream() {
- @Override
- public int read() throws IOException {
- return -1;
- }
- };
+ public ILaunch getLaunch() {
+ return launch;
}
- @Override
- public OutputStream getOutputStream() {
- return new OutputStream() {
- public void write(int b) throws IOException {
- }
- };
+ public IStreamsProxy getStreamsProxy() {
+ return streamsProxy;
}
- @Override
- public int waitFor() throws InterruptedException {
- System.out.println("java.lang.Process Exit Code=" + exitcode);
- return exitcode;
+ public void setAttribute(String key, String value) {
+ attributes.put(key, value);
+ }
+
+ @SuppressWarnings("unchecked")
+ public Object getAdapter(Class adapter) {
+ return null;
+ }
+
+ public boolean canTerminate() {
+ return true;
+ }
+
+ public boolean isTerminated() {
+ return true;
+ }
+
+ public void terminate() throws DebugException {
}
}
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.tests/src/org/eclipse/linuxtools/valgrind/tests/ValgrindStubStreamsProxy.java b/valgrind/org.eclipse.linuxtools.valgrind.tests/src/org/eclipse/linuxtools/valgrind/tests/ValgrindStubStreamsProxy.java
new file mode 100644
index 0000000000..930ac01ee2
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.tests/src/org/eclipse/linuxtools/valgrind/tests/ValgrindStubStreamsProxy.java
@@ -0,0 +1,21 @@
+package org.eclipse.linuxtools.valgrind.tests;
+
+import java.io.IOException;
+
+import org.eclipse.debug.core.model.IStreamMonitor;
+import org.eclipse.debug.core.model.IStreamsProxy;
+
+public class ValgrindStubStreamsProxy implements IStreamsProxy {
+
+ public IStreamMonitor getErrorStreamMonitor() {
+ return null;
+ }
+
+ public IStreamMonitor getOutputStreamMonitor() {
+ return null;
+ }
+
+ public void write(String input) throws IOException {
+ }
+
+}
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.tests/src/org/eclipse/linuxtools/valgrind/tests/ValgrindTestLaunchDelegate.java b/valgrind/org.eclipse.linuxtools.valgrind.tests/src/org/eclipse/linuxtools/valgrind/tests/ValgrindTestLaunchDelegate.java
index 36da291a7b..b36302eb3e 100644
--- a/valgrind/org.eclipse.linuxtools.valgrind.tests/src/org/eclipse/linuxtools/valgrind/tests/ValgrindTestLaunchDelegate.java
+++ b/valgrind/org.eclipse.linuxtools.valgrind.tests/src/org/eclipse/linuxtools/valgrind/tests/ValgrindTestLaunchDelegate.java
@@ -16,7 +16,9 @@ import java.io.IOException;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
+import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.model.IProcess;
import org.eclipse.linuxtools.valgrind.core.ValgrindCommand;
import org.eclipse.linuxtools.valgrind.launch.ValgrindLaunchConfigurationDelegate;
import org.eclipse.linuxtools.valgrind.launch.ValgrindLaunchPlugin;
@@ -28,13 +30,7 @@ public class ValgrindTestLaunchDelegate extends ValgrindLaunchConfigurationDeleg
@Override
protected ValgrindCommand getValgrindCommand() {
if (!ValgrindTestsPlugin.RUN_VALGRIND) {
- int exitcode = 0;
- try {
- exitcode = readErrorCode();
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- return new ValgrindStubCommand(exitcode);
+ return new ValgrindStubCommand();
}
else {
return super.getValgrindCommand();
@@ -47,6 +43,24 @@ public class ValgrindTestLaunchDelegate extends ValgrindLaunchConfigurationDeleg
super.createDirectory(path);
}
}
+
+ @Override
+ protected IProcess createNewProcess(ILaunch launch, Process systemProcess,
+ String programName) {
+ IProcess process;
+ if (ValgrindTestsPlugin.RUN_VALGRIND) {
+ process = super.createNewProcess(launch, systemProcess, programName);
+ }
+ else {
+ try {
+ int exitcode = readErrorCode();
+ process = new ValgrindStubProcess(launch, programName, exitcode);
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ return process;
+ }
@Override
protected void setOutputPath(ILaunchConfiguration config)
@@ -90,7 +104,6 @@ public class ValgrindTestLaunchDelegate extends ValgrindLaunchConfigurationDeleg
FileReader fr = null;
try {
IPath path = verifyOutputPath(config).append(ERROR_CODE_FILE);
- System.out.println("Path to .errorCode: " + path.toOSString());
int exitcode = 0;
if (path.toFile().exists()) {
fr = new FileReader(path.toFile());
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.tests/src/org/eclipse/linuxtools/valgrind/tests/ValgrindTestLaunchPlugin.java b/valgrind/org.eclipse.linuxtools.valgrind.tests/src/org/eclipse/linuxtools/valgrind/tests/ValgrindTestLaunchPlugin.java
index ff00c0543e..200ebf02a3 100644
--- a/valgrind/org.eclipse.linuxtools.valgrind.tests/src/org/eclipse/linuxtools/valgrind/tests/ValgrindTestLaunchPlugin.java
+++ b/valgrind/org.eclipse.linuxtools.valgrind.tests/src/org/eclipse/linuxtools/valgrind/tests/ValgrindTestLaunchPlugin.java
@@ -65,7 +65,7 @@ public class ValgrindTestLaunchPlugin extends ValgrindLaunchPlugin {
@Override
protected ValgrindCommand getValgrindCommand() {
if (!ValgrindTestsPlugin.RUN_VALGRIND) {
- return new ValgrindStubCommand(0);
+ return new ValgrindStubCommand();
}
else {
return super.getValgrindCommand();

Back to the top