Drop Swift 5.5 (#197)

Motivation

Per SwiftNIO's formal version policy, we are ready to drop support for
Swift 5.5.

Modifications

This patch removes the support for 5.5 and all supporting
infrastructure. This includes the test generation functionality, which
is no longer required, as well as the files generated by that
functionality. It updates the dockerfile for 5.8, and it removes all
conditional compilation checks that are now definitionally true.

Result

A nice, clean, 5.6+ codebase
This commit is contained in:
Cory Benfield 2023-04-13 16:47:28 +01:00 committed by GitHub
parent 78d6cc4942
commit 9cdb93e321
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
53 changed files with 4 additions and 1826 deletions

View File

@ -1,138 +0,0 @@
// swift-tools-version:5.5
//===----------------------------------------------------------------------===//
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2017-2022 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of SwiftNIO project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
import PackageDescription
var targets: [PackageDescription.Target] = [
.target(
name: "NIOExtras",
dependencies: [
.product(name: "NIO", package: "swift-nio"),
.product(name: "NIOCore", package: "swift-nio"),
.product(name: "NIOHTTP1", package: "swift-nio")
]),
.target(
name: "NIOHTTPCompression",
dependencies: [
"CNIOExtrasZlib",
.product(name: "NIO", package: "swift-nio"),
.product(name: "NIOCore", package: "swift-nio"),
.product(name: "NIOHTTP1", package: "swift-nio"),
]),
.executableTarget(
name: "HTTPServerWithQuiescingDemo",
dependencies: [
"NIOExtras",
.product(name: "NIOCore", package: "swift-nio"),
.product(name: "NIOPosix", package: "swift-nio"),
.product(name: "NIOHTTP1", package: "swift-nio"),
]),
.executableTarget(
name: "NIOWritePCAPDemo",
dependencies: [
"NIOExtras",
.product(name: "NIOCore", package: "swift-nio"),
.product(name: "NIOPosix", package: "swift-nio"),
.product(name: "NIOHTTP1", package: "swift-nio"),
]),
.executableTarget(
name: "NIOWritePartialPCAPDemo",
dependencies: [
"NIOExtras",
.product(name: "NIOCore", package: "swift-nio"),
.product(name: "NIOPosix", package: "swift-nio"),
.product(name: "NIOHTTP1", package: "swift-nio"),
]),
.executableTarget(
name: "NIOExtrasPerformanceTester",
dependencies: [
"NIOExtras",
.product(name: "NIOCore", package: "swift-nio"),
.product(name: "NIOPosix", package: "swift-nio"),
.product(name: "NIOEmbedded", package: "swift-nio"),
.product(name: "NIOHTTP1", package: "swift-nio"),
]),
.target(
name: "NIOSOCKS",
dependencies: [
.product(name: "NIO", package: "swift-nio"),
.product(name: "NIOCore", package: "swift-nio"),
]),
.executableTarget(
name: "NIOSOCKSClient",
dependencies: [
.product(name: "NIOCore", package: "swift-nio"),
.product(name: "NIOPosix", package: "swift-nio"),
"NIOSOCKS"
]),
.target(
name: "CNIOExtrasZlib",
dependencies: [],
linkerSettings: [
.linkedLibrary("z")
]),
.testTarget(
name: "NIOExtrasTests",
dependencies: [
"NIOExtras",
.product(name: "NIOCore", package: "swift-nio"),
.product(name: "NIOEmbedded", package: "swift-nio"),
.product(name: "NIOPosix", package: "swift-nio"),
.product(name: "NIOTestUtils", package: "swift-nio"),
.product(name: "NIOConcurrencyHelpers", package: "swift-nio"),
]),
.testTarget(
name: "NIOHTTPCompressionTests",
dependencies: [
"CNIOExtrasZlib",
"NIOHTTPCompression",
.product(name: "NIOCore", package: "swift-nio"),
.product(name: "NIOEmbedded", package: "swift-nio"),
.product(name: "NIOHTTP1", package: "swift-nio"),
.product(name: "NIOConcurrencyHelpers", package: "swift-nio"),
]),
.testTarget(
name: "NIOSOCKSTests",
dependencies: [
"NIOSOCKS",
.product(name: "NIOCore", package: "swift-nio"),
.product(name: "NIOEmbedded", package: "swift-nio"),
]),
.target(
name: "NIONFS3",
dependencies: [
.product(name: "NIOCore", package: "swift-nio"),
]),
.testTarget(
name: "NIONFS3Tests",
dependencies: [
"NIONFS3",
.product(name: "NIOCore", package: "swift-nio"),
.product(name: "NIOTestUtils", package: "swift-nio"),
]),
]
let package = Package(
name: "swift-nio-extras",
products: [
.library(name: "NIOExtras", targets: ["NIOExtras"]),
.library(name: "NIOSOCKS", targets: ["NIOSOCKS"]),
.library(name: "NIOHTTPCompression", targets: ["NIOHTTPCompression"]),
],
dependencies: [
.package(url: "https://github.com/apple/swift-nio.git", from: "2.34.0"),
],
targets: targets
)

View File

@ -14,7 +14,7 @@ All code will go through code review like in the other repositories related to t
`swift-nio-extras` part of the SwiftNIO 2 family of repositories and depends on the following:
- [`swift-nio`](https://github.com/apple/swift-nio), version 2.30.0 or better.
- Swift 5.5.2
- Swift 5.6
- `zlib` and its development headers installed on the system. But don't worry, you'll find `zlib` on pretty much any UNIX system that can compile any sort of code.
To depend on `swift-nio-extras`, put the following in the `dependencies` of your `Package.swift`:
@ -25,14 +25,15 @@ To depend on `swift-nio-extras`, put the following in the `dependencies` of your
### Support for older Swift versions
The most recent versions of SwiftNIO Extras support Swift 5.5.2 and newer. The minimum Swift version supported by SwiftNIO Extras releases are detailed below:
The most recent versions of SwiftNIO Extras support Swift 5.6 and newer. The minimum Swift version supported by SwiftNIO Extras releases are detailed below:
SwiftNIO Extras | Minimum Swift Version
--------------------|----------------------
`1.0.0 ..< 1.10.0` | 5.0
`1.10.0 ..< 1.11.0` | 5.2
`1.11.0 ..< 1.14.0` | 5.4
`1.14.0 ...` | 5.5.2
`1.14.0 ..< 1.19.1` | 5.5.2
`1.19.0 ...` | 5.6
On the [`nio-extras-0.1`](https://github.com/apple/swift-nio-extras/tree/nio-extras-0.1) branch, you can find the `swift-nio-extras` version for the SwiftNIO 1 family. It requires Swift 4.1 or better.

View File

@ -175,7 +175,5 @@ public class DebugInboundEventsHandler: ChannelInboundHandler {
}
}
#if swift(>=5.6)
@available(*, unavailable)
extension DebugInboundEventsHandler: Sendable {}
#endif

View File

@ -171,7 +171,5 @@ public class DebugOutboundEventsHandler: ChannelOutboundHandler {
}
}
#if swift(>=5.6)
@available(*, unavailable)
extension DebugOutboundEventsHandler: Sendable {}
#endif

View File

@ -77,7 +77,5 @@ public final class FixedLengthFrameDecoder: ByteToMessageDecoder {
}
}
#if swift(>=5.6)
@available(*, unavailable)
extension FixedLengthFrameDecoder: Sendable {}
#endif

View File

@ -217,10 +217,8 @@ extension String {
#if swift(>=5.6)
@available(*, unavailable)
extension NIOJSONRPCFraming.ContentLengthHeaderFrameDecoder: Sendable {}
@available(*, unavailable)
extension NIOJSONRPCFraming.ContentLengthHeaderFrameEncoder: Sendable {}
#endif

View File

@ -247,7 +247,5 @@ public final class LengthFieldBasedFrameDecoder: ByteToMessageDecoder {
}
}
#if swift(>=5.6)
@available(*, unavailable)
extension LengthFieldBasedFrameDecoder: Sendable {}
#endif

View File

@ -145,7 +145,5 @@ public final class LengthFieldPrepender: ChannelOutboundHandler {
}
}
#if swift(>=5.6)
@available(*, unavailable)
extension LengthFieldPrepender: Sendable {}
#endif

View File

@ -92,7 +92,5 @@ public class LineBasedFrameDecoder: ByteToMessageDecoder {
}
}
#if swift(>=5.6)
@available(*, unavailable)
extension LineBasedFrameDecoder: Sendable {}
#endif

View File

@ -97,7 +97,5 @@ public class NIOPCAPRingBuffer {
}
}
#if swift(>=5.6)
@available(*, unavailable)
extension NIOPCAPRingBuffer: Sendable {}
#endif

View File

@ -120,7 +120,5 @@ public final class RequestResponseHandler<Request, Response>: ChannelDuplexHandl
}
}
#if swift(>=5.6)
@available(*, unavailable)
extension RequestResponseHandler: Sendable {}
#endif

View File

@ -290,10 +290,8 @@ public class NIOWritePCAPHandler: RemovableChannelHandler {
}
}
#if swift(>=5.6)
@available(*, unavailable)
extension NIOWritePCAPHandler: Sendable {}
#endif
extension NIOWritePCAPHandler: ChannelDuplexHandler {
public typealias InboundIn = ByteBuffer

View File

@ -179,7 +179,5 @@ public final class NIOHTTPRequestCompressor: ChannelOutboundHandler, RemovableCh
}
}
#if swift(>=5.6)
@available(*, unavailable)
extension NIOHTTPRequestCompressor: Sendable {}
#endif

View File

@ -106,7 +106,5 @@ public final class NIOHTTPRequestDecompressor: ChannelDuplexHandler, RemovableCh
}
}
#if swift(>=5.6)
@available(*, unavailable)
extension NIOHTTPRequestDecompressor: Sendable {}
#endif

View File

@ -222,10 +222,8 @@ public final class HTTPResponseCompressor: ChannelDuplexHandler, RemovableChanne
}
}
#if swift(>=5.6)
@available(*, unavailable)
extension HTTPResponseCompressor: Sendable {}
#endif
/// A buffer object that allows us to keep track of how much of a HTTP response we've seen before
/// a flush.

View File

@ -122,7 +122,5 @@ public final class NIOHTTPResponseDecompressor: ChannelDuplexHandler, RemovableC
}
}
#if swift(>=5.6)
@available(*, unavailable)
extension NIOHTTPResponseDecompressor: Sendable {}
#endif

View File

@ -114,10 +114,8 @@ public final class SOCKSClientHandler: ChannelDuplexHandler {
}
}
#if swift(>=5.6)
@available(*, unavailable)
extension SOCKSClientHandler: Sendable {}
#endif
extension SOCKSClientHandler {

View File

@ -122,7 +122,5 @@ public final class SOCKSServerHandshakeHandler: ChannelDuplexHandler, RemovableC
}
#if swift(>=5.6)
@available(*, unavailable)
extension SOCKSServerHandshakeHandler: Sendable {}
#endif

View File

@ -1,75 +0,0 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2018-2023 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of SwiftNIO project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
//
// LinuxMain.swift
//
import XCTest
///
/// NOTE: This file was generated by generate_linux_tests.rb
///
/// Do NOT edit this file directly as it will be regenerated automatically when needed.
///
#if !compiler(>=5.5)
#if os(Linux) || os(FreeBSD) || os(Android)
@testable import NIOExtrasTests
@testable import NIOHTTPCompressionTests
@testable import NIONFS3Tests
@testable import NIOSOCKSTests
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
@main
class LinuxMainRunner {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static func main() {
XCTMain([
testCase(ClientGreetingTests.allTests),
testCase(ClientRequestTests.allTests),
testCase(ClientStateMachineTests.allTests),
testCase(DebugInboundEventsHandlerTest.allTests),
testCase(DebugOutboundEventsHandlerTest.allTests),
testCase(FixedLengthFrameDecoderTest.allTests),
testCase(HTTP1ProxyConnectHandlerTests.allTests),
testCase(HTTPRequestCompressorTest.allTests),
testCase(HTTPRequestDecompressorTest.allTests),
testCase(HTTPResponseCompressorTest.allTests),
testCase(HTTPResponseDecompressorTest.allTests),
testCase(HelperTests.allTests),
testCase(JSONRPCFramingContentLengthHeaderDecoderTests.allTests),
testCase(JSONRPCFramingContentLengthHeaderEncoderTests.allTests),
testCase(LengthFieldBasedFrameDecoderTest.allTests),
testCase(LengthFieldPrependerTest.allTests),
testCase(LineBasedFrameDecoderTest.allTests),
testCase(MethodSelectionTests.allTests),
testCase(NFS3FileSystemTests.allTests),
testCase(NFS3ReplyEncoderTest.allTests),
testCase(NFS3RoundtripTests.allTests),
testCase(PCAPRingBufferTest.allTests),
testCase(QuiescingHelperTest.allTests),
testCase(RequestResponseHandlerTest.allTests),
testCase(RequestResponseWithIDHandlerTest.allTests),
testCase(SOCKSServerHandlerTests.allTests),
testCase(ServerResponseTests.allTests),
testCase(ServerStateMachineTests.allTests),
testCase(SocksClientHandlerTests.allTests),
testCase(SynchronizedFileSinkTests.allTests),
testCase(WritePCAPHandlerTest.allTests),
])
}
}
#endif
#else
#error("on Swift 5.5 and newer, --enable-test-discovery is required")
#endif

View File

