Skip to content

Commit a12a18e

Browse files
committed
Install swift-help for integration tests. Suppress .noDriver options from being emitted by swift-help.
Fixes: Driver/help.swift
1 parent 96cd66d commit a12a18e

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

Sources/SwiftOptions/OptionTable.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ extension OptionTable {
3737

3838
for option in options {
3939
if option.isAlias { continue }
40+
if option.attributes.contains(.noDriver) { continue }
4041
if option.isHelpHidden && !includeHidden { continue }
4142
guard option.isAccepted(by: driverKind) else { continue }
4243
guard let helpText = option.helpText else { continue }

Tests/SwiftDriverTests/IntegrationTests.swift

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,21 @@ func makeDriverSymlinks(
3434
try makeDirectories(tempBinDir)
3535

3636
let swift = tempBinDir.appending(component: "swift")
37-
try createSymlink(swift, pointingAt: driver, relative: false)
37+
try localFileSystem.createSymbolicLink(swift, pointingAt: driver, relative: false)
3838

3939
let swiftc = tempBinDir.appending(components: "swiftc")
40-
try createSymlink(swiftc, pointingAt: driver, relative: false)
40+
try localFileSystem.createSymbolicLink(swiftc, pointingAt: driver, relative: false)
41+
42+
let swiftHelp = binDir.appending(component: "swift-help")
43+
let swiftHelpSimlink = tempBinDir.appending(component: "swift-help")
44+
try localFileSystem.createSymbolicLink(swiftHelpSimlink, pointingAt: swiftHelp, relative: false)
4145

4246
// If we've been given a build dir, link in its lib folder so we can find its
4347
// resource directory.
4448
if let swiftBuildDir = swiftBuildDir {
4549
let libDir = swiftBuildDir.appending(component: "lib")
4650
let tempLibDir = tempDir.appending(component: "lib" )
47-
try createSymlink(tempLibDir, pointingAt: libDir, relative: false)
51+
try localFileSystem.createSymbolicLink(tempLibDir, pointingAt: libDir, relative: false)
4852
}
4953

5054
return (swift: swift, swiftc: swiftc)

0 commit comments

Comments
 (0)