1
/*******************************************************************************
2
* Copyright (c) 2009 Red Hat, Inc.
3
* All rights reserved. This program and the accompanying materials
4
* are made available under the terms of the Eclipse Public License v1.0
5
* which accompanies this distribution, and is available at
6
* http://www.eclipse.org/legal/epl-v10.html
9
* Elliott Baron <ebaron@redhat.com> - initial API and implementation
10
*******************************************************************************/
11
package org.eclipse.linuxtools.internal.valgrind.tests;
13
import org.eclipse.ui.plugin.AbstractUIPlugin;
14
import org.osgi.framework.BundleContext;
16
public class ValgrindTestsPlugin extends AbstractUIPlugin {
19
public static final String PLUGIN_ID = "org.eclipse.linuxtools.valgrind.tests"; //$NON-NLS-1$
21
// Java Runtime System Properties
23
* usage: -Declipse.valgrind.tests.generateFiles=<yes|no> [default: no]
24
* if yes, will run Valgrind and store its output files for each test under
25
* <plugin root>/valgrindFiles
26
* no, will use default output directory for valgrind's output
28
public static final String SYSTEM_PROPERTY_GENERATE_FILES = "eclipse.valgrind.tests.generateFiles"; //$NON-NLS-1$
29
public static final boolean GENERATE_FILES = System.getProperty(SYSTEM_PROPERTY_GENERATE_FILES, "no").equals("yes"); //$NON-NLS-1$ //$NON-NLS-2$
32
* usage: -Declipse.valgrind.tests.runValgrind=<yes|no> [default: yes]
33
* if yes, will run Valgrind as in a normal launch
34
* no, will simulate Valgrind execution with pregenerated log files
36
public static final String SYSTEM_PROPERTY_RUN_VALGRIND = "eclipse.valgrind.tests.runValgrind"; //$NON-NLS-1$
37
// generateFiles implies runValgrind
38
public static final boolean RUN_VALGRIND = GENERATE_FILES || System.getProperty(SYSTEM_PROPERTY_RUN_VALGRIND, "yes").equals("yes"); //$NON-NLS-1$ //$NON-NLS-2$
40
// Launch config attribute to mock valgrind's exit code
41
public static final String ATTR_MOCK_EXIT_CODE = PLUGIN_ID + ".MOCK_EXIT_CODE"; //$NON-NLS-1$
43
// The shared instance
44
private static ValgrindTestsPlugin plugin;
49
public ValgrindTestsPlugin() {
54
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
56
public void start(BundleContext context) throws Exception {
63
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
65
public void stop(BundleContext context) throws Exception {
71
* Returns the shared instance
73
* @return the shared instance
75
public static ValgrindTestsPlugin getDefault() {