@ -1,42 +0,0 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2018-2022 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of SwiftNIO project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
//
// DebugInboundEventsHandlerTest+XCTest.swift
//
import XCTest
///
/// NOTE: This file was generated by generate_linux_tests.rb
///
/// Do NOT edit this file directly as it will be regenerated automatically when needed.
///
extension DebugInboundEventsHandlerTest {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (DebugInboundEventsHandlerTest) -> () throws -> Void)] {
return [
("testRegistered", testRegistered),
("testUnregistered", testUnregistered),
("testActive", testActive),
("testInactive", testInactive),
("testReadComplete", testReadComplete),
("testWritabilityChanged", testWritabilityChanged),
("testUserInboundEvent", testUserInboundEvent),
("testErrorCaught", testErrorCaught),
("testRead", testRead),
]
}
}

View File

@ -1,41 +0,0 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2018-2022 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of SwiftNIO project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
//
// DebugOutboundEventsHandlerTest+XCTest.swift
//
import XCTest
///
/// NOTE: This file was generated by generate_linux_tests.rb
///
/// Do NOT edit this file directly as it will be regenerated automatically when needed.
///
extension DebugOutboundEventsHandlerTest {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (DebugOutboundEventsHandlerTest) -> () throws -> Void)] {
return [
("testRegister", testRegister),
("testBind", testBind),
("testConnect", testConnect),
("testWrite", testWrite),
("testFlush", testFlush),
("testRead", testRead),
("testClose", testClose),
("testTriggerUserOutboundEvent", testTriggerUserOutboundEvent),
]
}
}

View File

@ -1,38 +0,0 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2018-2022 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of SwiftNIO project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
//
// FixedLengthFrameDecoderTest+XCTest.swift
//
import XCTest
///
/// NOTE: This file was generated by generate_linux_tests.rb
///
/// Do NOT edit this file directly as it will be regenerated automatically when needed.
///
extension FixedLengthFrameDecoderTest {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (FixedLengthFrameDecoderTest) -> () throws -> Void)] {
return [
("testDecodeIfFewerBytesAreSent", testDecodeIfFewerBytesAreSent),
("testDecodeIfMoreBytesAreSent", testDecodeIfMoreBytesAreSent),
("testRemoveHandlerWhenBufferIsNotEmpty", testRemoveHandlerWhenBufferIsNotEmpty),
("testRemoveHandlerWhenBufferIsEmpty", testRemoveHandlerWhenBufferIsEmpty),
("testBasicValidation", testBasicValidation),
]
}
}

View File

@ -1,40 +0,0 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2023 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of SwiftNIO project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
//
// HTTP1ProxyConnectHandlerTests+XCTest.swift
//
import XCTest
///
/// NOTE: This file was generated by generate_linux_tests.rb
///
/// Do NOT edit this file directly as it will be regenerated automatically when needed.
///
extension HTTP1ProxyConnectHandlerTests {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (HTTP1ProxyConnectHandlerTests) -> () throws -> Void)] {
return [
("testProxyConnectWithoutAuthorizationSuccess", testProxyConnectWithoutAuthorizationSuccess),
("testProxyConnectWithAuthorization", testProxyConnectWithAuthorization),
("testProxyConnectWithoutAuthorizationFailure500", testProxyConnectWithoutAuthorizationFailure500),
("testProxyConnectWithoutAuthorizationButAuthorizationNeeded", testProxyConnectWithoutAuthorizationButAuthorizationNeeded),
("testProxyConnectReceivesBody", testProxyConnectReceivesBody),
("testProxyConnectWithoutAuthorizationBufferedWrites", testProxyConnectWithoutAuthorizationBufferedWrites),
("testProxyConnectFailsBufferedWritesAreFailed", testProxyConnectFailsBufferedWritesAreFailed),
]
}
}

View File

@ -1,44 +0,0 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2019-2022 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of SwiftNIO project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
//
// JSONRPCFramingContentLengthHeaderDecoderTests+XCTest.swift
//
import XCTest
///
/// NOTE: This file was generated by generate_linux_tests.rb
///
/// Do NOT edit this file directly as it will be regenerated automatically when needed.
///
extension JSONRPCFramingContentLengthHeaderDecoderTests {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (JSONRPCFramingContentLengthHeaderDecoderTests) -> () throws -> Void)] {
return [
("testBasicMessage", testBasicMessage),
("testEmptyMessage", testEmptyMessage),
("testWrongCasing", testWrongCasing),
("testTechnicallyInvalidButWeAreNicePeople", testTechnicallyInvalidButWeAreNicePeople),
("testLongerMessage", testLongerMessage),
("testSomePointlessExtraHeaders", testSomePointlessExtraHeaders),
("testDripAndMassFeedMessages", testDripAndMassFeedMessages),
("testErrorNoContentLengthHeader", testErrorNoContentLengthHeader),
("testErrorNotEnoughDataAtEOF", testErrorNotEnoughDataAtEOF),
("testErrorNegativeContentLength", testErrorNegativeContentLength),
("testErrorNotANumberContentLength", testErrorNotANumberContentLength),
]
}
}

View File

@ -1,35 +0,0 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2018-2022 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of SwiftNIO project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
//
// JSONRPCFramingContentLengthHeaderEncoderTests+XCTest.swift
//
import XCTest
///
/// NOTE: This file was generated by generate_linux_tests.rb
///
/// Do NOT edit this file directly as it will be regenerated automatically when needed.
///
extension JSONRPCFramingContentLengthHeaderEncoderTests {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (JSONRPCFramingContentLengthHeaderEncoderTests) -> () throws -> Void)] {
return [
("testEmptyMessage", testEmptyMessage),
("testRoundtrip", testRoundtrip),
]
}
}

View File

@ -1,56 +0,0 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2018-2022 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of SwiftNIO project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
//
// LengthFieldBasedFrameDecoderTest+XCTest.swift
//
import XCTest
///
/// NOTE: This file was generated by generate_linux_tests.rb
///
/// Do NOT edit this file directly as it will be regenerated automatically when needed.
///
extension LengthFieldBasedFrameDecoderTest {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (LengthFieldBasedFrameDecoderTest) -> () throws -> Void)] {
return [
("testReadUInt32From3Bytes", testReadUInt32From3Bytes),
("testReadAndWriteUInt32From3BytesBasicVerification", testReadAndWriteUInt32From3BytesBasicVerification),
("testDecodeWithUInt8HeaderWithData", testDecodeWithUInt8HeaderWithData),
("testDecodeWithUInt16HeaderWithString", testDecodeWithUInt16HeaderWithString),
("testDecodeWithUInt24HeaderWithString", testDecodeWithUInt24HeaderWithString),
("testDecodeWithUInt32HeaderWithString", testDecodeWithUInt32HeaderWithString),
("testDecodeWithUInt64HeaderWithString", testDecodeWithUInt64HeaderWithString),
("testDecodeWithInt64HeaderWithString", testDecodeWithInt64HeaderWithString),
("testDecodeWithInt64HeaderStringBigEndian", testDecodeWithInt64HeaderStringBigEndian),
("testDecodeWithInt64HeaderStringDefaultingToBigEndian", testDecodeWithInt64HeaderStringDefaultingToBigEndian),
("testDecodeWithUInt8HeaderTwoFrames", testDecodeWithUInt8HeaderTwoFrames),
("testDecodeWithUInt8HeaderFrameSplitIncomingData", testDecodeWithUInt8HeaderFrameSplitIncomingData),
("testEmptyBuffer", testEmptyBuffer),
("testDecodeWithUInt16HeaderWithPartialHeader", testDecodeWithUInt16HeaderWithPartialHeader),
("testDecodeWithUInt16HeaderWithPartialBody", testDecodeWithUInt16HeaderWithPartialBody),
("testRemoveHandlerWhenBufferIsEmpty", testRemoveHandlerWhenBufferIsEmpty),
("testRemoveHandlerWhenBufferIsNotEmpty", testRemoveHandlerWhenBufferIsNotEmpty),
("testCloseInChannelRead", testCloseInChannelRead),
("testBasicVerification", testBasicVerification),
("testMaximumAllowedLengthWith32BitFieldLength", testMaximumAllowedLengthWith32BitFieldLength),
("testMaliciousLengthWith32BitFieldLength", testMaliciousLengthWith32BitFieldLength),
("testMaximumAllowedLengthWith64BitFieldLength", testMaximumAllowedLengthWith64BitFieldLength),
("testMaliciousLengthWith64BitFieldLength", testMaliciousLengthWith64BitFieldLength),
]
}
}

