Adapt to lit change in llvm r251478-r251481
Sorry for the breakage. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@251529 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
dd2fe4de1d
commit
1f98e313a1
@ -64,20 +64,24 @@ class LibcxxTestFormat(object):
|
|||||||
return (lit.Test.UNSUPPORTED,
|
return (lit.Test.UNSUPPORTED,
|
||||||
"A lit.local.cfg marked this unsupported")
|
"A lit.local.cfg marked this unsupported")
|
||||||
|
|
||||||
res = lit.TestRunner.parseIntegratedTestScript(
|
script = lit.TestRunner.parseIntegratedTestScript(
|
||||||
test, require_script=is_sh_test)
|
test, require_script=is_sh_test)
|
||||||
# Check if a result for the test was returned. If so return that
|
# Check if a result for the test was returned. If so return that
|
||||||
# result.
|
# result.
|
||||||
if isinstance(res, lit.Test.Result):
|
if isinstance(script, lit.Test.Result):
|
||||||
return res
|
return script
|
||||||
if lit_config.noExecute:
|
if lit_config.noExecute:
|
||||||
return lit.Test.Result(lit.Test.PASS)
|
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.
|
# Check that we don't have run lines on tests that don't support them.
|
||||||
if not is_sh_test and len(script) != 0:
|
if not is_sh_test and len(script) != 0:
|
||||||
lit_config.fatal('Unsupported RUN line found in test %s' % name)
|
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.
|
# Dispatch the test based on its suffix.
|
||||||
if is_sh_test:
|
if is_sh_test:
|
||||||
if not isinstance(self.executor, LocalExecutor):
|
if not isinstance(self.executor, LocalExecutor):
|
||||||
@ -86,11 +90,11 @@ class LibcxxTestFormat(object):
|
|||||||
return lit.Test.UNSUPPORTED, 'ShTest format not yet supported'
|
return lit.Test.UNSUPPORTED, 'ShTest format not yet supported'
|
||||||
return lit.TestRunner._runShTest(test, lit_config,
|
return lit.TestRunner._runShTest(test, lit_config,
|
||||||
self.execute_external, script,
|
self.execute_external, script,
|
||||||
tmpBase, execDir)
|
tmpBase)
|
||||||
elif is_fail_test:
|
elif is_fail_test:
|
||||||
return self._evaluate_fail_test(test)
|
return self._evaluate_fail_test(test)
|
||||||
elif is_pass_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:
|
else:
|
||||||
# No other test type is supported
|
# No other test type is supported
|
||||||
assert False
|
assert False
|
||||||
@ -98,7 +102,8 @@ class LibcxxTestFormat(object):
|
|||||||
def _clean(self, exec_path): # pylint: disable=no-self-use
|
def _clean(self, exec_path): # pylint: disable=no-self-use
|
||||||
libcxx.util.cleanFile(exec_path)
|
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()
|
source_path = test.getSourcePath()
|
||||||
exec_path = tmpBase + '.exe'
|
exec_path = tmpBase + '.exe'
|
||||||
object_path = tmpBase + '.o'
|
object_path = tmpBase + '.o'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user