Skip to content

Commit

Permalink
Add missing region parameter in static helper RunActionOptions.`o…
Browse files Browse the repository at this point in the history
…ptions` (#5954)

* Add missing parameter in static helper

* Fix compilation error

* Add docs

* Refactoring
  • Loading branch information
mihaicris-adoreme committed Feb 20, 2024
1 parent 0e2e39f commit f492a86
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
6 changes: 5 additions & 1 deletion Sources/ProjectDescription/RunActionOptions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ public struct RunActionOptions: Equatable, Codable {
/// Creates an `RunActionOptions` instance
///
/// - Parameters:
/// - language: language (e.g. "pl").
/// - language: language (e.g. "en").
///
/// - region: region (e.g. "US").
///
/// - storeKitConfigurationPath: The path of the
/// [StoreKit configuration
Expand All @@ -70,12 +72,14 @@ public struct RunActionOptions: Equatable, Codable {

public static func options(
language: SchemeLanguage? = nil,
region: String? = nil,
storeKitConfigurationPath: Path? = nil,
simulatedLocation: SimulatedLocation? = nil,
enableGPUFrameCaptureMode: GPUFrameCaptureMode = GPUFrameCaptureMode.default
) -> Self {
self.init(
language: language,
region: region,
storeKitConfigurationPath: storeKitConfigurationPath,
simulatedLocation: simulatedLocation,
enableGPUFrameCaptureMode: enableGPUFrameCaptureMode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,14 @@ extension RunAction {
public static func test(
configuration: ConfigurationName = .debug,
executable: TargetReference? = nil,
arguments: Arguments? = nil
arguments: Arguments? = nil,
options: RunActionOptions = .options()
) -> RunAction {
RunAction(
configuration: configuration,
executable: executable,
arguments: arguments
arguments: arguments,
options: options
)
}
}
Expand Down
16 changes: 16 additions & 0 deletions Tests/ProjectDescriptionTests/SchemeTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ final class SchemeTests: XCTestCase {
arguments: Arguments(
environmentVariables: ["run": "b"],
launchArguments: [LaunchArgument(name: "run", isEnabled: true)]
),
options: RunActionOptions(
language: "en",
region: "US",
storeKitConfigurationPath: nil,
simulatedLocation: nil,
enableGPUFrameCaptureMode: .autoEnabled
)
)
)
Expand Down Expand Up @@ -80,13 +87,22 @@ final class SchemeTests: XCTestCase {
arguments: Arguments(
environmentVariables: ["run": "b"],
launchArguments: [LaunchArgument(name: "run", isEnabled: true)]
),
options: RunActionOptions(
language: "en",
region: "US",
storeKitConfigurationPath: nil,
simulatedLocation: nil,
enableGPUFrameCaptureMode: .autoEnabled
)
)
)

// Then
XCTAssertEqual(subject.runAction?.configuration.rawValue, "Release")
XCTAssertEqual(subject.testAction?.configuration.rawValue, "Debug")
XCTAssertEqual(subject.runAction?.options.language, "en")
XCTAssertEqual(subject.runAction?.options.region, "US")
}

// MARK: - Helpers
Expand Down

0 comments on commit f492a86

Please sign in to comment.