mirror of
https://github.com/apple/swift-nio
synced 2026-11-29 05:24:21 +00:00
Building swift-nio with Swift 5.7 for iOS using Xcode 14.0 at 2.48.0. (#2369)
Motivation: swift- nio was failing builds that should pass Modifications: Adding available to the necessary sections
This commit is contained in:
1 parent
734a0ba103
commit
5db1dfabb0
14 files changed
+28
-3
No files matched your search
@@ -12,6 +12,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if !os(iOS) && !os(tvOS) && !os(watchOS)
|
||||
let crashTestSuites: [String: Any] = [
|
||||
"EventLoopCrashTests": EventLoopCrashTests(),
|
||||
"ByteBufferCrashTests": ByteBufferCrashTests(),
|
||||
@@ -19,3 +20,4 @@ let crashTestSuites: [String: Any] = [
|
||||
"HTTPCrashTests": HTTPCrashTests(),
|
||||
"StrictCrashTests": StrictCrashTests(),
|
||||
]
|
||||
#endif
|
||||
@@ -15,6 +15,7 @@
|
||||
import NIOCore
|
||||
|
||||
struct ByteBufferCrashTests {
|
||||
#if !os(iOS) && !os(tvOS) && !os(watchOS)
|
||||
let testMovingReaderIndexPastWriterIndex = CrashTest(
|
||||
regex: #"Precondition failed: new readerIndex: 1, expected: range\(0, 0\)"#
|
||||
) {
|
||||
@@ -27,4 +28,5 @@ struct ByteBufferCrashTests {
|
||||
) {
|
||||
_ = ByteBufferAllocator().buffer(capacity: -1)
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -11,6 +11,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
#if !os(iOS) && !os(tvOS) && !os(watchOS)
|
||||
import NIOCore
|
||||
import NIOPosix
|
||||
|
||||
@@ -105,3 +106,4 @@ struct EventLoopCrashTests {
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -11,6 +11,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
#if !os(iOS) && !os(tvOS) && !os(watchOS)
|
||||
import NIOEmbedded
|
||||
import NIOCore
|
||||
import NIOHTTP1
|
||||
@@ -41,3 +42,4 @@ struct HTTPCrashTests {
|
||||
"transfer-Encoding": "chunked"]))).wait()
|
||||
})
|
||||
}
|
||||
#endif
|
||||
@@ -12,6 +12,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if !os(iOS) && !os(tvOS) && !os(watchOS)
|
||||
import NIOPosix
|
||||
|
||||
struct StrictCrashTests {
|
||||
@@ -27,3 +28,4 @@ struct StrictCrashTests {
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -12,6 +12,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if !os(iOS) && !os(tvOS) && !os(watchOS)
|
||||
import NIOPosix
|
||||
import Foundation
|
||||
|
||||
@@ -23,3 +24,4 @@ struct SystemCrashTests {
|
||||
_ = try? NIOPipeBootstrap(group: group).withPipes(inputDescriptor: .max, outputDescriptor: .max - 1).wait()
|
||||
})
|
||||
}
|
||||
#endif
|
||||
@@ -11,6 +11,8 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if !os(iOS) && !os(tvOS) && !os(watchOS)
|
||||
import NIOCore
|
||||
import NIOPosix
|
||||
import class Foundation.Process
|
||||
@@ -220,3 +222,4 @@ func main() throws {
|
||||
}
|
||||
|
||||
try main()
|
||||
#endif
|
||||
@@ -1083,7 +1083,7 @@ try measureAndPrint(
|
||||
)
|
||||
)
|
||||
|
||||
if #available(macOS 10.15, *) {
|
||||
if #available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) {
|
||||
try measureAndPrint(
|
||||
desc: "asyncwriter_single_writes_1M_times",
|
||||
benchmark: NIOAsyncWriterSingleWritesBenchmark(
|
||||
|
||||
+1
@@ -15,6 +15,7 @@
|
||||
import NIOCore
|
||||
import XCTest
|
||||
|
||||
@available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
|
||||
final class NIOAsyncSequenceProducerBackPressureStrategiesHighLowWatermarkTests: XCTestCase {
|
||||
private var strategy: NIOAsyncSequenceProducerBackPressureStrategies.HighLowWatermark!
|
||||
|
||||
|
||||
@@ -57,6 +57,7 @@ final class MockNIOBackPressuredStreamSourceDelegate: NIOAsyncSequenceProducerDe
|
||||
}
|
||||
}
|
||||
|
||||
@available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
|
||||
final class NIOAsyncSequenceProducerTests: XCTestCase {
|
||||
private var backPressureStrategy: MockNIOElementStreamBackPressureStrategy!
|
||||
private var delegate: MockNIOBackPressuredStreamSourceDelegate!
|
||||
|
||||
@@ -40,6 +40,7 @@ private final class MockAsyncWriterDelegate: NIOAsyncWriterSinkDelegate, @unchec
|
||||
}
|
||||
}
|
||||
|
||||
@available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
|
||||
final class NIOAsyncWriterTests: XCTestCase {
|
||||
private var writer: NIOAsyncWriter<String, MockAsyncWriterDelegate>!
|
||||
private var sink: NIOAsyncWriter<String, MockAsyncWriterDelegate>.Sink!
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
import NIOCore
|
||||
import XCTest
|
||||
|
||||
@available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
|
||||
final class NIOThrowingAsyncSequenceProducerTests: XCTestCase {
|
||||
private var backPressureStrategy: MockNIOElementStreamBackPressureStrategy!
|
||||
private var delegate: MockNIOBackPressuredStreamSourceDelegate!
|
||||
|
||||
@@ -585,17 +585,20 @@ class AsyncTestingChannelTests: XCTestCase {
|
||||
}
|
||||
}
|
||||
|
||||
@available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
|
||||
fileprivate func XCTAsyncAssertTrue(_ predicate: @autoclosure () async throws -> Bool, file: StaticString = #filePath, line: UInt = #line) async rethrows {
|
||||
let result = try await predicate()
|
||||
XCTAssertTrue(result, file: file, line: line)
|
||||
}
|
||||
|
||||
@available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
|
||||
fileprivate func XCTAsyncAssertEqual<Element: Equatable>(_ lhs: @autoclosure () async throws -> Element, _ rhs: @autoclosure () async throws -> Element, file: StaticString = #filePath, line: UInt = #line) async rethrows {
|
||||
let lhsResult = try await lhs()
|
||||
let rhsResult = try await rhs()
|
||||
XCTAssertEqual(lhsResult, rhsResult, file: file, line: line)
|
||||
}
|
||||
|
||||
@available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
|
||||
fileprivate func XCTAsyncAssertThrowsError<ResultType>(_ expression: @autoclosure () async throws -> ResultType, file: StaticString = #filePath, line: UInt = #line, _ callback: Optional<(Error) -> Void> = nil) async {
|
||||
do {
|
||||
let _ = try await expression()
|
||||
@@ -605,11 +608,13 @@ fileprivate func XCTAsyncAssertThrowsError<ResultType>(_ expression: @autoclosur
|
||||
}
|
||||
}
|
||||
|
||||
@available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
|
||||
fileprivate func XCTAsyncAssertNil(_ expression: @autoclosure () async throws -> Any?, file: StaticString = #filePath, line: UInt = #line) async rethrows {
|
||||
let result = try await expression()
|
||||
XCTAssertNil(result, file: file, line: line)
|
||||
}
|
||||
|
||||
@available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
|
||||
fileprivate func XCTAsyncAssertNotNil(_ expression: @autoclosure () async throws -> Any?, file: StaticString = #filePath, line: UInt = #line) async rethrows {
|
||||
let result = try await expression()
|
||||
XCTAssertNotNil(result, file: file, line: line)
|
||||
|
||||
@@ -1479,8 +1479,8 @@ public final class EventLoopTest : XCTestCase {
|
||||
}.wait())
|
||||
}
|
||||
|
||||
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
|
||||
func testMultiThreadedEventLoopGroupSupportsStickyAnyImplementation() {
|
||||
guard #available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) else { return }
|
||||
let group = MultiThreadedEventLoopGroup(numberOfThreads: 3)
|
||||
defer {
|
||||
XCTAssertNoThrow(try group.syncShutdownGracefully())
|
||||
@@ -1494,8 +1494,8 @@ public final class EventLoopTest : XCTestCase {
|
||||
}.wait())
|
||||
}
|
||||
|
||||
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
|
||||
func testAsyncToFutureConversionSuccess() {
|
||||
guard #available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) else { return }
|
||||
let group = MultiThreadedEventLoopGroup(numberOfThreads: 1)
|
||||
defer {
|
||||
XCTAssertNoThrow(try group.syncShutdownGracefully())
|
||||
@@ -1509,6 +1509,7 @@ public final class EventLoopTest : XCTestCase {
|
||||
}
|
||||
|
||||
func testAsyncToFutureConversionFailure() {
|
||||
guard #available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) else { return }
|
||||
let group = MultiThreadedEventLoopGroup(numberOfThreads: 1)
|
||||
defer {
|
||||
XCTAssertNoThrow(try group.syncShutdownGracefully())
|
||||
|
||||
Reference in new issue
Block a user