[PATCH] D65674: [lit] Fix 42812: lit test suite can no longer be run stand-alone

Stella Stamenova via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 2 15:02:23 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL367730: [lit] Fix 42812: lit test suite can no longer be run stand-alone (authored by stella.stamenova, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D65674?vs=213118&id=213136#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65674/new/

https://reviews.llvm.org/D65674

Files:
  llvm/trunk/utils/lit/tests/lit.cfg


Index: llvm/trunk/utils/lit/tests/lit.cfg
===================================================================
--- llvm/trunk/utils/lit/tests/lit.cfg
+++ llvm/trunk/utils/lit/tests/lit.cfg
@@ -36,9 +36,13 @@
   lit_path = os.path.join(config.test_source_root, '..')
 
 # Required because some tests import the lit module
-llvm_config.with_environment('PYTHONPATH', lit_path, append_path=True)
+if llvm_config:
+  llvm_config.with_environment('PYTHONPATH', lit_path, append_path=True)
+else:
+  config.environment['PYTHONPATH'] = os.pathsep.join([lit_path])
 
 # Add llvm and lit tools directories if this config is being loaded indirectly.
+# In this case, we can also expect llvm_config to have been imported correctly.
 for attribute in ('llvm_tools_dir', 'lit_tools_dir'):
     directory = getattr(config, attribute, None)
     if directory:
@@ -64,3 +68,10 @@
     lit_config.warning('Setting a timeout per test not supported. ' + errormsg
                        + ' Some tests will be skipped and the --timeout'
                          ' command line argument will not work.')
+
+# When running the lit tests standalone, we want to define the same features
+# that the llvm_config defines. This means that the 'system-windows' feature
+# (and any others) need to match the names in llvm_config for consistency
+if not llvm_config:
+  if sys.platform.startswith('win') or sys.platform.startswith('cygwin'):
+    config.available_features.add('system-windows')


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65674.213136.patch
Type: text/x-patch
Size: 1466 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190802/c72161d0/attachment.bin>


More information about the llvm-commits mailing list