Files
XcodeGen/Sources/ProjectSpec/TestPlan.swift
T
Yonas Kolb e35f7df14d Add Test Plans (#716)
* upgrade scheme and project versions

* parse test plans

* remove xctestplan from resources

* generate test plan references in schemes

* add test plan to fixture

* non-mutable way of creating [XCScheme.TestPlanReference]

* update fixture version

* Add documentation

* Add default test plan option

# Conflicts:
#	Sources/ProjectSpec/Scheme.swift
#	Tests/Fixtures/paths_test/included_paths_test.yml
#	Tests/ProjectSpecTests/SpecLoadingTests.swift

* Add test plan validation

# Conflicts:
#	Tests/ProjectSpecTests/ProjectSpecTests.swift

* Check for multiple default test plans

* set first plan as default default plan

* small tweaks

* fix test plan path properties

* add test plants to target scheme

* docs

* fix fixture test plan path

* update changelog

* added ability to disable test plan path validation

Co-authored-by: Ota Mares <ota@rebuy.com>
2022-05-10 13:27:31 +10:00

40 lines
829 B
Swift

import Foundation
import JSONUtilities
public struct TestPlan: Equatable {
public var path: String
public var defaultPlan: Bool
public init(path: String, defaultPlan: Bool = false) {
self.defaultPlan = defaultPlan
self.path = path
}
}
extension TestPlan: JSONObjectConvertible {
public init(jsonDictionary: JSONDictionary) throws {
path = try jsonDictionary.json(atKeyPath: "path")
defaultPlan = jsonDictionary.json(atKeyPath: "defaultPlan") ?? false
}
}
extension TestPlan: JSONEncodable {
public func toJSONValue() -> Any {
[
"path": path,
"defaultPlan": defaultPlan,
]
}
}
extension TestPlan: PathContainer {
static var pathProperties: [PathProperty] {
[
.string("path"),
]
}
}