diff options
author | Zachary Turner <zturner@google.com> | 2017-09-21 21:27:11 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2017-09-21 21:27:11 +0000 |
commit | 215eafd2d92ff0fcffe87cb3264242cbce0293b3 (patch) | |
tree | 9911bee1a2ce14200296534c25e5bee436ab37ea /utils/lit | |
parent | 7946cf61b738bcad220710feb6208912e6a105e6 (diff) |
[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
Diffstat (limited to 'utils/lit')
-rw-r--r-- | utils/lit/lit/discovery.py | 1 | ||||
-rw-r--r-- | utils/lit/tests/Inputs/config-map-discovery/driver.py | 4 | ||||
-rw-r--r-- | utils/lit/tests/discovery.py | 2 |
3 files changed, 5 insertions, 2 deletions
diff --git a/utils/lit/lit/discovery.py b/utils/lit/lit/discovery.py index aba7453e9d4..398b6cecd5a 100644 --- a/utils/lit/lit/discovery.py +++ b/utils/lit/lit/discovery.py @@ -54,6 +54,7 @@ def getTestSuite(item, litConfig, cache): config_map = litConfig.params.get('config_map') if config_map: cfgpath = os.path.realpath(cfgpath) + cfgpath = os.path.normcase(cfgpath) target = config_map.get(cfgpath) if target: cfgpath = target diff --git a/utils/lit/tests/Inputs/config-map-discovery/driver.py b/utils/lit/tests/Inputs/config-map-discovery/driver.py index b5344e8fb83..db9141b9b1b 100644 --- a/utils/lit/tests/Inputs/config-map-discovery/driver.py +++ b/utils/lit/tests/Inputs/config-map-discovery/driver.py @@ -3,8 +3,10 @@ import os import sys main_config = sys.argv[1] +main_config = os.path.realpath(main_config) +main_config = os.path.normcase(main_config) -config_map = {os.path.realpath(main_config) : sys.argv[2]} +config_map = {main_config : sys.argv[2]} builtin_parameters = {'config_map' : config_map} if __name__=='__main__': diff --git a/utils/lit/tests/discovery.py b/utils/lit/tests/discovery.py index c6b705c6293..dbabeb39f19 100644 --- a/utils/lit/tests/discovery.py +++ b/utils/lit/tests/discovery.py @@ -45,7 +45,7 @@ # CHECK-CONFIG-MAP-ERR: loading suite config '{{.*}}lit.alt.cfg' # CHECK-CONFIG-MAP-ERR: loaded config '{{.*}}lit.alt.cfg' -# CHECK-CONFIG-MAP-ERR: resolved input '{{.*config-map-discovery[/\\]main-config}}' to 'config-map'::() +# CHECK-CONFIG-MAP-ERR: resolved input '{{.*(/|\\\\)config-map-discovery(/|\\\\)main-config}}' to 'config-map'::() # Check discovery when exact test names are given. |