Skip to content

Commit 3e40809

Browse files
committed
Rather than specifying FileCheck, just specify a path to an llvm-build-dir.
This will allow other tools from llvm to be used to test the snapshot beyond FileCheck itself. rdar://39456714
1 parent 01eecd5 commit 3e40809

File tree

1 file changed

+9
-14
lines changed

1 file changed

+9
-14
lines changed

lit.cfg

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -130,20 +130,15 @@ if package_path is None:
130130
package_path = os.path.abspath(package_path)
131131
lit_config.note("testing package: %r" % (package_path,))
132132

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')
147142

148143
# Use the default Swift src layout if swiftpm is not provided as a
149144
# param

0 commit comments

Comments
 (0)