@@ -130,20 +130,15 @@ if package_path is None:
130
130
package_path = os .path .abspath (package_path )
131
131
lit_config .note ("testing package: %r" % (package_path ,))
132
132
133
- # Find the path to FileCheck. We just pick any one out of the build directory.
134
- swift_build_path = os .path .join (srcroot , ".." , "build" )
135
- filecheck_path = lit_config .params .get ("filecheck" )
136
- if filecheck_path is None :
137
- for variant in os .listdir (swift_build_path ):
138
- variant_path = os .path .join (swift_build_path , variant )
139
- for tree in os .listdir (variant_path ):
140
- if tree .startswith ("llvm-" ):
141
- path = os .path .join (variant_path , tree , "bin" , "FileCheck" )
142
- if os .path .exists (path ):
143
- filecheck_path = path
144
- break
145
- if filecheck_path is None :
146
- lit_config .fatal ("unable to locate FileCheck, '--param filecheck=PATH' is required" )
133
+ # Get the path to the llvm binary dir. We use tools from this
134
+ # directory (including FileCheck) to test our snapshots. In terms of
135
+ # the actual swift build directory, this is not ./, but ./bin. This is
136
+ # to potentially allow for an installed llvm binary installation to be
137
+ # used when testing.
138
+ llvm_bin_dir = lit_config .params .get ("llvm-bin-dir" )
139
+ if llvm_bin_dir is None :
140
+ lit_config .fatal ("'--param llvm_bin_dir=PATH' is required" )
141
+ filecheck_path = os .path .join (llvm_bin_dir , 'FileCheck' )
147
142
148
143
# Use the default Swift src layout if swiftpm is not provided as a
149
144
# param
0 commit comments