lit fixes for lld.
authorRafael Espindola <rafael.espindola@gmail.com>
Wed, 5 Aug 2015 19:55:17 +0000 (19:55 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Wed, 5 Aug 2015 19:55:17 +0000 (19:55 +0000)
It was not using LLVM_LIT_TOOLS_DIR and at least on my VM never finding lib.exe.

With this all the COFF tests show up as supported and pass.

llvm-svn: 244107

lld/test/lit.cfg

index c54c498..1116ed1 100644 (file)
@@ -14,6 +14,18 @@ import lit.util
 # name: The name of this test suite.
 config.name = 'lld'
 
+# Tweak PATH for Win32
+if sys.platform in ['win32']:
+    # Seek sane tools in directories and set to $PATH.
+    path = getattr(config, 'lit_tools_dir', None)
+    path = lit_config.getToolsPath(path,
+                                   config.environment['PATH'],
+                                   ['cmp.exe', 'grep.exe', 'sed.exe'])
+    if path is not None:
+        path = os.path.pathsep.join((path,
+                                     config.environment['PATH']))
+        config.environment['PATH'] = path
+
 # Choose between lit's internal shell pipeline runner and a real shell.  If
 # LIT_USE_INTERNAL_SHELL is in the environment, we use that as an override.
 use_lit_shell = os.environ.get("LIT_USE_INTERNAL_SHELL")
@@ -178,5 +190,5 @@ if cvtres and rc:
     config.available_features.add('winres')
 
 # Check if "lib.exe" command exists.
-if lit.util.which('lib.exe', config.environment['PATH']):
+if lit.util.which('lib', config.environment['PATH']):
     config.available_features.add('winlib')