llvm.org GIT mirror llvm / 10c3812
[lit] Fix 42812: lit test suite can no longer be run stand-alone Summary: This change updates the lit.cfg file to use llvm_config when it is available, but when it is not, it directly modifies the config object. This makes it possible to run the lit tests standalone without having built llvm (as long as the correct binaries are present in the path such as FileCheck and not). Because the lit tests don't take a hard dependency on llvm_config, some features such as system-windows have to have definitions in lit's cfg file as well. This is a potential issue as the os features sometimes change names (for example, we went from windows to system-windows, etc.). This can cause drift between lit's tests and the rest of the llvm tests. Reviewers: probinson, mgorny Reviewed By: mgorny Subscribers: delcypher, llvm-commits, asmith Tags: #llvm Differential Revision: https://reviews.llvm.org/D65674 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@367730 91177308-0d34-0410-b5e6-96231b3b80d8 Stella Stamenova a month ago
1 changed file(s) with 12 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
3535 lit_path = os.path.join(config.test_source_root, '..')
3636
3737 # Required because some tests import the lit module
38 llvm_config.with_environment('PYTHONPATH', lit_path, append_path=True)
38 if llvm_config:
39 llvm_config.with_environment('PYTHONPATH', lit_path, append_path=True)
40 else:
41 config.environment['PYTHONPATH'] = os.pathsep.join([lit_path])
3942
4043 # Add llvm and lit tools directories if this config is being loaded indirectly.
44 # In this case, we can also expect llvm_config to have been imported correctly.
4145 for attribute in ('llvm_tools_dir', 'lit_tools_dir'):
4246 directory = getattr(config, attribute, None)
4347 if directory:
6367 lit_config.warning('Setting a timeout per test not supported. ' + errormsg
6468 + ' Some tests will be skipped and the --timeout'
6569 ' command line argument will not work.')
70
71 # When running the lit tests standalone, we want to define the same features
72 # that the llvm_config defines. This means that the 'system-windows' feature
73 # (and any others) need to match the names in llvm_config for consistency
74 if not llvm_config:
75 if sys.platform.startswith('win') or sys.platform.startswith('cygwin'):
76 config.available_features.add('system-windows')