llvm.org GIT mirror llvm / 215eafd
[lit] Actually do normalize the case of files in the config map. This has gone back and forth, but it seems this is necessary after all. realpath is not sufficient because if you have a file named 'C:\foo.txt', then both realpath('c:\foo.txt') and realpath(C:\foo.txt') return the string that was passed to them exactly as is, meaning the case of the drive-letter won't match. The problem before was not that we were normalizing the case of items going into the config map, but rather that we were normalizing the case of something we needed to print. The value that is used to key on the config map should never be printed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313918 91177308-0d34-0410-b5e6-96231b3b80d8 Zachary Turner 1 year, 10 months ago
4 changed file(s) with 6 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
5353 config_map = litConfig.params.get('config_map')
5454 if config_map:
5555 cfgpath = os.path.realpath(cfgpath)
56 cfgpath = os.path.normcase(cfgpath)
5657 target = config_map.get(cfgpath)
5758 if target:
5859 cfgpath = target
22 import sys
33
44 main_config = sys.argv[1]
5 main_config = os.path.realpath(main_config)
6 main_config = os.path.normcase(main_config)
57
6 config_map = {os.path.realpath(main_config) : sys.argv[2]}
8 config_map = {main_config : sys.argv[2]}
79 builtin_parameters = {'config_map' : config_map}
810
911 if __name__=='__main__':
4444
4545 # CHECK-CONFIG-MAP-ERR: loading suite config '{{.*}}lit.alt.cfg'
4646 # CHECK-CONFIG-MAP-ERR: loaded config '{{.*}}lit.alt.cfg'
47 # CHECK-CONFIG-MAP-ERR: resolved input '{{.*config-map-discovery[/\\]main-config}}' to 'config-map'::()
47 # CHECK-CONFIG-MAP-ERR: resolved input '{{.*(/|\\\\)config-map-discovery(/|\\\\)main-config}}' to 'config-map'::()
4848
4949
5050 # Check discovery when exact test names are given.
77 def map_config(source_dir, site_config):
88 global config_map
99 source_dir = os.path.realpath(source_dir)
10 source_dir = os.path.normcase(source_dir)
1011 site_config = os.path.normpath(site_config)
1112 config_map[source_dir] = site_config
1213