Standard Gaudi test.
Definition at line 990 of file GaudiTest.py.
| def GaudiTest.GaudiExeTest._CreateEclipseLaunch |
( |
|
self, |
|
|
|
prog, |
|
|
|
args, |
|
|
|
destdir = None |
|
) |
| |
|
private |
Definition at line 1583 of file GaudiTest.py.
1587 projbasedir = os.path.normpath(destdir)
1588 while not os.path.exists(os.path.join(projbasedir,
".project")):
1589 oldprojdir = projbasedir
1590 projbasedir = os.path.normpath(os.path.join(projbasedir, os.pardir))
1593 if oldprojdir == projbasedir:
1597 if not os.path.exists(destdir):
1598 os.makedirs(destdir)
1600 from xml.etree
import ElementTree
as ET
1601 t = ET.parse(os.path.join(projbasedir,
".project"))
1602 projectName = t.find(
"name").text
1605 destfile =
"%s.launch" % self._Runnable__id
1607 destfile = os.path.join(destdir, destfile)
1609 if self.options.strip():
1613 tempfile = args.pop()
1614 optsfile = destfile + os.path.splitext(tempfile)[1]
1615 shutil.copyfile(tempfile, optsfile)
1616 args.append(optsfile)
1619 from xml.sax.saxutils
import quoteattr
1623 data[
"environment"] =
"\n".join([
'<mapEntry key=%s value=%s/>' % (quoteattr(k), quoteattr(v))
1624 for k, v
in os.environ.iteritems()])
1626 data[
"exec"] =
which(prog)
or prog
1627 if os.path.basename(data[
"exec"]).lower().startswith(
"python"):
1628 data[
"stopAtMain"] =
"false"
1630 data[
"stopAtMain"] =
"true"
1632 data[
"args"] =
" ".join(map(rationalizepath, args))
1634 data[
"args"] =
" ".join([
"/debugexe"] + map(rationalizepath, [data[
"exec"]] + args))
1635 data[
"exec"] =
which(
"vcexpress.exe")
1638 data[
"workdir"] = os.getcwd()
1642 data[
"workdir"] = destdir
1644 data[
"project"] = projectName.strip()
1647 xml =
"""<?xml version="1.0" encoding="UTF-8" standalone="no"?>
1648 <launchConfiguration type="org.eclipse.cdt.launch.applicationLaunchType">
1649 <booleanAttribute key="org.eclipse.cdt.debug.mi.core.AUTO_SOLIB" value="true"/>
1650 <listAttribute key="org.eclipse.cdt.debug.mi.core.AUTO_SOLIB_LIST"/>
1651 <stringAttribute key="org.eclipse.cdt.debug.mi.core.DEBUG_NAME" value="gdb"/>
1652 <stringAttribute key="org.eclipse.cdt.debug.mi.core.GDB_INIT" value=".gdbinit"/>
1653 <listAttribute key="org.eclipse.cdt.debug.mi.core.SOLIB_PATH"/>
1654 <booleanAttribute key="org.eclipse.cdt.debug.mi.core.STOP_ON_SOLIB_EVENTS" value="false"/>
1655 <booleanAttribute key="org.eclipse.cdt.debug.mi.core.breakpointsFullPath" value="false"/>
1656 <stringAttribute key="org.eclipse.cdt.debug.mi.core.commandFactory" value="org.eclipse.cdt.debug.mi.core.standardCommandFactory"/>
1657 <stringAttribute key="org.eclipse.cdt.debug.mi.core.protocol" value="mi"/>
1658 <booleanAttribute key="org.eclipse.cdt.debug.mi.core.verboseMode" value="false"/>
1659 <intAttribute key="org.eclipse.cdt.launch.ATTR_BUILD_BEFORE_LAUNCH_ATTR" value="0"/>
1660 <stringAttribute key="org.eclipse.cdt.launch.COREFILE_PATH" value=""/>
1661 <stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_ID" value="org.eclipse.cdt.debug.mi.core.CDebuggerNew"/>
1662 <stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_REGISTER_GROUPS" value=""/>
1663 <stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_START_MODE" value="run"/>
1664 <booleanAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN" value="%(stopAtMain)s"/>
1665 <stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN_SYMBOL" value="main"/>
1666 <booleanAttribute key="org.eclipse.cdt.launch.ENABLE_REGISTER_BOOKKEEPING" value="false"/>
1667 <booleanAttribute key="org.eclipse.cdt.launch.ENABLE_VARIABLE_BOOKKEEPING" value="false"/>
1668 <stringAttribute key="org.eclipse.cdt.launch.FORMAT" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?><contentList/>"/>
1669 <stringAttribute key="org.eclipse.cdt.launch.GLOBAL_VARIABLES" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <globalVariableList/> "/>
1670 <stringAttribute key="org.eclipse.cdt.launch.MEMORY_BLOCKS" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <memoryBlockExpressionList/> "/>
1671 <stringAttribute key="org.eclipse.cdt.launch.PROGRAM_ARGUMENTS" value="%(args)s"/>
1672 <stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="%(exec)s"/>
1673 <stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="%(project)s"/>
1674 <stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value=""/>
1675 <stringAttribute key="org.eclipse.cdt.launch.WORKING_DIRECTORY" value="%(workdir)s"/>
1676 <booleanAttribute key="org.eclipse.cdt.launch.ui.ApplicationCDebuggerTab.DEFAULTS_SET" value="true"/>
1677 <booleanAttribute key="org.eclipse.cdt.launch.use_terminal" value="true"/>
1678 <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
1679 <listEntry value="/%(project)s"/>
1681 <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
1682 <listEntry value="4"/>
1684 <booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="false"/>
1685 <mapAttribute key="org.eclipse.debug.core.environmentVariables">
1688 <mapAttribute key="org.eclipse.debug.core.preferred_launchers">
1689 <mapEntry key="[debug]" value="org.eclipse.cdt.cdi.launch.localCLaunch"/>
1691 <listAttribute key="org.eclipse.debug.ui.favoriteGroups">
1692 <listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
1694 </launchConfiguration>
1698 open(destfile,
"w").write(xml)
try: