Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'debug/org.eclipse.cdt.debug.application.tests')
-rw-r--r--debug/org.eclipse.cdt.debug.application.tests/.classpath7
-rw-r--r--debug/org.eclipse.cdt.debug.application.tests/.project28
-rw-r--r--debug/org.eclipse.cdt.debug.application.tests/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--debug/org.eclipse.cdt.debug.application.tests/META-INF/MANIFEST.MF20
-rw-r--r--debug/org.eclipse.cdt.debug.application.tests/StandaloneTests.launch45
-rw-r--r--debug/org.eclipse.cdt.debug.application.tests/about.html22
-rw-r--r--debug/org.eclipse.cdt.debug.application.tests/build.properties16
-rw-r--r--debug/org.eclipse.cdt.debug.application.tests/plugin.properties12
-rw-r--r--debug/org.eclipse.cdt.debug.application.tests/pom.xml51
-rw-r--r--debug/org.eclipse.cdt.debug.application.tests/projects/hello/Makefile15
-rw-r--r--debug/org.eclipse.cdt.debug.application.tests/projects/hello/hello.c13
-rw-r--r--debug/org.eclipse.cdt.debug.application.tests/projects/hello/somehdr.h9
-rw-r--r--debug/org.eclipse.cdt.debug.application.tests/projects/hello/x.c3
-rw-r--r--debug/org.eclipse.cdt.debug.application.tests/src/org/eclipse/cdt/debug/application/tests/AllTests.java23
-rw-r--r--debug/org.eclipse.cdt.debug.application.tests/src/org/eclipse/cdt/debug/application/tests/StandaloneTest.java95
-rw-r--r--debug/org.eclipse.cdt.debug.application.tests/src/org/eclipse/cdt/debug/application/tests/StandaloneTest1.java139
-rw-r--r--debug/org.eclipse.cdt.debug.application.tests/src/org/eclipse/cdt/debug/application/tests/Utilities.java200
17 files changed, 705 insertions, 0 deletions
diff --git a/debug/org.eclipse.cdt.debug.application.tests/.classpath b/debug/org.eclipse.cdt.debug.application.tests/.classpath
new file mode 100644
index 00000000000..098194ca4b7
--- /dev/null
+++ b/debug/org.eclipse.cdt.debug.application.tests/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/debug/org.eclipse.cdt.debug.application.tests/.project b/debug/org.eclipse.cdt.debug.application.tests/.project
new file mode 100644
index 00000000000..32ffe49348b
--- /dev/null
+++ b/debug/org.eclipse.cdt.debug.application.tests/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.cdt.debug.application.tests</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/debug/org.eclipse.cdt.debug.application.tests/.settings/org.eclipse.jdt.core.prefs b/debug/org.eclipse.cdt.debug.application.tests/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000000..f42de363afa
--- /dev/null
+++ b/debug/org.eclipse.cdt.debug.application.tests/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
+org.eclipse.jdt.core.compiler.compliance=1.7
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.7
diff --git a/debug/org.eclipse.cdt.debug.application.tests/META-INF/MANIFEST.MF b/debug/org.eclipse.cdt.debug.application.tests/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..20d9ac817f5
--- /dev/null
+++ b/debug/org.eclipse.cdt.debug.application.tests/META-INF/MANIFEST.MF
@@ -0,0 +1,20 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %bundleName
+Bundle-SymbolicName: org.eclipse.cdt.debug.application.tests
+Bundle-Version: 1.0.0.qualifier
+Bundle-Vendor: %bundleVendor
+Bundle-RequiredExecutionEnvironment: JavaSE-1.7
+Require-Bundle: org.eclipse.cdt.debug.application,
+ org.eclipse.cdt.debug.application.doc,
+ org.eclipse.swtbot.eclipse.finder,
+ org.eclipse.swtbot.go,
+ org.eclipse.swtbot.junit4_x,
+ org.junit,
+ org.eclipse.cdt.core.native
+Bundle-ActivationPolicy: lazy
+Bundle-Localization: plugin
+Import-Package: org.eclipse.cdt.utils.pty,
+ org.eclipse.core.resources,
+ org.eclipse.debug.core
+Export-Package: org.eclipse.cdt.debug.application.tests;x-internal:=true
diff --git a/debug/org.eclipse.cdt.debug.application.tests/StandaloneTests.launch b/debug/org.eclipse.cdt.debug.application.tests/StandaloneTests.launch
new file mode 100644
index 00000000000..f4274983f9c
--- /dev/null
+++ b/debug/org.eclipse.cdt.debug.application.tests/StandaloneTests.launch
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.pde.ui.JunitLaunchConfig">
+<booleanAttribute key="append.args" value="true"/>
+<booleanAttribute key="askclear" value="false"/>
+<booleanAttribute key="automaticAdd" value="true"/>
+<booleanAttribute key="automaticValidate" value="false"/>
+<stringAttribute key="bootstrap" value=""/>
+<stringAttribute key="checked" value="[NONE]"/>
+<booleanAttribute key="clearConfig" value="true"/>
+<booleanAttribute key="clearws" value="true"/>
+<booleanAttribute key="clearwslog" value="false"/>
+<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit"/>
+<booleanAttribute key="default" value="false"/>
+<stringAttribute key="deselected_workspace_plugins" value="org.eclipse.cdt.alltests,org.eclipse.cdt.autotools.core,org.eclipse.cdt.autotools.docs,org.eclipse.cdt.autotools.tests,org.eclipse.cdt.autotools.ui,org.eclipse.cdt.autotools.ui.tests,org.eclipse.cdt.build.crossgcc,org.eclipse.cdt.codan.core.test,org.eclipse.cdt.codan.examples,org.eclipse.cdt.core.lrparser,org.eclipse.cdt.core.lrparser.tests,org.eclipse.cdt.core.lrparser.xlc,org.eclipse.cdt.core.lrparser.xlc.tests,org.eclipse.cdt.core.parser.upc,org.eclipse.cdt.core.parser.upc.tests,org.eclipse.cdt.core.tests,org.eclipse.cdt.debug.ui.tests,org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui,org.eclipse.cdt.errorparsers.xlc,org.eclipse.cdt.errorparsers.xlc.tests,org.eclipse.cdt.examples.dsf,org.eclipse.cdt.examples.dsf.pda,org.eclipse.cdt.examples.dsf.pda.ui,org.eclipse.cdt.launch.remote,org.eclipse.cdt.make.core.tests,org.eclipse.cdt.make.ui.tests,org.eclipse.cdt.make.xlc.core,org.eclipse.cdt.managedbuilder.bupc.ui,org.eclipse.cdt.managedbuilder.core.tests,org.eclipse.cdt.managedbuilder.llvm.tests,org.eclipse.cdt.managedbuilder.llvm.ui,org.eclipse.cdt.managedbuilder.ui,org.eclipse.cdt.managedbuilder.ui.tests,org.eclipse.cdt.managedbuilder.xlc.core,org.eclipse.cdt.managedbuilder.xlc.ui,org.eclipse.cdt.managedbuilder.xlupc.ui,org.eclipse.cdt.msw.build,org.eclipse.cdt.p2,org.eclipse.cdt.p2.generator,org.eclipse.cdt.qt.core,org.eclipse.cdt.qt.tests,org.eclipse.cdt.qt.ui,org.eclipse.cdt.remote.core,org.eclipse.cdt.sdk,org.eclipse.cdt.testing,org.eclipse.cdt.tests.dsf,org.eclipse.cdt.tests.dsf.gdb,org.eclipse.cdt.testsrunner,org.eclipse.cdt.testsrunner.boost,org.eclipse.cdt.testsrunner.gtest,org.eclipse.cdt.testsrunner.qttest,org.eclipse.cdt.testsrunner.test,org.eclipse.cdt.ui.tests,org.eclipse.cdt.visualizer.core,org.eclipse.cdt.visualizer.examples,org.eclipse.cdt.visualizer.ui,org.eclipse.linuxtools.binutils,org.eclipse.linuxtools.callgraph,org.eclipse.linuxtools.callgraph.core,org.eclipse.linuxtools.callgraph.docs,org.eclipse.linuxtools.callgraph.launch,org.eclipse.linuxtools.callgraph.launch.tests,org.eclipse.linuxtools.callgraph.tests,org.eclipse.linuxtools.cdt.autotools.core,org.eclipse.linuxtools.cdt.libhover.devhelp,org.eclipse.linuxtools.cdt.libhover.devhelp.tests,org.eclipse.linuxtools.cdt.libhover.libstdcxx,org.eclipse.linuxtools.cdt.libhover.newlib,org.eclipse.linuxtools.cdt.libhover.tests,org.eclipse.linuxtools.changelog.core,org.eclipse.linuxtools.changelog.cparser,org.eclipse.linuxtools.changelog.doc,org.eclipse.linuxtools.changelog.parsers.java,org.eclipse.linuxtools.changelog.tests,org.eclipse.linuxtools.changelog.ui.tests,org.eclipse.linuxtools.dataviewers,org.eclipse.linuxtools.dataviewers.charts,org.eclipse.linuxtools.dataviewers.piechart,org.eclipse.linuxtools.gcov.core,org.eclipse.linuxtools.gcov.docs,org.eclipse.linuxtools.gcov.launch,org.eclipse.linuxtools.gcov.test,org.eclipse.linuxtools.gprof,org.eclipse.linuxtools.gprof.docs,org.eclipse.linuxtools.gprof.launch,org.eclipse.linuxtools.gprof.test,org.eclipse.linuxtools.man.core,org.eclipse.linuxtools.oprofile.core,org.eclipse.linuxtools.oprofile.core.tests,org.eclipse.linuxtools.oprofile.doc,org.eclipse.linuxtools.oprofile.launch,org.eclipse.linuxtools.oprofile.launch.tests,org.eclipse.linuxtools.oprofile.remote.launch,org.eclipse.linuxtools.oprofile.tests,org.eclipse.linuxtools.oprofile.ui,org.eclipse.linuxtools.oprofile.ui.tests,org.eclipse.linuxtools.perf,org.eclipse.linuxtools.perf.doc,org.eclipse.linuxtools.perf.swtbot.tests,org.eclipse.linuxtools.perf.tests,org.eclipse.linuxtools.profiling.docs,org.eclipse.linuxtools.profiling.launch.ui.rdt.proxy,org.eclipse.linuxtools.profiling.provider.tests,org.eclipse.linuxtools.profiling.tests,org.eclipse.linuxtools.profiling.ui,org.eclipse.linuxtools.profiling.ui.capability,org.eclipse.linuxtools.rdt.proxy,org.eclipse.linuxtools.rpm.core,org.eclipse.linuxtools.rpm.core.tests,org.eclipse.linuxtools.rpm.createrepo,org.eclipse.linuxtools.rpm.createrepo.tests,org.eclipse.linuxtools.rpm.rpmlint,org.eclipse.linuxtools.rpm.ui,org.eclipse.linuxtools.rpm.ui.editor,org.eclipse.linuxtools.rpm.ui.editor.doc,org.eclipse.linuxtools.rpm.ui.editor.tests,org.eclipse.linuxtools.rpmstubby,org.eclipse.linuxtools.ssh.proxy,org.eclipse.linuxtools.systemtap.graphing.core,org.eclipse.linuxtools.systemtap.graphing.core.tests,org.eclipse.linuxtools.systemtap.graphing.ui,org.eclipse.linuxtools.systemtap.structures,org.eclipse.linuxtools.systemtap.structures.tests,org.eclipse.linuxtools.systemtap.ui.consolelog,org.eclipse.linuxtools.systemtap.ui.consolelog.tests,org.eclipse.linuxtools.systemtap.ui.doc,org.eclipse.linuxtools.systemtap.ui.editor,org.eclipse.linuxtools.systemtap.ui.ide,org.eclipse.linuxtools.systemtap.ui.ide.tests,org.eclipse.linuxtools.tools.launch.ui,org.eclipse.linuxtools.valgrind.cachegrind,org.eclipse.linuxtools.valgrind.cachegrind.tests,org.eclipse.linuxtools.valgrind.core,org.eclipse.linuxtools.valgrind.doc,org.eclipse.linuxtools.valgrind.helgrind,org.eclipse.linuxtools.valgrind.helgrind.tests,org.eclipse.linuxtools.valgrind.launch,org.eclipse.linuxtools.valgrind.massif,org.eclipse.linuxtools.valgrind.massif.tests,org.eclipse.linuxtools.valgrind.memcheck,org.eclipse.linuxtools.valgrind.memcheck.tests,org.eclipse.linuxtools.valgrind.tests,org.eclipse.linuxtools.valgrind.ui,org.eclipse.linuxtools.valgrind.ui.editor,org.eclipse.linuxtools.valgrind.ui.tests,org.eclipse.test.performance"/>
+<booleanAttribute key="includeOptional" value="true"/>
+<stringAttribute key="location" value="${workspace_loc}/../junit-workspace2"/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/org.eclipse.cdt.debug.application.tests/src/org/eclipse/cdt/debug/application/tests/AllTests.java"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="1"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
+<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
+<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
+<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
+<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.cdt.debug.application.tests.AllTests"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog -clean"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.cdt.debug.application.tests"/>
+<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms40m&#10;-Xmx512M&#10;-XX:MaxPermSize=256m"/>
+<stringAttribute key="pde.version" value="3.3"/>
+<stringAttribute key="product" value="org.eclipse.cdt.debug.application.product"/>
+<booleanAttribute key="run_in_ui_thread" value="false"/>
+<stringAttribute key="selected_target_plugins" value="com.google.guava@default:default,com.ibm.icu@default:default,com.jcraft.jsch@default:default,com.sun.el@default:default,javax.annotation@default:default,javax.el@default:default,javax.inject@default:default,javax.servlet.jsp@default:default,javax.servlet@default:default,javax.xml@default:default,net.sourceforge.lpg.lpgjavaruntime@default:default,org.antlr.runtime@default:default,org.apache.ant@default:default,org.apache.batik.css@default:default,org.apache.batik.util.gui@default:default,org.apache.batik.util@default:default,org.apache.commons.codec@default:default,org.apache.commons.httpclient@default:default,org.apache.commons.io@default:default,org.apache.commons.lang@default:default,org.apache.commons.logging@default:default,org.apache.commons.net@default:default,org.apache.derby@default:default,org.apache.felix.gogo.command@default:default,org.apache.felix.gogo.runtime@default:default,org.apache.felix.gogo.shell@default:default,org.apache.httpcomponents.httpclient@default:default,org.apache.httpcomponents.httpcore@default:default,org.apache.jasper.glassfish@default:default,org.apache.log4j@default:default,org.apache.lucene.analysis@default:default,org.apache.lucene.core@default:default,org.apache.xerces@default:default,org.apache.xml.resolver@default:default,org.apache.xml.serializer@default:default,org.cyberneko.html@default:default,org.easymock@default:default,org.eclipse.ant.core@default:default,org.eclipse.ant.optional.junit@default:false,org.eclipse.compare.core@default:default,org.eclipse.compare@default:default,org.eclipse.core.commands@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.core.databinding.beans@default:default,org.eclipse.core.databinding.observable@default:default,org.eclipse.core.databinding.property@default:default,org.eclipse.core.databinding@default:default,org.eclipse.core.expressions@default:default,org.eclipse.core.externaltools@default:default,org.eclipse.core.filebuffers@default:default,org.eclipse.core.filesystem.java7@default:false,org.eclipse.core.filesystem.linux.x86_64@default:false,org.eclipse.core.filesystem@default:default,org.eclipse.core.jobs@default:default,org.eclipse.core.net.linux.x86_64@default:false,org.eclipse.core.net@default:default,org.eclipse.core.resources@default:default,org.eclipse.core.runtime.compatibility.registry@default:false,org.eclipse.core.runtime.compatibility@default:default,org.eclipse.core.runtime@default:true,org.eclipse.core.variables@default:default,org.eclipse.debug.core@default:default,org.eclipse.debug.ui@default:default,org.eclipse.draw2d@default:default,org.eclipse.dstore.core@default:default,org.eclipse.dstore.doc.isv@default:default,org.eclipse.dstore.extra@default:default,org.eclipse.e4.core.commands@default:default,org.eclipse.e4.core.contexts@default:default,org.eclipse.e4.core.di.extensions@default:default,org.eclipse.e4.core.di@default:default,org.eclipse.e4.core.services@default:default,org.eclipse.e4.ui.bindings@default:default,org.eclipse.e4.ui.css.core@default:default,org.eclipse.e4.ui.css.swt.theme@default:default,org.eclipse.e4.ui.css.swt@default:default,org.eclipse.e4.ui.di@default:default,org.eclipse.e4.ui.model.workbench@default:default,org.eclipse.e4.ui.services@default:default,org.eclipse.e4.ui.widgets@default:default,org.eclipse.e4.ui.workbench.addons.swt@default:default,org.eclipse.e4.ui.workbench.renderers.swt@default:default,org.eclipse.e4.ui.workbench.swt@default:default,org.eclipse.e4.ui.workbench3@default:default,org.eclipse.e4.ui.workbench@default:default,org.eclipse.ecf.filetransfer@default:default,org.eclipse.ecf.identity@default:default,org.eclipse.ecf.provider.filetransfer.httpclient4.ssl@default:false,org.eclipse.ecf.provider.filetransfer.httpclient4@default:default,org.eclipse.ecf.provider.filetransfer.ssl@default:false,org.eclipse.ecf.provider.filetransfer@default:default,org.eclipse.ecf.ssl@default:false,org.eclipse.ecf@default:default,org.eclipse.emf.common@default:default,org.eclipse.emf.ecore.change@default:default,org.eclipse.emf.ecore.xmi@default:default,org.eclipse.emf.ecore@default:default,org.eclipse.equinox.app@default:default,org.eclipse.equinox.bidi@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.concurrent@default:default,org.eclipse.equinox.console@default:default,org.eclipse.equinox.ds@1:true,org.eclipse.equinox.event@default:default,org.eclipse.equinox.frameworkadmin.equinox@default:default,org.eclipse.equinox.frameworkadmin@default:default,org.eclipse.equinox.http.jetty@default:default,org.eclipse.equinox.http.registry@default:default,org.eclipse.equinox.http.servlet@default:default,org.eclipse.equinox.jsp.jasper.registry@default:default,org.eclipse.equinox.jsp.jasper@default:default,org.eclipse.equinox.launcher.gtk.linux.x86_64@default:false,org.eclipse.equinox.launcher@default:default,org.eclipse.equinox.p2.artifact.repository@default:default,org.eclipse.equinox.p2.console@default:default,org.eclipse.equinox.p2.core@default:default,org.eclipse.equinox.p2.director.app@default:default,org.eclipse.equinox.p2.director@default:default,org.eclipse.equinox.p2.directorywatcher@default:default,org.eclipse.equinox.p2.engine@default:default,org.eclipse.equinox.p2.extensionlocation@default:default,org.eclipse.equinox.p2.garbagecollector@default:default,org.eclipse.equinox.p2.jarprocessor@default:default,org.eclipse.equinox.p2.metadata.repository@default:default,org.eclipse.equinox.p2.metadata@default:default,org.eclipse.equinox.p2.operations@default:default,org.eclipse.equinox.p2.publisher.eclipse@default:default,org.eclipse.equinox.p2.publisher@default:default,org.eclipse.equinox.p2.ql@default:default,org.eclipse.equinox.p2.reconciler.dropins@default:default,org.eclipse.equinox.p2.repository.tools@default:default,org.eclipse.equinox.p2.repository@default:default,org.eclipse.equinox.p2.touchpoint.eclipse@default:default,org.eclipse.equinox.p2.touchpoint.natives@default:default,org.eclipse.equinox.p2.transport.ecf@default:default,org.eclipse.equinox.p2.ui.importexport@default:default,org.eclipse.equinox.p2.ui.sdk.scheduler@default:default,org.eclipse.equinox.p2.ui.sdk@default:default,org.eclipse.equinox.p2.ui@default:default,org.eclipse.equinox.p2.updatechecker@default:default,org.eclipse.equinox.p2.updatesite@default:default,org.eclipse.equinox.preferences@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.equinox.security.ui@default:default,org.eclipse.equinox.security@default:default,org.eclipse.equinox.simpleconfigurator.manipulator@default:default,org.eclipse.equinox.simpleconfigurator@1:true,org.eclipse.equinox.util@default:default,org.eclipse.help.base@default:default,org.eclipse.help.ui@default:default,org.eclipse.help.webapp@default:default,org.eclipse.help@default:default,org.eclipse.jdt.annotation@default:default,org.eclipse.jdt.core.manipulation@default:default,org.eclipse.jdt.core@default:default,org.eclipse.jdt.debug.ui@default:default,org.eclipse.jdt.debug@default:default,org.eclipse.jdt.junit.runtime@default:default,org.eclipse.jdt.launching@default:default,org.eclipse.jdt.ui@default:default,org.eclipse.jetty.continuation@default:default,org.eclipse.jetty.http@default:default,org.eclipse.jetty.io@default:default,org.eclipse.jetty.security@default:default,org.eclipse.jetty.server@default:default,org.eclipse.jetty.servlet@default:default,org.eclipse.jetty.util@default:default,org.eclipse.jface.databinding@default:default,org.eclipse.jface.text@default:default,org.eclipse.jface@default:default,org.eclipse.jsch.core@default:default,org.eclipse.jsch.ui@default:default,org.eclipse.ltk.core.refactoring@default:default,org.eclipse.ltk.ui.refactoring@default:default,org.eclipse.mylyn.commons.core@default:default,org.eclipse.mylyn.commons.identity.core@default:default,org.eclipse.mylyn.commons.net@default:default,org.eclipse.mylyn.commons.notifications.core@default:default,org.eclipse.mylyn.commons.notifications.feed@default:default,org.eclipse.mylyn.commons.notifications.ui@default:default,org.eclipse.mylyn.commons.repositories.core@default:default,org.eclipse.mylyn.commons.repositories.ui@default:default,org.eclipse.mylyn.commons.screenshots@default:default,org.eclipse.mylyn.commons.ui@default:default,org.eclipse.mylyn.commons.workbench@default:default,org.eclipse.mylyn.context.core@default:default,org.eclipse.mylyn.context.ui@default:default,org.eclipse.mylyn.discovery.core@default:default,org.eclipse.mylyn.discovery.ui@default:default,org.eclipse.mylyn.monitor.core@default:default,org.eclipse.mylyn.monitor.ui@default:default,org.eclipse.mylyn.tasks.core@default:default,org.eclipse.mylyn.tasks.index.core@default:default,org.eclipse.mylyn.tasks.index.ui@default:default,org.eclipse.mylyn.tasks.search@default:default,org.eclipse.mylyn.tasks.ui@default:default,org.eclipse.mylyn.wikitext.confluence.core@default:default,org.eclipse.mylyn.wikitext.confluence.ui@default:default,org.eclipse.mylyn.wikitext.context.ui@default:default,org.eclipse.mylyn.wikitext.core.ant@default:default,org.eclipse.mylyn.wikitext.core.osgi@default:default,org.eclipse.mylyn.wikitext.core@default:default,org.eclipse.mylyn.wikitext.help.ui@default:default,org.eclipse.mylyn.wikitext.html.core@default:default,org.eclipse.mylyn.wikitext.markdown.core@default:default,org.eclipse.mylyn.wikitext.markdown.ui@default:default,org.eclipse.mylyn.wikitext.mediawiki.core@default:default,org.eclipse.mylyn.wikitext.mediawiki.ui@default:default,org.eclipse.mylyn.wikitext.tasks.ui@default:default,org.eclipse.mylyn.wikitext.textile.core@default:default,org.eclipse.mylyn.wikitext.textile.ui@default:default,org.eclipse.mylyn.wikitext.tracwiki.core@default:default,org.eclipse.mylyn.wikitext.tracwiki.ui@default:default,org.eclipse.mylyn.wikitext.twiki.core@default:default,org.eclipse.mylyn.wikitext.twiki.ui@default:default,org.eclipse.mylyn.wikitext.ui@default:default,org.eclipse.osgi.compatibility.state@default:false,org.eclipse.osgi.services@default:default,org.eclipse.osgi.util@default:default,org.eclipse.osgi@-1:true,org.eclipse.pde.runtime@default:default,org.eclipse.platform.doc.user@default:default,org.eclipse.platform@default:default,org.eclipse.ptp.services.core@default:default,org.eclipse.ptp.services.ui@default:default,org.eclipse.rcp@default:default,org.eclipse.search@default:default,org.eclipse.swt.gtk.linux.x86_64@default:false,org.eclipse.swt@default:default,org.eclipse.swtbot.eclipse.core@default:default,org.eclipse.swtbot.eclipse.finder@default:default,org.eclipse.swtbot.forms.finder@default:default,org.eclipse.swtbot.go@default:default,org.eclipse.swtbot.junit4_x@default:default,org.eclipse.swtbot.swt.finder@default:default,org.eclipse.team.core@default:default,org.eclipse.team.ui@default:default,org.eclipse.text@default:default,org.eclipse.tm.terminal@default:default,org.eclipse.ui.browser@default:default,org.eclipse.ui.cheatsheets@default:default,org.eclipse.ui.console@default:default,org.eclipse.ui.editors@default:default,org.eclipse.ui.externaltools@default:default,org.eclipse.ui.forms@default:default,org.eclipse.ui.ide.application@default:default,org.eclipse.ui.ide@default:default,org.eclipse.ui.intro.universal@default:default,org.eclipse.ui.intro@default:default,org.eclipse.ui.navigator.resources@default:default,org.eclipse.ui.navigator@default:default,org.eclipse.ui.net@default:default,org.eclipse.ui.themes@default:default,org.eclipse.ui.trace@default:default,org.eclipse.ui.views.properties.tabbed@default:default,org.eclipse.ui.views@default:default,org.eclipse.ui.workbench.texteditor@default:default,org.eclipse.ui.workbench@default:default,org.eclipse.ui@default:default,org.eclipse.update.configurator@3:true,org.eclipse.zest.core@default:default,org.eclipse.zest.layouts@default:default,org.hamcrest.core@default:default,org.hamcrest.library@default:default,org.json@default:default,org.jsoup@default:default,org.junit@default:default,org.sat4j.core@default:default,org.sat4j.pb@default:default,org.swtchart@default:default,org.w3c.css.sac@default:default,org.w3c.dom.events@default:default,org.w3c.dom.smil@default:default,org.w3c.dom.svg@default:default"/>
+<stringAttribute key="selected_workspace_plugins" value="org.eclipse.cdt.codan.checkers.ui@default:default,org.eclipse.cdt.codan.checkers@default:default,org.eclipse.cdt.codan.core.cxx@default:default,org.eclipse.cdt.codan.core@default:default,org.eclipse.cdt.codan.ui.cfgview@default:default,org.eclipse.cdt.codan.ui.cxx@default:default,org.eclipse.cdt.codan.ui@default:default,org.eclipse.cdt.core.aix@default:false,org.eclipse.cdt.core.linux.ia64@default:false,org.eclipse.cdt.core.linux.ppc64@default:false,org.eclipse.cdt.core.linux.ppc@default:false,org.eclipse.cdt.core.linux.x86@default:false,org.eclipse.cdt.core.linux.x86_64@default:false,org.eclipse.cdt.core.linux@default:false,org.eclipse.cdt.core.macosx@default:false,org.eclipse.cdt.core.native@default:default,org.eclipse.cdt.core.qnx@default:false,org.eclipse.cdt.core.solaris@default:false,org.eclipse.cdt.core.win32.x86@default:false,org.eclipse.cdt.core.win32.x86_64@default:false,org.eclipse.cdt.core.win32@default:false,org.eclipse.cdt.core@default:default,org.eclipse.cdt.debug.application.doc@default:default,org.eclipse.cdt.debug.application.tests@default:default,org.eclipse.cdt.debug.application@default:default,org.eclipse.cdt.debug.core@default:default,org.eclipse.cdt.debug.gdbjtag.core@default:default,org.eclipse.cdt.debug.gdbjtag.ui@default:default,org.eclipse.cdt.debug.gdbjtag@default:default,org.eclipse.cdt.debug.mi.core@default:default,org.eclipse.cdt.debug.mi.ui@default:default,org.eclipse.cdt.debug.ui.memory.floatingpoint@default:default,org.eclipse.cdt.debug.ui.memory.memorybrowser@default:default,org.eclipse.cdt.debug.ui.memory.search@default:default,org.eclipse.cdt.debug.ui.memory.traditional@default:default,org.eclipse.cdt.debug.ui.memory.transport@default:default,org.eclipse.cdt.debug.ui@default:default,org.eclipse.cdt.doc.isv@default:default,org.eclipse.cdt.doc.user@default:default,org.eclipse.cdt.dsf.gdb.ui@default:default,org.eclipse.cdt.dsf.gdb@default:default,org.eclipse.cdt.dsf.ui@default:default,org.eclipse.cdt.dsf@default:default,org.eclipse.cdt.gdb.ui@default:default,org.eclipse.cdt.gdb@default:default,org.eclipse.cdt.launch@default:default,org.eclipse.cdt.make.core@default:default,org.eclipse.cdt.make.ui@default:default,org.eclipse.cdt.managedbuilder.core@default:default,org.eclipse.cdt.managedbuilder.gnu.ui@default:default,org.eclipse.cdt.ui@default:default,org.eclipse.cdt.util@default:default,org.eclipse.cdt@default:default,org.eclipse.linuxtools.cdt.libhover.glibc@default:default,org.eclipse.linuxtools.cdt.libhover.library.docs@default:default,org.eclipse.linuxtools.cdt.libhover@default:default,org.eclipse.linuxtools.profiling.launch@default:default,org.eclipse.linuxtools.tools.launch.core@default:default"/>
+<booleanAttribute key="show_selected_only" value="false"/>
+<stringAttribute key="testApplication" value="org.eclipse.cdt.debug.application.app"/>
+<booleanAttribute key="tracing" value="false"/>
+<booleanAttribute key="useCustomFeatures" value="false"/>
+<booleanAttribute key="useDefaultConfig" value="true"/>
+<booleanAttribute key="useDefaultConfigArea" value="false"/>
+<booleanAttribute key="useProduct" value="true"/>
+</launchConfiguration>
diff --git a/debug/org.eclipse.cdt.debug.application.tests/about.html b/debug/org.eclipse.cdt.debug.application.tests/about.html
new file mode 100644
index 00000000000..fcbffcd8b64
--- /dev/null
+++ b/debug/org.eclipse.cdt.debug.application.tests/about.html
@@ -0,0 +1,22 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<html>
+<head>
+<title>About</title>
+<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 23, 2005</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content.</p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/debug/org.eclipse.cdt.debug.application.tests/build.properties b/debug/org.eclipse.cdt.debug.application.tests/build.properties
new file mode 100644
index 00000000000..4e3cb6cef5d
--- /dev/null
+++ b/debug/org.eclipse.cdt.debug.application.tests/build.properties
@@ -0,0 +1,16 @@
+###############################################################################
+# Copyright (c) 2015 RedHat, Inc. and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Red Hat Incorporated - initial API and implementation
+###############################################################################
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.properties,\
+ about.html
diff --git a/debug/org.eclipse.cdt.debug.application.tests/plugin.properties b/debug/org.eclipse.cdt.debug.application.tests/plugin.properties
new file mode 100644
index 00000000000..057380fc6f1
--- /dev/null
+++ b/debug/org.eclipse.cdt.debug.application.tests/plugin.properties
@@ -0,0 +1,12 @@
+#################################################################################
+# Copyright (c) 2015 Red Hat, Inc.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Red Hat Incorporated - initial API and implementation
+#################################################################################
+bundleName=C/C++ Stand-alone Debugger Tests
+bundleVendor=Eclipse CDT
diff --git a/debug/org.eclipse.cdt.debug.application.tests/pom.xml b/debug/org.eclipse.cdt.debug.application.tests/pom.xml
new file mode 100644
index 00000000000..57132bc3d8b
--- /dev/null
+++ b/debug/org.eclipse.cdt.debug.application.tests/pom.xml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2014, Red Hat, Inc.
+
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+-->
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+ xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.eclipse.cdt</groupId>
+ <artifactId>cdt-parent</artifactId>
+ <version>8.6.0-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+
+ <version>1.0.0-SNAPSHOT</version>
+ <artifactId>org.eclipse.cdt.debug.application.tests</artifactId>
+ <packaging>eclipse-test-plugin</packaging>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-surefire-plugin</artifactId>
+ <version>${tycho-version}</version>
+ <configuration>
+ <useUIHarness>true</useUIHarness>
+ <useUIThread>false</useUIThread>
+ <product>org.eclipse.cdt.debug.application.product</product>
+ <application>org.eclipse.cdt.debug.application.app</application>
+ <argLine>${base.ui.test.vmargs}</argLine>
+ <includes>
+ <include>**/AllTests.*</include>
+ </includes>
+ <testFailureIgnore>true</testFailureIgnore>
+ <dependencies>
+ <dependency>
+ <artifactId>org.eclipse.platform.feature.group</artifactId>
+ <type>p2-installable-unit</type>
+ </dependency>
+ </dependencies>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/debug/org.eclipse.cdt.debug.application.tests/projects/hello/Makefile b/debug/org.eclipse.cdt.debug.application.tests/projects/hello/Makefile
new file mode 100644
index 00000000000..942ade9b2da
--- /dev/null
+++ b/debug/org.eclipse.cdt.debug.application.tests/projects/hello/Makefile
@@ -0,0 +1,15 @@
+all: a.out
+
+CFLAGS=-I. -g3 -O2 -Djeff=2
+
+a.out: hello.o x.o
+ gcc -g -o a.out $?
+
+hello.o: hello.c somehdr.h
+ gcc -c $(CFLAGS) hello.c
+
+x.o: x.c
+ gcc -c $(CFLAGS) $<
+
+clean:
+ rm *.o *.out
diff --git a/debug/org.eclipse.cdt.debug.application.tests/projects/hello/hello.c b/debug/org.eclipse.cdt.debug.application.tests/projects/hello/hello.c
new file mode 100644
index 00000000000..1579168aca0
--- /dev/null
+++ b/debug/org.eclipse.cdt.debug.application.tests/projects/hello/hello.c
@@ -0,0 +1,13 @@
+#include <stdio.h>
+#include "somehdr.h"
+
+int main(int argc, char **argv) {
+ int k = SOME_VALUE; /* comment */
+ int j = x(k);
+ int i;
+ for (i = 0; i < argc; ++i) {
+ printf("argv %d is %s\n", i, argv[i]);
+ }
+ printf ("hello world %d\n", j);
+ return 0;
+}
diff --git a/debug/org.eclipse.cdt.debug.application.tests/projects/hello/somehdr.h b/debug/org.eclipse.cdt.debug.application.tests/projects/hello/somehdr.h
new file mode 100644
index 00000000000..511fd8418f6
--- /dev/null
+++ b/debug/org.eclipse.cdt.debug.application.tests/projects/hello/somehdr.h
@@ -0,0 +1,9 @@
+#ifndef _SOMEHDR_H
+#define _SOMEHDR_H
+#ifdef jeff
+#define SOME_VALUE 6
+#else
+#define SOME_VALUE 8
+#endif
+extern int x(int);
+#endif
diff --git a/debug/org.eclipse.cdt.debug.application.tests/projects/hello/x.c b/debug/org.eclipse.cdt.debug.application.tests/projects/hello/x.c
new file mode 100644
index 00000000000..d3776e46aaa
--- /dev/null
+++ b/debug/org.eclipse.cdt.debug.application.tests/projects/hello/x.c
@@ -0,0 +1,3 @@
+int x(int y) {
+ return y * 7;
+}
diff --git a/debug/org.eclipse.cdt.debug.application.tests/src/org/eclipse/cdt/debug/application/tests/AllTests.java b/debug/org.eclipse.cdt.debug.application.tests/src/org/eclipse/cdt/debug/application/tests/AllTests.java
new file mode 100644
index 00000000000..4ed3d36c58f
--- /dev/null
+++ b/debug/org.eclipse.cdt.debug.application.tests/src/org/eclipse/cdt/debug/application/tests/AllTests.java
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2015 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.cdt.debug.application.tests;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+@RunWith(Suite.class)
+@Suite.SuiteClasses({
+ StandaloneTest1.class,
+})
+
+public class AllTests {
+
+}
diff --git a/debug/org.eclipse.cdt.debug.application.tests/src/org/eclipse/cdt/debug/application/tests/StandaloneTest.java b/debug/org.eclipse.cdt.debug.application.tests/src/org/eclipse/cdt/debug/application/tests/StandaloneTest.java
new file mode 100644
index 00000000000..23544ac16b8
--- /dev/null
+++ b/debug/org.eclipse.cdt.debug.application.tests/src/org/eclipse/cdt/debug/application/tests/StandaloneTest.java
@@ -0,0 +1,95 @@
+/*******************************************************************************
+ * Copyright (c) 2015 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.cdt.debug.application.tests;
+
+import static org.junit.Assert.assertNotNull;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
+import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
+import org.junit.After;
+
+public abstract class StandaloneTest {
+
+ protected static SWTBot bot;
+ protected static String projectName;
+ protected static SWTBotShell mainShell;
+ protected static SWTBotView projectExplorer;
+
+ public static void init(String projectName) throws Exception {
+ SWTBotPreferences.KEYBOARD_LAYOUT = "EN_US";
+
+ Utilities.getDefault().buildProject(projectName);
+ bot = new SWTBot();
+
+ SWTBotShell executableShell = null;
+ for (int i = 0, attempts = 100; i < attempts; i++) {
+ for (SWTBotShell shell : bot.shells()) {
+ if (shell.getText().contains("Debug New Executable")) {
+ executableShell = shell;
+ shell.setFocus();
+ break;
+ }
+ }
+ if (executableShell != null)
+ break;
+ bot.sleep(10);
+ }
+
+ IPath executablePath = Utilities.getDefault().getProjectPath(projectName).append("a.out"); // $NON-NLS-1$
+
+ executableShell.bot().textWithLabel("Binary: ").typeText(executablePath.toOSString());
+ bot.sleep(2000);
+
+ executableShell.bot().button("OK").click();
+
+ mainShell = null;
+ for (int i = 0, attempts = 100; i < attempts; i++) {
+ for (SWTBotShell shell : bot.shells()) {
+ if (shell.getText().contains("C/C++ Stand-alone Debugger")) {
+ mainShell = shell;
+ shell.setFocus();
+ break;
+ }
+ }
+ if (mainShell != null)
+ break;
+ bot.sleep(10);
+ }
+ assertNotNull(mainShell);
+ }
+
+ @After
+ public void cleanUp() {
+ // SWTBotShell[] shells = bot.shells();
+ // for (final SWTBotShell shell : shells) {
+ // if (!shell.equals(mainShell)) {
+ // String shellTitle = shell.getText();
+ // if (shellTitle.length() > 0
+ // && !shellTitle.startsWith("Quick Access")) {
+ // UIThreadRunnable.syncExec(new VoidResult() {
+ // @Override
+ // public void run() {
+ // if (shell.widget.getParent() != null
+ // && !shell.isOpen()) {
+ // shell.close();
+ // }
+ // }
+ // });
+ // }
+ // }
+ // }
+ // mainShell.activate();
+ }
+
+}
diff --git a/debug/org.eclipse.cdt.debug.application.tests/src/org/eclipse/cdt/debug/application/tests/StandaloneTest1.java b/debug/org.eclipse.cdt.debug.application.tests/src/org/eclipse/cdt/debug/application/tests/StandaloneTest1.java
new file mode 100644
index 00000000000..988a349d413
--- /dev/null
+++ b/debug/org.eclipse.cdt.debug.application.tests/src/org/eclipse/cdt/debug/application/tests/StandaloneTest1.java
@@ -0,0 +1,139 @@
+/*******************************************************************************
+ * Copyright (c) 2015 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.cdt.debug.application.tests;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
+import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotText;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+@RunWith(SWTBotJunit4ClassRunner.class)
+public class StandaloneTest1 extends StandaloneTest {
+
+ private static final String PROJECT_NAME = "hello";
+
+ @BeforeClass
+ public static void beforeClass() throws Exception {
+ init(PROJECT_NAME);
+ }
+
+ @Test
+ public void Test1() throws Exception {
+ // Verify the top-level menus are there
+ SWTBotMenu fileMenu = bot.menu("File");
+ assertNotNull(fileMenu);
+ SWTBotMenu editMenu = bot.menu("Edit");
+ assertNotNull(editMenu);
+ SWTBotMenu searchMenu = bot.menu("Search");
+ assertNotNull(searchMenu);
+ SWTBotMenu runMenu = bot.menu("Run");
+ assertNotNull(runMenu);
+ SWTBotMenu windowMenu = bot.menu("Window");
+ assertNotNull(windowMenu);
+ SWTBotMenu helpMenu = bot.menu("Help");
+ assertNotNull(helpMenu);
+
+ // Verify other common top-level menus are not there
+ SWTBotMenu notThere = null;
+ try {
+ notThere = bot.menu("Navigate");
+ } catch (WidgetNotFoundException e) {
+ // correct
+ }
+ assertNull(notThere);
+ try {
+ notThere = bot.menu("Refactor");
+ } catch (WidgetNotFoundException e) {
+ // correct
+ }
+ assertNull(notThere);
+ try {
+ notThere = bot.menu("Source");
+ } catch (WidgetNotFoundException e) {
+ // correct
+ }
+ assertNull(notThere);
+ try {
+ notThere = bot.menu("Target");
+ } catch (WidgetNotFoundException e) {
+ // correct
+ }
+ assertNull(notThere);
+ try {
+ // We want to prove there isn't a top-level Project menu
+ // There happens to be a lower-level Project menu from the Text menu
+ // Verify we find it, but no other menus named Project
+ SWTBotMenu textMenu = bot.menu("Text");
+ @SuppressWarnings("unused")
+ SWTBotMenu projectMenu = textMenu.menu("Project");
+ notThere = bot.menu("Project", 1);
+ } catch (IndexOutOfBoundsException e) {
+ // correct
+ }
+ assertNull(notThere);
+
+ SWTBotMenu attachExecutableDialog = fileMenu.menu("Debug Attached Executable...");
+ assertNotNull(attachExecutableDialog);
+ SWTBotMenu coreFileDialog = fileMenu.menu("Debug Core File...");
+ assertNotNull(coreFileDialog);
+ SWTBotMenu newExecutableDialog = fileMenu.menu("Debug New Executable...");
+ assertNotNull(newExecutableDialog);
+ newExecutableDialog.click();
+ SWTBotShell shell = bot.shell("Debug New Executable");
+ shell.setFocus();
+ // Try and have two open debug sessions on same binary
+ IPath projectPath = Utilities.getDefault().getProjectPath(PROJECT_NAME).append("a.out");
+ shell.bot().textWithLabel("Binary: ").setText(projectPath.toOSString());
+ shell.bot().textWithLabel("Arguments: ").setText("1 2 3");
+ bot.sleep(2000);
+
+ bot.button("OK").click();
+
+ bot.sleep(1000);
+
+ coreFileDialog.click();
+
+ shell = bot.shell("Debug Core File");
+ shell.setFocus();
+
+ SWTBotText text = shell.bot().textWithLabel("Binary: ");
+ assertNotNull(text);
+
+ SWTBotText corefile = shell.bot().textWithLabel("Core File Path:");
+ assertNotNull(corefile);
+
+ bot.sleep(2000);
+
+ bot.button("Cancel").click();
+
+ bot.sleep(2000);
+
+ SWTBotMenu exitMenu = fileMenu.menu("Exit");
+ assertNotNull(exitMenu);
+ exitMenu.click();
+ }
+
+ @AfterClass
+ public static void afterClass() {
+ bot.sleep(1000);
+ }
+
+
+}
diff --git a/debug/org.eclipse.cdt.debug.application.tests/src/org/eclipse/cdt/debug/application/tests/Utilities.java b/debug/org.eclipse.cdt.debug.application.tests/src/org/eclipse/cdt/debug/application/tests/Utilities.java
new file mode 100644
index 00000000000..78bccaf62e8
--- /dev/null
+++ b/debug/org.eclipse.cdt.debug.application.tests/src/org/eclipse/cdt/debug/application/tests/Utilities.java
@@ -0,0 +1,200 @@
+/*******************************************************************************
+ * Copyright (c) 2015 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.cdt.debug.application.tests;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.file.Files;
+import java.nio.file.StandardCopyOption;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.eclipse.cdt.utils.pty.PTY;
+import org.eclipse.cdt.utils.spawner.ProcessFactory;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.debug.core.DebugPlugin;
+
+public class Utilities {
+
+ private static Utilities instance;
+
+ private Utilities() {
+ }
+
+ public static Utilities getDefault() {
+ if (instance == null)
+ instance = new Utilities();
+ return instance;
+ }
+
+ public IPath getProjectPath (String name) {
+ IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+ IPath rootLocation = root.getLocation();
+
+ IPath destProjectDirPath = rootLocation.append(name);
+
+ return destProjectDirPath;
+ }
+
+ public boolean buildProject (String name) {
+ File destProjectDir = getProjectPath(name).toFile();
+
+ String resourceDirPath = "/projects/" + name; //$NON-NLS-1$
+ try {
+ String path = FileLocator.toFileURL(
+ this.getClass().getResource(resourceDirPath)).getPath();
+
+ File projectDir = new Path(path).toFile();
+ copy(projectDir, destProjectDir);
+
+ Process process = execute(new String[]{"make","all","2>&1"}, null, destProjectDir, false);
+
+ boolean done = false;
+ while (!done) {
+ try {
+ process.exitValue();
+ done = true;
+ byte b[] = new byte[1000];
+ int numread = 0;
+ InputStream stream = process.getInputStream();
+ do {
+ numread = stream.read(b);
+ String x = new String(b);
+ System.out.print(x);
+ } while (numread >= 0);
+ } catch (IllegalThreadStateException e) {
+ try {
+ Thread.sleep(100);
+ } catch (InterruptedException e1) {
+ }
+ }
+ }
+ process.destroy();
+ process = execute(new String[]{"ls","-l"}, null, destProjectDir, false);
+
+ done = false;
+ while (!done) {
+ try {
+ process.exitValue();
+ done = true;
+ byte b[] = new byte[1000];
+ int numread = 0;
+ while (numread >= 0) {
+ numread = process.getInputStream().read(b);
+ String x = new String(b);
+ System.out.println(x);
+ }
+ } catch (IllegalThreadStateException e) {
+ try {
+ Thread.sleep(100);
+ } catch (InterruptedException e1) {
+ }
+ }
+ }
+ process.destroy();
+ } catch (IOException e) {
+ e.printStackTrace();
+ return false;
+ }
+
+ return true;
+ }
+
+ public boolean cleanProject (String name) {
+ IPath destProjectDirPath = getProjectPath(name);
+ File destProjectDir = destProjectDirPath.toFile();
+
+ try {
+
+ Process process = execute(new String[]{"make","clean"}, null, destProjectDir, false);
+
+ boolean done = false;
+ while (!done) {
+ try {
+ process.exitValue();
+ done = true;
+ byte b[] = new byte[1000];
+ process.getInputStream().read(b);
+ System.out.println(b);
+ } catch (IllegalThreadStateException e) {
+ try {
+ Thread.sleep(100);
+ } catch (InterruptedException e1) {
+ }
+ }
+ }
+ process.destroy();
+ } catch (IOException e) {
+ e.printStackTrace();
+ return false;
+ }
+
+ return true;
+ }
+
+ public static Process execute(String[] commandArray, String[] env, File wd, boolean usePty) throws IOException {
+ Process process = null;
+ if (env == null) {
+ Map<String, String> envMap = DebugPlugin.getDefault().getLaunchManager().getNativeEnvironment();
+ env = new String[envMap.size()];
+ int i = 0;
+ for (Entry<String, String> entry : envMap.entrySet()) {
+ env[i++] = entry.getKey() + "=" + entry.getValue();
+ }
+ }
+ try {
+ process = startProcess(commandArray, env, wd, false);
+ return process;
+ } catch (IOException e) {
+ throw e;
+ }
+ }
+
+ private static Process startProcess(String[] commandArray, String[] envp, File workDir, boolean usePty) throws IOException {
+ if (workDir == null) {
+ return ProcessFactory.getFactory().exec(commandArray, envp);
+ }
+ if (PTY.isSupported() && usePty) {
+ return ProcessFactory.getFactory().exec(commandArray, envp, workDir, new PTY());
+ } else {
+ return ProcessFactory.getFactory().exec(commandArray, envp, workDir);
+ }
+ }
+
+ public static void copy (File src, File dest)
+ throws IOException {
+
+ if (src.isDirectory()) {
+
+ // ensure destination directory exists
+ if (!dest.exists()){
+ dest.mkdir();
+ }
+
+ // copy all children files recursively
+ String files[] = src.list();
+
+ for (String file : files) {
+ File srcFile = new File(src, file);
+ File destFile = new File(dest, file);
+ copy(srcFile, destFile);
+ }
+
+ } else { // is a file, manually copy the contents over
+ Files.copy(src.toPath(), dest.toPath(), StandardCopyOption.REPLACE_EXISTING);
+ }
+ }
+}

Back to the top