Index: utils/lit/lit/TestRunner.py |
=================================================================== |
--- utils/lit/lit/TestRunner.py (revision 105792) |
+++ 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,15 @@ 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]) |
+ print args |
Bigcheesegs
2010/06/11 23:14:04
Oops, this print shouldn't be here. I was using it
|
+ else: |
+ raise InternalShellError(j, '%r: command not found' % j.args[0]) |
procs.append(subprocess.Popen(args, cwd=cwd, |
stdin = stdin, |
stdout = stdout, |
@@ -375,18 +384,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'), |