Skip to content

ENUM

TestPlan ​

Contents

  • Cases
    • file(_:)
    • generated(_:)
  • Properties
    • name
    • path
    • testTargets
    • isDefault
    • isGenerated
  • Methods
    • init(path:testTargets:isDefault:)
    • init(_:)
    • init(stringLiteral:)
    • file(path:)
    • generated(name:directory:configurations:defaultOptions:testTargets:targetSelection:)
swift
public enum TestPlan: Hashable, Codable, ExpressibleByStringLiteral, ExpressibleByStringInterpolation

A test plan to run in a test action.

A test plan can reference an existing .xctestplan file on disk (file) or be declared declaratively and generated by Geko (generated).

Cases ​

file(_:) ​

swift
case file(FileTestPlan)

Reference an existing .xctestplan file on disk.

generated(_:) ​

swift
case generated(GeneratedTestPlan)

Describe a test plan that Geko generates during generation.

Properties ​

name ​

swift
public var name: String

The name of the test plan.

path ​

swift
public var path: FilePath

The path of the test plan.

testTargets ​

swift
public var testTargets: [TestableTarget]

The testable targets the test plan runs.

isDefault ​

swift
public var isDefault: Bool

Whether this is the default test plan.

isGenerated ​

swift
public var isGenerated: Bool

Whether this test plan is generated by Geko rather than referencing an existing file.

Methods ​

init(path:testTargets:isDefault:) ​

swift
public init(path: FilePath, testTargets: [TestableTarget], isDefault: Bool)

init(_:) ​

swift
public init(_ value: StringLiteralType)

init(stringLiteral:) ​

swift
public init(stringLiteral value: String)

Parameters ​

NameDescription
valueThe value of the new instance.

file(path:) ​

swift
public static func file(path: FilePath) -> Self

Creates a test plan that references an existing .xctestplan file on disk.

  • Parameters:
    • path: Path to the existing .xctestplan file.

Parameters ​

NameDescription
pathPath to the existing .xctestplan file.

generated(name:directory:configurations:defaultOptions:testTargets:targetSelection:) ​

swift
public static func generated(
    name: String,
    directory: FilePath? = nil,
    configurations: [GeneratedTestPlan.Configuration] = [],
    defaultOptions: GeneratedTestPlan.Options? = nil,
    testTargets: [GeneratedTestPlanTestableTarget] = [],
    targetSelection: [TestableTargetSelectionScope] = [],
) -> Self

Creates a test plan that Geko generates during generation.

  • Parameters:
    • name: Name of the generated test plan.
    • directory: Directory the test plan is written to. If nil, it's written to the derived directory.
    • configurations: Configurations of the generated test plan.
    • defaultOptions: Default options applied to the generated test plan.
    • testTargets: Explicit test targets to include in the generated test plan.
    • targetSelection: Scopes that resolve which test targets to include in the generated test plan.
    • missingTargetPolicy: Policy applied when a target referenced by the generated test plan is missing.

Parameters ​

NameDescription
nameName of the generated test plan.
directoryDirectory the test plan is written to. If nil, it’s written to the derived directory.
configurationsConfigurations of the generated test plan.
defaultOptionsDefault options applied to the generated test plan.
testTargetsExplicit test targets to include in the generated test plan.
targetSelectionScopes that resolve which test targets to include in the generated test plan.
missingTargetPolicyPolicy applied when a target referenced by the generated test plan is missing.