Skip to content

Commit

Permalink
Add more build settings to test targets (#23)
Browse files Browse the repository at this point in the history
Motivation:

The test targets don't set the same Swift as the library targets.
There's no reason for them not to.

Modifications:

- Apply default settings to test targets.
- Fixup ACLs in test extensions

Result:

Test targets use Swift 6 language mode, explicit existential any, and
internal imports by default
  • Loading branch information
glbrntt authored Nov 6, 2024
1 parent f9cb377 commit 8caf000
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
6 changes: 4 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ let targets: [Target] = [
.product(name: "NIOCore", package: "swift-nio"),
.product(name: "NIOEmbedded", package: "swift-nio"),
.product(name: "NIOTestUtils", package: "swift-nio"),
]
],
swiftSettings: defaultSwiftSettings
),

// NIOPosix variant of the HTTP/2 transports.
Expand Down Expand Up @@ -139,7 +140,8 @@ let targets: [Target] = [
.target(name: "GRPCNIOTransportHTTP2"),
.product(name: "X509", package: "swift-certificates"),
.product(name: "NIOSSL", package: "swift-nio-ssl"),
]
],
swiftSettings: defaultSwiftSettings
),
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ extension ClientConnectionEvent: Equatable {}
extension ClientConnectionEvent.CloseReason: Equatable {}

extension Connection.Event {
package static func == (lhs: Connection.Event, rhs: Connection.Event) -> Bool {
static func == (lhs: Connection.Event, rhs: Connection.Event) -> Bool {
switch (lhs, rhs) {
case (.connectSucceeded, .connectSucceeded),
(.connectFailed, .connectFailed):
Expand All @@ -45,7 +45,7 @@ extension Connection.Event {
}

extension Connection.CloseReason {
package static func == (lhs: Connection.CloseReason, rhs: Connection.CloseReason) -> Bool {
static func == (lhs: Connection.CloseReason, rhs: Connection.CloseReason) -> Bool {
switch (lhs, rhs) {
case (.idleTimeout, .idleTimeout),
(.keepaliveTimeout, .keepaliveTimeout),
Expand All @@ -63,7 +63,7 @@ extension Connection.CloseReason {
}

extension ClientConnectionEvent {
package static func == (lhs: ClientConnectionEvent, rhs: ClientConnectionEvent) -> Bool {
static func == (lhs: ClientConnectionEvent, rhs: ClientConnectionEvent) -> Bool {
switch (lhs, rhs) {
case (.ready, .ready):
return true
Expand All @@ -76,7 +76,7 @@ extension ClientConnectionEvent {
}

extension ClientConnectionEvent.CloseReason {
package static func == (lhs: Self, rhs: Self) -> Bool {
static func == (lhs: Self, rhs: Self) -> Bool {
switch (lhs, rhs) {
case (.goAway(let lhsCode, let lhsMessage), .goAway(let rhsCode, let rhsMessage)):
return lhsCode == rhsCode && lhsMessage == rhsMessage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2837,7 +2837,7 @@ extension XCTestCase {
}

extension GRPCStreamStateMachine.OnNextOutboundFrame {
public static func == (
static func == (
lhs: GRPCStreamStateMachine.OnNextOutboundFrame,
rhs: GRPCStreamStateMachine.OnNextOutboundFrame
) -> Bool {
Expand Down

0 comments on commit 8caf000

Please sign in to comment.