Skip to content

Commit 150423b

Browse files
committed
Fix test failures
1 parent 1d32512 commit 150423b

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

Sources/CompletionScoring/Utilities/SwiftExtensions.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,18 @@
1212

1313
import Foundation
1414

15+
#if canImport(Darwin)
16+
import Darwin
17+
#elseif canImport(Glibc)
18+
import Glibc
19+
#elseif canImport(Musl)
20+
import Musl
21+
#elseif canImport(CRT)
22+
import CRT
23+
#elseif canImport(Bionic)
24+
import Bionic
25+
#endif
26+
1527
extension Range where Bound: Numeric {
1628
init(from: Bound, length: Bound) {
1729
self = from..<(from + length)

Sources/ToolchainRegistry/Toolchain.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ func containingXCToolchain(
347347
var path = path
348348
while !path.isRoot {
349349
if path.pathExtension == "xctoolchain" {
350-
if let infoPlist = orLog("", { try XCToolchainPlist(fromDirectory: path) }) {
350+
if let infoPlist = orLog("Loading information from xctoolchain", { try XCToolchainPlist(fromDirectory: path) }) {
351351
return (infoPlist, path)
352352
}
353353
return nil

Utilities/build-script-helper.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,11 @@ def run_tests(swift_exec: str, args: argparse.Namespace) -> None:
216216
print('Cleaning ' + tests)
217217
shutil.rmtree(tests, ignore_errors=True)
218218

219+
# Build the plugin so it can be used by the tests. SwiftPM is not able to express a dependency from a test target on
220+
# a product.
221+
build_single_product('SwiftSourceKitPlugin', swift_exec, args)
222+
build_single_product('SwiftSourceKitClientPlugin', swift_exec, args)
223+
219224
cmd = [
220225
swift_exec, 'test',
221226
'--disable-testable-imports',
@@ -265,6 +270,8 @@ def handle_invocation(swift_exec: str, args: argparse.Namespace) -> None:
265270

266271
if args.action == 'build':
267272
build_single_product("sourcekit-lsp", swift_exec, args)
273+
build_single_product('SwiftSourceKitPlugin', swift_exec, args)
274+
build_single_product('SwiftSourceKitClientPlugin', swift_exec, args)
268275
elif args.action == 'test':
269276
run_tests(swift_exec, args)
270277
elif args.action == 'install':

0 commit comments

Comments
 (0)