Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(923)

Unified Diff: utils/lit/lit/TestRunner.py

Issue 1624043: Win32 COFF Support + lit fixes Base URL: http://llvm.org/svn/llvm-project/llvm/trunk/
Patch Set: Created 13 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/lit.cfg ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/lit/lit/TestRunner.py
===================================================================
--- utils/lit/lit/TestRunner.py (revision 105819)
+++ utils/lit/lit/TestRunner.py (working copy)
@@ -19,6 +19,8 @@ kUseCloseFDs = platform.system() != 'Windows'
# Use temporary files to replace /dev/null on Windows.
kAvoidDevNull = platform.system() == 'Windows'
+kIsWindows = platform.system() == 'Windows'
+
def executeCommand(command, cwd=None, env=None):
p = subprocess.Popen(command, cwd=cwd,
stdin=subprocess.PIPE,
@@ -144,8 +146,14 @@ def executeShCmd(cmd, cfg, cwd, results):
args = list(j.args)
args[0] = Util.which(args[0], cfg.environment['PATH'])
if not args[0]:
- raise InternalShellError(j, '%r: command not found' % j.args[0])
-
+ # This may be a script, in which case on windows stuff is dumb and
+ # will not run it
+ if kIsWindows:
+ args[0] = 'cmd'
+ args.insert(1, '/c')
+ args.insert(2, j.args[0])
+ else:
+ raise InternalShellError(j, '%r: command not found' % j.args[0])
procs.append(subprocess.Popen(args, cwd=cwd,
stdin = stdin,
stdout = stdout,
@@ -375,18 +383,24 @@ def parseIntegratedTestScript(test):
#
# FIXME: This should not be here?
sourcepath = test.getSourcePath()
+ sourcedir = os.path.dirname(sourcepath)
execpath = test.getExecPath()
execdir,execbase = os.path.split(execpath)
tmpBase = os.path.join(execdir, 'Output', execbase)
if test.index is not None:
tmpBase += '_%d' % test.index
+ #Escape all \'s in paths so that Tcl tests work on Windows.
+ sourcepath = sourcepath.replace('\\', '/')
+ sourcedir = sourcedir.replace('\\', '/')
+ tmpBase = tmpBase.replace('\\', '/')
+
# We use #_MARKER_# to hide %% while we do the other substitutions.
substitutions = [('%%', '#_MARKER_#')]
substitutions.extend(test.config.substitutions)
substitutions.extend([('%s', sourcepath),
- ('%S', os.path.dirname(sourcepath)),
- ('%p', os.path.dirname(sourcepath)),
+ ('%S', sourcedir),
+ ('%p', sourcedir),
('%t', tmpBase + '.tmp'),
# FIXME: Remove this once we kill DejaGNU.
('%abs_tmp', tmpBase + '.tmp'),
« no previous file with comments | « test/lit.cfg ('k') | no next file » | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b