[libcxx] r251529 - Adapt to lit change in llvm r251478-r251481

Matthias Braun via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 28 10:20:33 PDT 2015


Author: matze
Date: Wed Oct 28 12:20:33 2015
New Revision: 251529

URL: http://llvm.org/viewvc/llvm-project?rev=251529&view=rev
Log:
Adapt to lit change in llvm r251478-r251481

Sorry for the breakage.

Modified:
    libcxx/trunk/test/libcxx/test/format.py

Modified: libcxx/trunk/test/libcxx/test/format.py
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/test/format.py?rev=251529&r1=251528&r2=251529&view=diff
==============================================================================
--- libcxx/trunk/test/libcxx/test/format.py (original)
+++ libcxx/trunk/test/libcxx/test/format.py Wed Oct 28 12:20:33 2015
@@ -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'




More information about the cfe-commits mailing list