Skip to content

Commit

Permalink
address lint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
kelvinharron committed Nov 28, 2024
1 parent 3f1991e commit 411947a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
12 changes: 6 additions & 6 deletions Sources/XcodeProj/Scheme/XCScheme+TestParallelization.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import Foundation

public extension XCScheme {
/// With the introduction of Swift Testing and Xcode 16, you can now choose to run your tests in parallel across either the full suite of tests in a target with `.all`, just those created under Swift Testing with `.swiftTestingOnly`, or run them serially with the `.none` option.
enum TestParallelization: String {
case all
case swiftTestingOnly
case none
}
/// With the introduction of Swift Testing and Xcode 16, you can now choose to run your tests in parallel across either the full suite of tests in a target with `.all`, just those created under Swift Testing with `.swiftTestingOnly`, or run them serially with the `.none` option.
enum TestParallelization: String {
case all
case swiftTestingOnly
case none
}
}
5 changes: 3 additions & 2 deletions Sources/XcodeProj/Scheme/XCScheme+TestableReference.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public extension XCScheme {
get { parallelization == .swiftTestingOnly }
set { parallelization = newValue ? .swiftTestingOnly : .none }
}

public var parallelization: TestParallelization
public var randomExecutionOrdering: Bool
public var useTestSelectionWhitelist: Bool?
Expand Down Expand Up @@ -60,7 +61,7 @@ public extension XCScheme {

init(element: AEXMLElement) throws {
skipped = element.attributes["skipped"] == "YES"

if let parallelizableValue = element.attributes["parallelizable"] {
parallelization = parallelizableValue == "YES" ? .all : .none
} else {
Expand Down Expand Up @@ -93,7 +94,7 @@ public extension XCScheme {

func xmlElement() -> AEXMLElement {
var attributes: [String: String] = ["skipped": skipped.xmlString]

switch parallelization {
case .all:
attributes["parallelizable"] = "YES"
Expand Down
6 changes: 3 additions & 3 deletions Tests/XcodeProjTests/Scheme/XCSchemeTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ final class XCSchemeIntegrationTests: XCTestCase {
XCTAssertEqual(subject.attributes["useTestSelectionWhitelist"], "YES")
XCTAssertEqual(subject.attributes["testExecutionOrdering"], "random")
}

func test_computed_parallelizable_testableReference_false() {
let reference = XCScheme.TestableReference(
skipped: false,
Expand All @@ -192,7 +192,7 @@ final class XCSchemeIntegrationTests: XCTestCase {
XCTAssertEqual(reference.parallelizable, false)
XCTAssertEqual(reference.parallelization, .none)
}

func test_computed_parallelizable_testableReference_true() {
let reference = XCScheme.TestableReference(
skipped: false,
Expand All @@ -212,7 +212,7 @@ final class XCSchemeIntegrationTests: XCTestCase {
XCTAssertEqual(reference.parallelizable, true)
XCTAssertEqual(reference.parallelization, .swiftTestingOnly)
}

func test_write_testableReferenceSelectedTests() {
// Given
let reference = XCScheme.TestableReference(
Expand Down

0 comments on commit 411947a

Please sign in to comment.