View File

@ -1,45 +0,0 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2019-2022 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of SwiftNIO project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
//
// LengthFieldPrependerTest+XCTest.swift
//
import XCTest
///
/// NOTE: This file was generated by generate_linux_tests.rb
///
/// Do NOT edit this file directly as it will be regenerated automatically when needed.
///
extension LengthFieldPrependerTest {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (LengthFieldPrependerTest) -> () throws -> Void)] {
return [
("testWrite3BytesOfUInt32Write", testWrite3BytesOfUInt32Write),
("testEncodeWithUInt8HeaderWithData", testEncodeWithUInt8HeaderWithData),
("testEncodeWithUInt16HeaderWithString", testEncodeWithUInt16HeaderWithString),
("testEncodeWithUInt24HeaderWithString", testEncodeWithUInt24HeaderWithString),
("testEncodeWithUInt32HeaderWithString", testEncodeWithUInt32HeaderWithString),
("testEncodeWithUInt64HeaderWithString", testEncodeWithUInt64HeaderWithString),
("testEncodeWithInt64HeaderWithString", testEncodeWithInt64HeaderWithString),
("testEncodeWithUInt64HeaderStringBigEndian", testEncodeWithUInt64HeaderStringBigEndian),
("testEncodeWithInt64HeaderStringDefaultingToBigEndian", testEncodeWithInt64HeaderStringDefaultingToBigEndian),
("testEmptyBuffer", testEmptyBuffer),
("testLargeBuffer", testLargeBuffer),
("testTooLargeForLengthField", testTooLargeForLengthField),
]
}
}

View File

@ -1,42 +0,0 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2018-2022 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of SwiftNIO project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
//
// LineBasedFrameDecoderTest+XCTest.swift
//
import XCTest
///
/// NOTE: This file was generated by generate_linux_tests.rb
///
/// Do NOT edit this file directly as it will be regenerated automatically when needed.
///
extension LineBasedFrameDecoderTest {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (LineBasedFrameDecoderTest) -> () throws -> Void)] {
return [
("testDecodeOneCharacterAtATime", testDecodeOneCharacterAtATime),
("testRemoveHandlerWhenBufferIsNotEmpty", testRemoveHandlerWhenBufferIsNotEmpty),
("testRemoveHandlerWhenBufferIsEmpty", testRemoveHandlerWhenBufferIsEmpty),
("testEmptyLine", testEmptyLine),
("testEmptyBuffer", testEmptyBuffer),
("testChannelInactiveWithLeftOverBytes", testChannelInactiveWithLeftOverBytes),
("testMoreDataAvailableWhenChannelBecomesInactive", testMoreDataAvailableWhenChannelBecomesInactive),
("testDripFedCRLN", testDripFedCRLN),
("testBasicValidation", testBasicValidation),
]
}
}

View File

@ -1,43 +0,0 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2018-2022 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of SwiftNIO project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
//
// PCAPRingBufferTest+XCTest.swift
//
import XCTest
///
/// NOTE: This file was generated by generate_linux_tests.rb
///
/// Do NOT edit this file directly as it will be regenerated automatically when needed.
///
extension PCAPRingBufferTest {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (PCAPRingBufferTest) -> () throws -> Void)] {
return [
("testNotLimited", testNotLimited),
("testFragmentLimit", testFragmentLimit),
("testByteLimit", testByteLimit),
("testByteOnLimit", testByteOnLimit),
("testExtremeByteLimit", testExtremeByteLimit),
("testUnusedBuffer", testUnusedBuffer),
("testDoubleEmitZero", testDoubleEmitZero),
("testDoubleEmitSome", testDoubleEmitSome),
("testAsHandlerSink", testAsHandlerSink),
("testHandler", testHandler),
]
}
}

View File

@ -1,42 +0,0 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2018-2023 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of SwiftNIO project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
//
// QuiescingHelperTest+XCTest.swift
//
import XCTest
///
/// NOTE: This file was generated by generate_linux_tests.rb
///
/// Do NOT edit this file directly as it will be regenerated automatically when needed.
///
extension QuiescingHelperTest {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (QuiescingHelperTest) -> () throws -> Void)] {
return [
("testShutdownIsImmediateWhenNoChannelsCollected", testShutdownIsImmediateWhenNoChannelsCollected),
("testQuiesceUserEventReceivedOnShutdown", testQuiesceUserEventReceivedOnShutdown),
("testQuiescingDoesNotSwallowCloseErrorsFromAcceptHandler", testQuiescingDoesNotSwallowCloseErrorsFromAcceptHandler),
("testShutdownIsImmediateWhenPromiseDoesNotSucceed", testShutdownIsImmediateWhenPromiseDoesNotSucceed),
("testShutdown_whenAlreadyShutdown", testShutdown_whenAlreadyShutdown),
("testShutdown_whenNoOpenChild", testShutdown_whenNoOpenChild),
("testChannelClose_whenRunning", testChannelClose_whenRunning),
("testChannelAdded_whenShuttingDown", testChannelAdded_whenShuttingDown),
("testChannelAdded_whenShutdown", testChannelAdded_whenShutdown),
]
}
}

View File

