Skip to content

Commit 1060ea1

Browse files
committed
Add sourcekit-lsp requirement to test
We don't install sourcekit-lsp on Ubuntu 14.04, so disable the test when the binary is not present and print a note.
1 parent 838b37e commit 1060ea1

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

lit.cfg

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,6 @@ lit_config.note("testing using 'repl_swift': {}".format(repl_swift_dummy_path))
191191
sourcekit_lsp_path = lit_config.params.get(
192192
"sourcekit-lsp",
193193
os.path.join(package_path, "usr", "bin", "sourcekit-lsp"))
194-
lit_config.note("testing using 'sourcekit-lsp': {}".format(sourcekit_lsp_path))
195194

196195
# Verify they exist.
197196
if not os.path.exists(swift_path):
@@ -209,8 +208,11 @@ if not os.path.exists(repl_swift_dummy_path):
209208
if platform.system() == 'Linux':
210209
lit_config.fatal("repl_swift does not exist!")
211210

212-
if not os.path.exists(sourcekit_lsp_path):
213-
lit_config.fatal("sourcekit-lsp does not exist!")
211+
if os.path.exists(sourcekit_lsp_path):
212+
config.available_features.add("have-sourcekit-lsp")
213+
lit_config.note("testing using 'sourcekit-lsp': {}".format(sourcekit_lsp_path))
214+
else:
215+
lit_config.note("'sourcekit-lsp' unavailable, skipping related tests")
214216

215217
# Define our supported substitutions.
216218
config.substitutions.append( ('%{package_path}', package_path) )

test-sourcekit-lsp/test-sourcekit-lsp.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Canary test for sourcekit-lsp, covering interaction with swiftpm and toolchain
22
# language services.
33

4+
# REQUIRES: have-sourcekit-lsp
5+
46
# Make a sandbox dir.
57
# RUN: rm -rf %t.dir
68
# RUN: mkdir -p %t.dir

0 commit comments

Comments
 (0)