llvm.org GIT mirror llvm / 2bea59b
Split executeShTest into two parts so that it can be better leveraged by libc++ git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224672 91177308-0d34-0410-b5e6-96231b3b80d8 Eric Fiselier 4 years ago
1 changed file(s) with 18 addition(s) and 13 deletion(s). Raw diff Collapse all Expand all
488488
489489 return script,tmpBase,execdir
490490
491 def executeShTest(test, litConfig, useExternalSh,
492 extra_substitutions=[]):
493 if test.config.unsupported:
494 return (Test.UNSUPPORTED, 'Test is unsupported')
495
496 res = parseIntegratedTestScript(test, useExternalSh, extra_substitutions)
497 if isinstance(res, lit.Test.Result):
498 return res
499 if litConfig.noExecute:
500 return lit.Test.Result(Test.PASS)
501
502 script, tmpBase, execdir = res
503
491 def _runShTest(test, litConfig, useExternalSh,
492 script, tmpBase, execdir):
504493 # Create the output directory if it does not already exist.
505494 lit.util.mkdir_p(os.path.dirname(tmpBase))
506495
528517 output += """Command Output (stderr):\n--\n%s\n--\n""" % (err,)
529518
530519 return lit.Test.Result(status, output)
520
521
522 def executeShTest(test, litConfig, useExternalSh,
523 extra_substitutions=[]):
524 if test.config.unsupported:
525 return (Test.UNSUPPORTED, 'Test is unsupported')
526
527 res = parseIntegratedTestScript(test, useExternalSh, extra_substitutions)
528 if isinstance(res, lit.Test.Result):
529 return res
530 if litConfig.noExecute:
531 return lit.Test.Result(Test.PASS)
532
533 script, tmpBase, execdir = res
534 return _runShTest(test, litConfig, useExternalSh, script, tmpBase, execdir)
535