llvm.org GIT mirror llvm / 9869c2f
utils/lit/lit/TestRunner.py: bash is available with MSYS on Python/W32. Then we can execute "bash tests". git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127074 91177308-0d34-0410-b5e6-96231b3b80d8 NAKAMURA Takumi 8 years ago
1 changed file(s) with 10 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
336336 return out, err, exitCode
337337
338338 def executeScript(test, litConfig, tmpBase, commands, cwd):
339 bashPath = litConfig.getBashPath();
340 isWin32CMDEXE = (litConfig.isWindows and not bashPath)
339341 script = tmpBase + '.script'
340 if litConfig.isWindows:
342 if isWin32CMDEXE:
341343 script += '.bat'
342344
343345 # Write script file
344346 f = open(script,'w')
345 if litConfig.isWindows:
347 if isWin32CMDEXE:
346348 f.write('\nif %ERRORLEVEL% NEQ 0 EXIT\n'.join(commands))
347349 else:
348350 f.write(' &&\n'.join(commands))
349351 f.write('\n')
350352 f.close()
351353
352 if litConfig.isWindows:
354 if isWin32CMDEXE:
353355 command = ['cmd','/c', script]
354356 else:
355 command = ['/bin/sh', script]
357 if bashPath:
358 command = [bashPath, script]
359 else:
360 command = ['/bin/sh', script]
356361 if litConfig.useValgrind:
357362 # FIXME: Running valgrind on sh is overkill. We probably could just
358363 # run on clang with no real loss.
552557 if test.config.unsupported:
553558 return (Test.UNSUPPORTED, 'Test is unsupported')
554559
555 res = parseIntegratedTestScript(test)
560 res = parseIntegratedTestScript(test, useExternalSh)
556561 if len(res) == 2:
557562 return res
558563