Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion Sources/Commands/PackageCommands/Init.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,22 @@ extension SwiftPackageCommand {
}

let packageName = self.packageName ?? cwd.basename

// Which testing libraries should be used? XCTest is on by default,
// but Swift Testing must remain off by default until it is present
// in the Swift toolchain.
var supportedTestingLibraries = Set<BuildParameters.Testing.Library>()
if testLibraryOptions.isEnabled(.xctest) {
supportedTestingLibraries.insert(.xctest)
}
if testLibraryOptions.explicitlyEnableSwiftTestingLibrarySupport == true || testLibraryOptions.explicitlyEnableExperimentalSwiftTestingLibrarySupport == true {
supportedTestingLibraries.insert(.swiftTesting)
}

let initPackage = try InitPackage(
name: packageName,
packageType: initMode,
supportedTestingLibraries: Set(testLibraryOptions.enabledTestingLibraries),
supportedTestingLibraries: supportedTestingLibraries,
destinationPath: cwd,
installedSwiftPMConfiguration: swiftCommandState.getHostToolchain().installedSwiftPMConfiguration,
fileSystem: swiftCommandState.fileSystem
Expand Down