Adapt to lit change in llvm r251478-r251481

Sorry for the breakage.

llvm-svn: 251529
This commit is contained in:
Matthias Braun 2015-10-28 17:20:33 +00:00
parent 5b4296af77
commit cb668426c1
1 changed files with 13 additions and 8 deletions

View File

@ -64,20 +64,24 @@ class LibcxxTestFormat(object):
return (lit.Test.UNSUPPORTED,
"A lit.local.cfg marked this unsupported")
res = lit.TestRunner.parseIntegratedTestScript(
script = lit.TestRunner.parseIntegratedTestScript(
test, require_script=is_sh_test)
# Check if a result for the test was returned. If so return that
# result.
if isinstance(res, lit.Test.Result):
return res
if isinstance(script, lit.Test.Result):
return script
if lit_config.noExecute:
return lit.Test.Result(lit.Test.PASS)
# res is not an instance of lit.test.Result. Expand res into its parts.
script, tmpBase, execDir = res
# Check that we don't have run lines on tests that don't support them.
if not is_sh_test and len(script) != 0:
lit_config.fatal('Unsupported RUN line found in test %s' % name)
tmpDir, tmpBase = lit.TestRunner.getTempPaths(test)
substitutions = lit.TestRunner.getDefaultSubstitutions(test, tmpDir,
tmpBase)
script = lit.TestRunner.applySubstitutions(script, substitutions)
# Dispatch the test based on its suffix.
if is_sh_test:
if not isinstance(self.executor, LocalExecutor):
@ -86,11 +90,11 @@ class LibcxxTestFormat(object):
return lit.Test.UNSUPPORTED, 'ShTest format not yet supported'
return lit.TestRunner._runShTest(test, lit_config,
self.execute_external, script,
tmpBase, execDir)
tmpBase)
elif is_fail_test:
return self._evaluate_fail_test(test)
elif is_pass_test:
return self._evaluate_pass_test(test, tmpBase, execDir, lit_config)
return self._evaluate_pass_test(test, tmpBase, lit_config)
else:
# No other test type is supported
assert False
@ -98,7 +102,8 @@ class LibcxxTestFormat(object):
def _clean(self, exec_path): # pylint: disable=no-self-use
libcxx.util.cleanFile(exec_path)
def _evaluate_pass_test(self, test, tmpBase, execDir, lit_config):
def _evaluate_pass_test(self, test, tmpBase, lit_config):
execDir = os.path.dirname(test.getExecPath())
source_path = test.getSourcePath()
exec_path = tmpBase + '.exe'
object_path = tmpBase + '.o'