~ubuntu-branches/ubuntu/trusty/eclipse-linuxtools/trusty

« back to all changes in this revision

Viewing changes to valgrind/org.eclipse.linuxtools.valgrind.tests/src/org/eclipse/linuxtools/internal/valgrind/tests/ValgrindTestsPlugin.java

  • Committer: Package Import Robot
  • Author(s): Jakub Adam
  • Date: 2012-06-29 12:07:30 UTC
  • Revision ID: package-import@ubuntu.com-20120629120730-bfri1xys1i71dpn6
Tags: upstream-1.0.0
ImportĀ upstreamĀ versionĀ 1.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
7
 *
 
8
 * Contributors:
 
9
 *    Elliott Baron <ebaron@redhat.com> - initial API and implementation
 
10
 *******************************************************************************/
 
11
package org.eclipse.linuxtools.internal.valgrind.tests;
 
12
 
 
13
import org.eclipse.ui.plugin.AbstractUIPlugin;
 
14
import org.osgi.framework.BundleContext;
 
15
 
 
16
public class ValgrindTestsPlugin extends AbstractUIPlugin {
 
17
 
 
18
        // The plug-in ID
 
19
        public static final String PLUGIN_ID = "org.eclipse.linuxtools.valgrind.tests"; //$NON-NLS-1$
 
20
        
 
21
        // Java Runtime System Properties       
 
22
        /**
 
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
 
27
         */
 
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$
 
30
        
 
31
        /**
 
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
 
35
         */
 
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$
 
39
        
 
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$
 
42
        
 
43
        // The shared instance
 
44
        private static ValgrindTestsPlugin plugin;
 
45
 
 
46
        /**
 
47
         * The constructor
 
48
         */
 
49
        public ValgrindTestsPlugin() {
 
50
        }
 
51
 
 
52
        /*
 
53
         * (non-Javadoc)
 
54
         * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
 
55
         */
 
56
        public void start(BundleContext context) throws Exception {
 
57
                super.start(context);
 
58
                plugin = this;
 
59
        }
 
60
 
 
61
        /*
 
62
         * (non-Javadoc)
 
63
         * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
 
64
         */
 
65
        public void stop(BundleContext context) throws Exception {
 
66
                plugin = null;
 
67
                super.stop(context);
 
68
        }
 
69
 
 
70
        /**
 
71
         * Returns the shared instance
 
72
         *
 
73
         * @return the shared instance
 
74
         */
 
75
        public static ValgrindTestsPlugin getDefault() {
 
76
                return plugin;
 
77
        }
 
78
}