@ -1,38 +0,0 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2018-2022 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of SwiftNIO project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
//
// RequestResponseHandlerTest+XCTest.swift
//
import XCTest
///
/// NOTE: This file was generated by generate_linux_tests.rb
///
/// Do NOT edit this file directly as it will be regenerated automatically when needed.
///
extension RequestResponseHandlerTest {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (RequestResponseHandlerTest) -> () throws -> Void)] {
return [
("testSimpleRequestWorks", testSimpleRequestWorks),
("testEnqueingMultipleRequestsWorks", testEnqueingMultipleRequestsWorks),
("testRequestsEnqueuedAfterErrorAreFailed", testRequestsEnqueuedAfterErrorAreFailed),
("testRequestsEnqueuedJustBeforeErrorAreFailed", testRequestsEnqueuedJustBeforeErrorAreFailed),
("testClosedConnectionFailsOutstandingPromises", testClosedConnectionFailsOutstandingPromises),
]
}
}

View File

@ -1,41 +0,0 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2018-2023 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of SwiftNIO project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
//
// RequestResponseWithIDHandlerTest+XCTest.swift
//
import XCTest
///
/// NOTE: This file was generated by generate_linux_tests.rb
///
/// Do NOT edit this file directly as it will be regenerated automatically when needed.
///
extension RequestResponseWithIDHandlerTest {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (RequestResponseWithIDHandlerTest) -> () throws -> Void)] {
return [
("testSimpleRequestWorks", testSimpleRequestWorks),
("testEnqueingMultipleRequestsWorks", testEnqueingMultipleRequestsWorks),
("testRequestsEnqueuedAfterErrorAreFailed", testRequestsEnqueuedAfterErrorAreFailed),
("testRequestsEnqueuedJustBeforeErrorAreFailed", testRequestsEnqueuedJustBeforeErrorAreFailed),
("testClosedConnectionFailsOutstandingPromises", testClosedConnectionFailsOutstandingPromises),
("testOutOfOrderResponsesWork", testOutOfOrderResponsesWork),
("testErrorOnResponseForNonExistantRequest", testErrorOnResponseForNonExistantRequest),
("testMoreRequestsAfterChannelInactiveFail", testMoreRequestsAfterChannelInactiveFail),
]
}
}

View File

@ -1,35 +0,0 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2018-2023 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of SwiftNIO project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
//
// SynchronizedFileSinkTests+XCTest.swift
//
import XCTest
///
/// NOTE: This file was generated by generate_linux_tests.rb
///
/// Do NOT edit this file directly as it will be regenerated automatically when needed.
///
extension SynchronizedFileSinkTests {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (SynchronizedFileSinkTests) -> () throws -> Void)] {
return [
("testSimpleFileSink", testSimpleFileSink),
("testSimpleFileSinkAsyncShutdown", testSimpleFileSinkAsyncShutdown),
]
}
}

View File

@ -1,48 +0,0 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2019-2022 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of SwiftNIO project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
//
// WritePCAPHandlerTest+XCTest.swift
//
import XCTest
///
/// NOTE: This file was generated by generate_linux_tests.rb
///
/// Do NOT edit this file directly as it will be regenerated automatically when needed.
///
extension WritePCAPHandlerTest {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (WritePCAPHandlerTest) -> () throws -> Void)] {
return [
("testConnectIssuesThreePacketsForIPv4", testConnectIssuesThreePacketsForIPv4),
("testConnectIssuesThreePacketsForIPv6", testConnectIssuesThreePacketsForIPv6),
("testAcceptConnectionFromRemote", testAcceptConnectionFromRemote),
("testCloseOriginatingFromLocal", testCloseOriginatingFromLocal),
("testCloseOriginatingFromRemote", testCloseOriginatingFromRemote),
("testInboundData", testInboundData),
("testOutboundData", testOutboundData),
("testOversizedInboundDataComesAsTwoPacketsIPv4", testOversizedInboundDataComesAsTwoPacketsIPv4),
("testOversizedInboundDataComesAsTwoPacketsIPv6", testOversizedInboundDataComesAsTwoPacketsIPv6),
("testOversizedOutboundDataComesAsTwoPacketsIPv4", testOversizedOutboundDataComesAsTwoPacketsIPv4),
("testOversizedOutboundDataComesAsTwoPacketsIPv6", testOversizedOutboundDataComesAsTwoPacketsIPv6),
("testUnflushedOutboundDataIsNotWritten", testUnflushedOutboundDataIsNotWritten),
("testDataWrittenAfterCloseIsDiscarded", testDataWrittenAfterCloseIsDiscarded),
("testUnflushedOutboundDataIsWrittenWhenEmittingWritesOnIssue", testUnflushedOutboundDataIsWrittenWhenEmittingWritesOnIssue),
("testWeDoNotCrashIfMoreThan4GBOfDataGoThrough", testWeDoNotCrashIfMoreThan4GBOfDataGoThrough),
]
}
}

View File

@ -1,43 +0,0 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2020-2022 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of SwiftNIO project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
//
// HTTPRequestCompressorTest+XCTest.swift
//
import XCTest
///
/// NOTE: This file was generated by generate_linux_tests.rb
///
/// Do NOT edit this file directly as it will be regenerated automatically when needed.
///
extension HTTPRequestCompressorTest {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (HTTPRequestCompressorTest) -> () throws -> Void)] {
return [
("testGzipContentEncoding", testGzipContentEncoding),
("testDeflateContentEncoding", testDeflateContentEncoding),
("testOneBuffer", testOneBuffer),
("testMultipleBuffers", testMultipleBuffers),
("testMultipleBuffersDeflate", testMultipleBuffersDeflate),
("testMultipleBuffersWithFlushes", testMultipleBuffersWithFlushes),
("testFlushAfterHead", testFlushAfterHead),
("testFlushBeforeEnd", testFlushBeforeEnd),
("testDoubleFlush", testDoubleFlush),
("testNoBody", testNoBody),
]
}
}

View File

@ -1,39 +0,0 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2018-2022 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of SwiftNIO project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
//
// HTTPRequestDecompressorTest+XCTest.swift
//
import XCTest
///
/// NOTE: This file was generated by generate_linux_tests.rb
///
/// Do NOT edit this file directly as it will be regenerated automatically when needed.
///
extension HTTPRequestDecompressorTest {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (HTTPRequestDecompressorTest) -> () throws -> Void)] {
return [
("testDecompressionNoLimit", testDecompressionNoLimit),
("testDecompressionLimitRatio", testDecompressionLimitRatio),
("testDecompressionLimitSize", testDecompressionLimitSize),
("testDecompression", testDecompression),
("testDecompressionTrailingData", testDecompressionTrailingData),
("testDecompressionTruncatedInput", testDecompressionTruncatedInput),
]
}
}

View File

