ENUM
TestPlan
Contents
- Cases
file(_:)generated(_:)
- Properties
namepathtestTargetsisDefaultisGenerated
- Methods
init(path:testTargets:isDefault:)init(_:)init(stringLiteral:)file(path:)generated(name:directory:configurations:defaultOptions:testTargets:targetSelection:)
swift
public enum TestPlan: Hashable, Codable, ExpressibleByStringLiteral, ExpressibleByStringInterpolationA 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: StringThe name of the test plan.
path
swift
public var path: FilePathThe path of the test plan.
testTargets
swift
public var testTargets: [TestableTarget]The testable targets the test plan runs.
isDefault
swift
public var isDefault: BoolWhether this is the default test plan.
isGenerated
swift
public var isGenerated: BoolWhether 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
| Name | Description |
|---|---|
| value | The value of the new instance. |
file(path:)
swift
public static func file(path: FilePath) -> SelfCreates a test plan that references an existing .xctestplan file on disk.
- Parameters:
- path: Path to the existing
.xctestplanfile.
- path: Path to the existing
Parameters
| Name | Description |
|---|---|
| path | Path 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] = [],
) -> SelfCreates 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
| Name | Description |
|---|---|
| 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. |