@ -1,60 +0,0 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2019-2022 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of SwiftNIO project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
//
// HTTPResponseCompressorTest+XCTest.swift
//
import XCTest
///
/// NOTE: This file was generated by generate_linux_tests.rb
///
/// Do NOT edit this file directly as it will be regenerated automatically when needed.
///
extension HTTPResponseCompressorTest {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (HTTPResponseCompressorTest) -> () throws -> Void)] {
return [
("testCanCompressSimpleBodies", testCanCompressSimpleBodies),
("testCanCompressSimpleBodiesGzip", testCanCompressSimpleBodiesGzip),
("testCanCompressDeflateWithAwkwardFlushes", testCanCompressDeflateWithAwkwardFlushes),
("testCanCompressGzipWithAwkwardFlushes", testCanCompressGzipWithAwkwardFlushes),
("testDoesNotCompressWithoutAcceptEncodingHeader", testDoesNotCompressWithoutAcceptEncodingHeader),
("testHandlesPipelinedRequestsProperly", testHandlesPipelinedRequestsProperly),
("testHandlesBasicQValues", testHandlesBasicQValues),
("testAlwaysPrefersHighestQValue", testAlwaysPrefersHighestQValue),
("testAsteriskMeansGzip", testAsteriskMeansGzip),
("testIgnoresUnknownAlgorithms", testIgnoresUnknownAlgorithms),
("testNonNumericQValuePreventsChoice", testNonNumericQValuePreventsChoice),
("testNaNQValuePreventsChoice", testNaNQValuePreventsChoice),
("testInfinityQValuePreventsChoice", testInfinityQValuePreventsChoice),
("testNegativeInfinityQValuePreventsChoice", testNegativeInfinityQValuePreventsChoice),
("testOutOfRangeQValuePreventsChoice", testOutOfRangeQValuePreventsChoice),
("testOverridesContentEncodingHeader", testOverridesContentEncodingHeader),
("testRemovingHandlerFailsPendingWrites", testRemovingHandlerFailsPendingWrites),
("testDoesNotBufferWritesNoAlgorithm", testDoesNotBufferWritesNoAlgorithm),
("testChunkedGzipResponseProducesCorrectNumberOfWrites", testChunkedGzipResponseProducesCorrectNumberOfWrites),
("testStartsWithSameUnicodeScalarsWorksOnEmptyStrings", testStartsWithSameUnicodeScalarsWorksOnEmptyStrings),
("testStartsWithSameUnicodeScalarsWorksOnLongerNeedleFalse", testStartsWithSameUnicodeScalarsWorksOnLongerNeedleFalse),
("testStartsWithSameUnicodeScalarsWorksOnSameStrings", testStartsWithSameUnicodeScalarsWorksOnSameStrings),
("testStartsWithSameUnicodeScalarsWorksOnPrefix", testStartsWithSameUnicodeScalarsWorksOnPrefix),
("testStartsWithSameUnicodeScalarsSaysNoForTheSameStringInDifferentNormalisations", testStartsWithSameUnicodeScalarsSaysNoForTheSameStringInDifferentNormalisations),
("testStartsWithSaysYesForTheSameStringInDifferentNormalisations", testStartsWithSaysYesForTheSameStringInDifferentNormalisations),
("testCanBeRemoved", testCanBeRemoved),
("testBypassCompressionWhenNoContent", testBypassCompressionWhenNoContent),
]
}
}

View File

@ -1,46 +0,0 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2018-2022 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of SwiftNIO project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
//
// HTTPResponseDecompressorTest+XCTest.swift
//
import XCTest
///
/// NOTE: This file was generated by generate_linux_tests.rb
///
/// Do NOT edit this file directly as it will be regenerated automatically when needed.
///
extension HTTPResponseDecompressorTest {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (HTTPResponseDecompressorTest) -> () throws -> Void)] {
return [
("testDecompressionNoLimit", testDecompressionNoLimit),
("testDecompressionLimitSizeWithContentLenghtHeaderSucceeds", testDecompressionLimitSizeWithContentLenghtHeaderSucceeds),
("testDecompressionLimitSizeWithContentLenghtHeaderFails", testDecompressionLimitSizeWithContentLenghtHeaderFails),
("testDecompressionLimitSizeWithoutContentLenghtHeaderSucceeds", testDecompressionLimitSizeWithoutContentLenghtHeaderSucceeds),
("testDecompressionLimitSizeWithoutContentLenghtHeaderFails", testDecompressionLimitSizeWithoutContentLenghtHeaderFails),
("testDecompressionLimitRatioWithContentLenghtHeaderSucceeds", testDecompressionLimitRatioWithContentLenghtHeaderSucceeds),
("testDecompressionLimitRatioWithContentLenghtHeaderFails", testDecompressionLimitRatioWithContentLenghtHeaderFails),
("testDecompressionLimitRatioWithoutContentLenghtHeaderSucceeds", testDecompressionLimitRatioWithoutContentLenghtHeaderSucceeds),
("testDecompressionLimitRatioWithoutContentLenghtHeaderFails", testDecompressionLimitRatioWithoutContentLenghtHeaderFails),
("testDecompression", testDecompression),
("testDecompressionWithoutContentLength", testDecompressionWithoutContentLength),
("testDecompressionTrailingData", testDecompressionTrailingData),
("testDecompressionTruncatedInput", testDecompressionTruncatedInput),
]
}
}

View File

@ -1,34 +0,0 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2018-2023 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of SwiftNIO project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
//
// NFS3FileSystemTests+XCTest.swift
//
import XCTest
///
/// NOTE: This file was generated by generate_linux_tests.rb
///
/// Do NOT edit this file directly as it will be regenerated automatically when needed.
///
extension NFS3FileSystemTests {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (NFS3FileSystemTests) -> () throws -> Void)] {
return [
("testReadDirDefaultImplementation", testReadDirDefaultImplementation),
]
}
}

View File

@ -1,35 +0,0 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2018-2023 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of SwiftNIO project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
//
// NFS3ReplyEncoderTest+XCTest.swift
//
import XCTest
///
/// NOTE: This file was generated by generate_linux_tests.rb
///
/// Do NOT edit this file directly as it will be regenerated automatically when needed.
///
extension NFS3ReplyEncoderTest {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (NFS3ReplyEncoderTest) -> () throws -> Void)] {
return [
("testPartialReadEncoding", testPartialReadEncoding),
("testFullReadEncodingParses", testFullReadEncodingParses),
]
}
}

View File

@ -1,36 +0,0 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2018-2023 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of SwiftNIO project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
//
// NFS3RoundtripTests+XCTest.swift
//
import XCTest
///
/// NOTE: This file was generated by generate_linux_tests.rb
///
/// Do NOT edit this file directly as it will be regenerated automatically when needed.
///
extension NFS3RoundtripTests {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (NFS3RoundtripTests) -> () throws -> Void)] {
return [
("testRegularCallsRoundtrip", testRegularCallsRoundtrip),
("testCallsWithMaxIntegersRoundtrip", testCallsWithMaxIntegersRoundtrip),
("testRegularOkayRepliesRoundtrip", testRegularOkayRepliesRoundtrip),
]
}
}

View File

@ -1,35 +0,0 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2018-2022 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of SwiftNIO project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
//
// ClientGreeting+Tests+XCTest.swift
//
import XCTest
///
/// NOTE: This file was generated by generate_linux_tests.rb
///
/// Do NOT edit this file directly as it will be regenerated automatically when needed.
///
extension ClientGreetingTests {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (ClientGreetingTests) -> () throws -> Void)] {
return [
("testInitFromBuffer", testInitFromBuffer),
("testWriting", testWriting),
]
}
}

View File

@ -1,36 +0,0 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2018-2022 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of SwiftNIO project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
//
// ClientRequest+Tests+XCTest.swift
//
import XCTest
///
/// NOTE: This file was generated by generate_linux_tests.rb
///
/// Do NOT edit this file directly as it will be regenerated automatically when needed.
///
extension ClientRequestTests {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (ClientRequestTests) -> () throws -> Void)] {
return [
("testWriteClientRequest", testWriteClientRequest),
("testReadAddressType", testReadAddressType),
("testWriteAddressType", testWriteAddressType),
]
}
}

View File

@ -1,35 +0,0 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2018-2022 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of SwiftNIO project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
//
// ClientStateMachine+Tests+XCTest.swift
//
import XCTest
///
/// NOTE: This file was generated by generate_linux_tests.rb
///
/// Do NOT edit this file directly as it will be regenerated automatically when needed.
///
extension ClientStateMachineTests {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (ClientStateMachineTests) -> () throws -> Void)] {
return [
("testUsualWorkflow", testUsualWorkflow),
("testErrorsAreHandled", testErrorsAreHandled),
]
}
}

View File

@ -1,36 +0,0 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2018-2022 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of SwiftNIO project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
//
// Helpers+Tests+XCTest.swift
//
import XCTest
///
/// NOTE: This file was generated by generate_linux_tests.rb
///
/// Do NOT edit this file directly as it will be regenerated automatically when needed.
///
extension HelperTests {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (HelperTests) -> () throws -> Void)] {
return [
("testUnwindingReturnNil", testUnwindingReturnNil),
("testUnwindingThrowError", testUnwindingThrowError),
("testUnwindingNotRequired", testUnwindingNotRequired),
]
}
}

View File

@ -1,35 +0,0 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2018-2022 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of SwiftNIO project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
//
// MethodSelection+Tests+XCTest.swift
//
import XCTest
///
/// NOTE: This file was generated by generate_linux_tests.rb
///
/// Do NOT edit this file directly as it will be regenerated automatically when needed.
///
extension MethodSelectionTests {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (MethodSelectionTests) -> () throws -> Void)] {
return [
("testReadFromByteBuffer", testReadFromByteBuffer),
("testWriteToByteBuffer", testWriteToByteBuffer),
]
}
}

View File

@ -1,44 +0,0 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2018-2022 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of SwiftNIO project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
//
// SOCKSServerHandshakeHandler+Tests+XCTest.swift
//
import XCTest
///
/// NOTE: This file was generated by generate_linux_tests.rb
///
/// Do NOT edit this file directly as it will be regenerated automatically when needed.
///
extension SOCKSServerHandlerTests {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (SOCKSServerHandlerTests) -> () throws -> Void)] {
return [
("testTypicalWorkflow", testTypicalWorkflow),
("testTypicalWorkflowDripfeed", testTypicalWorkflowDripfeed),
("testInboundErrorsAreHandled", testInboundErrorsAreHandled),
("testOutboundErrorsAreHandled", testOutboundErrorsAreHandled),
("testFlushOnHandlerRemoved", testFlushOnHandlerRemoved),
("testForceHandlerRemovalAfterAuth", testForceHandlerRemovalAfterAuth),
("testAutoAuthenticationComplete", testAutoAuthenticationComplete),
("testAutoAuthenticationCompleteWithManualCompletion", testAutoAuthenticationCompleteWithManualCompletion),
("testEagerClientRequestBeforeAuthenticationComplete", testEagerClientRequestBeforeAuthenticationComplete),
("testManualAuthenticationFailureExtraBytes", testManualAuthenticationFailureExtraBytes),
("testManualAuthenticationFailureInvalidCompletion", testManualAuthenticationFailureInvalidCompletion),
]
}
}

View File

@ -1,34 +0,0 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2018-2022 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of SwiftNIO project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
//
// ServerResponse+Tests+XCTest.swift
//
import XCTest
///
/// NOTE: This file was generated by generate_linux_tests.rb
///
/// Do NOT edit this file directly as it will be regenerated automatically when needed.
///
extension ServerResponseTests {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (ServerResponseTests) -> () throws -> Void)] {
return [
("testServerResponseReadFromByteBuffer", testServerResponseReadFromByteBuffer),
]
}
}

View File

@ -1,36 +0,0 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2018-2022 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of SwiftNIO project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
//
// ServerStateMachine+Tests+XCTest.swift
//
import XCTest
///
/// NOTE: This file was generated by generate_linux_tests.rb
///
/// Do NOT edit this file directly as it will be regenerated automatically when needed.
///
extension ServerStateMachineTests {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (ServerStateMachineTests) -> () throws -> Void)] {
return [
("testUsualWorkflow", testUsualWorkflow),
("testErrorsAreHandled", testErrorsAreHandled),
("testBytesArentConsumedOnError", testBytesArentConsumedOnError),
]
}
}

View File

@ -1,43 +0,0 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) 2018-2022 Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of SwiftNIO project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
//
// SocksClientHandler+Tests+XCTest.swift
//
import XCTest
///
/// NOTE: This file was generated by generate_linux_tests.rb
///
/// Do NOT edit this file directly as it will be regenerated automatically when needed.
///
extension SocksClientHandlerTests {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (SocksClientHandlerTests) -> () throws -> Void)] {
return [
("testTypicalWorkflow", testTypicalWorkflow),
("testThatBufferingWorks", testThatBufferingWorks),
("testBufferingWithMark", testBufferingWithMark),
("testTypicalWorkflowDripfeed", testTypicalWorkflowDripfeed),
("testInvalidAuthenticationMethod", testInvalidAuthenticationMethod),
("testProxyConnectionFailed", testProxyConnectionFailed),
("testDelayedConnection", testDelayedConnection),
("testDelayedHandlerAdded", testDelayedHandlerAdded),
("testHandlerRemovalAfterEstablishEvent", testHandlerRemovalAfterEstablishEvent),
("testHandlerRemovalBeforeConnectionIsEstablished", testHandlerRemovalBeforeConnectionIsEstablished),
]
}
}

View File

@ -1,19 +0,0 @@
version: "3"
services:
runtime-setup:
image: swift-nio-extras:20.04-5.5
build:
args:
ubuntu_version: "focal"
swift_version: "5.5"
documentation-check:
image: swift-nio-extras:20.04-5.5
test:
image: swift-nio-extras:20.04-5.5
shell:
image: swift-nio-extras:20.04-5.5

View File

@ -1,290 +0,0 @@
#!/usr/bin/env ruby
#
# process_test_files.rb
#
# Copyright 2016 Tony Stone
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Created by Tony Stone on 5/4/16.
#
require 'date'
require 'getoptlong'
require 'fileutils'
require 'pathname'
include FileUtils
#
# This ruby script will auto generate LinuxMain.swift and the +XCTest.swift extension files for Swift Package Manager on Linux platforms.
#
def extractCopyright(log)
startYear = 0
endYear = 0
indices = log.enum_for(:scan, /(?=Date:)/).map do
Regexp.last_match.offset(0).first
end
# If there are no years, assume this year.
if indices.count == 0
return "#{Date.today.year}"
end
# Return one year if there is only one year
if indices.count == 1
year = log[indices[0]+27..indices[0]+31]
return "#{year}"
end
# Return a year range
indices.each_with_index do |ind, i|
year = log[ind+27..ind+31]
# Seed start year
if i == 0
startYear = Integer(year)
end
# For all other years following
if Integer(year) > endYear
endYear = Integer(year)
end
if Integer(year) < startYear
startYear = Integer(year)
end
end
# If the years end up being the same
if startYear == endYear
return "#{startYear}"
end
# Otherwise, return the year range
return "#{startYear}-#{endYear}"
end
def header(fileName)
log = %x(git log --follow -p #{fileName})
copyrightYears = extractCopyright(log).strip
string = <<-eos
//===----------------------------------------------------------------------===//
//
// This source file is part of the SwiftNIO open source project
//
// Copyright (c) #{copyrightYears} Apple Inc. and the SwiftNIO project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of SwiftNIO project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
//
// <FileName>
//
import XCTest
///
/// NOTE: This file was generated by generate_linux_tests.rb
///
/// Do NOT edit this file directly as it will be regenerated automatically when needed.
///
eos
string
.sub('<FileName>', File.basename(fileName))
.sub('<Date>', Time.now.to_s)
end
def createExtensionFile(fileName, classes)
extensionFile = fileName.sub! '.swift', '+XCTest.swift'
print 'Creating file: ' + extensionFile + "\n"
File.open(extensionFile, 'w') do |file|
file.write header(extensionFile)
file.write "\n"
for classArray in classes
file.write 'extension ' + classArray[0] + " {\n\n"
file.write ' @available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")' +"\n"
file.write ' static var allTests : [(String, (' + classArray[0] + ") -> () throws -> Void)] {\n"
file.write " return [\n"
for funcName in classArray[1]
file.write ' ("' + funcName + '", ' + funcName + "),\n"
end
file.write " ]\n"
file.write " }\n"
file.write "}\n\n"
end
end
end
def createLinuxMain(testsDirectory, allTestSubDirectories, files)
fileName = testsDirectory + '/LinuxMain.swift'
print 'Creating file: ' + fileName + "\n"
File.open(fileName, 'w') do |file|
file.write header(fileName)
file.write "\n"
file.write "#if !compiler(>=5.5)\n"
file.write "#if os(Linux) || os(FreeBSD) || os(Android)\n"
for testSubDirectory in allTestSubDirectories.sort { |x, y| x <=> y }
file.write ' @testable import ' + testSubDirectory + "\n"
end
file.write "\n"
file.write '@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")' + "\n"
file.write "@main\n"
file.write "class LinuxMainRunner {\n"
file.write ' @available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")' + "\n"
file.write " static func main() {\n"
file.write " XCTMain([\n"
testCases = []
for classes in files
for classArray in classes
testCases << classArray[0]
end
end
for testCase in testCases.sort { |x, y| x <=> y }
file.write ' testCase(' + testCase + ".allTests),\n"
end
file.write " ])\n"
file.write " }\n"
file.write "}\n"
file.write "#endif\n"
file.write "#else\n"
file.write "#error(\"on Swift 5.5 and newer, --enable-test-discovery is required\")\n"
file.write "#endif\n"
end
end
def parseSourceFile(fileName)
puts 'Parsing file: ' + fileName + "\n"
classes = []
currentClass = nil
inIfLinux = false
inElse = false
ignore = false
#
# Read the file line by line
# and parse to find the class
# names and func names
#
File.readlines(fileName).each do |line|
if inIfLinux
if /\#else/.match(line)
inElse = true
ignore = true
else
if /\#end/.match(line)
inElse = false
inIfLinux = false
ignore = false
end
end
else
if /\#if[ \t]+os\(Linux\)/.match(line)
inIfLinux = true
ignore = false
end
end
next if ignore
# Match class or func
match = line[/class[ \t]+[a-zA-Z0-9_]*(?=[ \t]*:[ \t]*XCTestCase)|func[ \t]+test[a-zA-Z0-9_]*(?=[ \t]*\(\))/, 0]
if match
if match[/class/, 0] == 'class'
className = match.sub(/^class[ \t]+/, '')
#
# Create a new class / func structure
# and add it to the classes array.
#
currentClass = [className, []]
classes << currentClass
else # Must be a func
funcName = match.sub(/^func[ \t]+/, '')
#
# Add each func name the the class / func
# structure created above.
#
currentClass[1] << funcName
end
end
end
classes
end
#
# Main routine
#
#
testsDirectory = 'Tests'
options = GetoptLong.new(['--tests-dir', GetoptLong::OPTIONAL_ARGUMENT])
options.quiet = true
begin
options.each do |option, value|
case option
when '--tests-dir'
testsDirectory = value
end
end
rescue GetoptLong::InvalidOption
end
allTestSubDirectories = []
allFiles = []
Dir[testsDirectory + '/*'].each do |subDirectory|
next unless File.directory?(subDirectory)
directoryHasClasses = false
Dir[subDirectory + '/*Test{s,}.swift'].each do |fileName|
next unless File.file? fileName
fileClasses = parseSourceFile(fileName)
#
# If there are classes in the
# test source file, create an extension
# file for it.
#
next unless fileClasses.count > 0
createExtensionFile(fileName, fileClasses)
directoryHasClasses = true
allFiles << fileClasses
end
if directoryHasClasses
allTestSubDirectories << Pathname.new(subDirectory).split.last.to_s
end
end
#
# Last step is the create a LinuxMain.swift file that
# references all the classes and funcs in the source files.
#
if allFiles.count > 0
createLinuxMain(testsDirectory, allTestSubDirectories, allFiles)
end
# eof

View File

@ -21,18 +21,6 @@ function replace_acceptable_years() {
sed -e 's/20[12][7890123]-20[12][7890123]/YEARS/' -e 's/20[12][890123]/YEARS/'
}
printf "=> Checking linux tests... "
FIRST_OUT="$(git status --porcelain)"
ruby "$here/../scripts/generate_linux_tests.rb" > /dev/null
SECOND_OUT="$(git status --porcelain)"
if [[ "$FIRST_OUT" != "$SECOND_OUT" ]]; then
printf "\033[0;31mmissing changes!\033[0m\n"
git --no-pager diff
exit 1
else
printf "\033[0;32mokay.\033[0m\n"
fi
printf "=> Checking for unacceptable language... "
# This greps for unacceptable terminology. The square bracket[s] are so that
# "git grep" doesn't find the lines that greps :).