mirror of
https://github.com/apple/swift-nio-extras.git
synced 2025-05-15 17:38:53 +08:00
update generated test script from swift-nio (#188)
The newer version of the script automatically calculates accurate copyright date statements.
This commit is contained in:
parent
b89549b289
commit
54def83a52
@ -2,7 +2,7 @@
|
|||||||
//
|
//
|
||||||
// This source file is part of the SwiftNIO open source project
|
// This source file is part of the SwiftNIO open source project
|
||||||
//
|
//
|
||||||
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
|
// Copyright (c) 2018-2022 Apple Inc. and the SwiftNIO project authors
|
||||||
// Licensed under Apache License v2.0
|
// Licensed under Apache License v2.0
|
||||||
//
|
//
|
||||||
// See LICENSE.txt for license information
|
// See LICENSE.txt for license information
|
||||||
@ -22,36 +22,47 @@ import XCTest
|
|||||||
/// Do NOT edit this file directly as it will be regenerated automatically when needed.
|
/// Do NOT edit this file directly as it will be regenerated automatically when needed.
|
||||||
///
|
///
|
||||||
|
|
||||||
#if os(Linux) || os(FreeBSD)
|
#if !compiler(>=5.5)
|
||||||
|
#if os(Linux) || os(FreeBSD) || os(Android)
|
||||||
@testable import NIOExtrasTests
|
@testable import NIOExtrasTests
|
||||||
@testable import NIOHTTPCompressionTests
|
@testable import NIOHTTPCompressionTests
|
||||||
@testable import NIOSOCKSTests
|
@testable import NIOSOCKSTests
|
||||||
|
|
||||||
XCTMain([
|
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
|
||||||
testCase(ClientGreetingTests.allTests),
|
@main
|
||||||
testCase(ClientRequestTests.allTests),
|
class LinuxMainRunner {
|
||||||
testCase(ClientStateMachineTests.allTests),
|
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
|
||||||
testCase(DebugInboundEventsHandlerTest.allTests),
|
static func main() {
|
||||||
testCase(DebugOutboundEventsHandlerTest.allTests),
|
XCTMain([
|
||||||
testCase(FixedLengthFrameDecoderTest.allTests),
|
testCase(ClientGreetingTests.allTests),
|
||||||
testCase(HTTPRequestCompressorTest.allTests),
|
testCase(ClientRequestTests.allTests),
|
||||||
testCase(HTTPRequestDecompressorTest.allTests),
|
testCase(ClientStateMachineTests.allTests),
|
||||||
testCase(HTTPResponseCompressorTest.allTests),
|
testCase(DebugInboundEventsHandlerTest.allTests),
|
||||||
testCase(HTTPResponseDecompressorTest.allTests),
|
testCase(DebugOutboundEventsHandlerTest.allTests),
|
||||||
testCase(HelperTests.allTests),
|
testCase(FixedLengthFrameDecoderTest.allTests),
|
||||||
testCase(JSONRPCFramingContentLengthHeaderDecoderTests.allTests),
|
testCase(HTTPRequestCompressorTest.allTests),
|
||||||
testCase(JSONRPCFramingContentLengthHeaderEncoderTests.allTests),
|
testCase(HTTPRequestDecompressorTest.allTests),
|
||||||
testCase(LengthFieldBasedFrameDecoderTest.allTests),
|
testCase(HTTPResponseCompressorTest.allTests),
|
||||||
testCase(LengthFieldPrependerTest.allTests),
|
testCase(HTTPResponseDecompressorTest.allTests),
|
||||||
testCase(LineBasedFrameDecoderTest.allTests),
|
testCase(HelperTests.allTests),
|
||||||
testCase(MethodSelectionTests.allTests),
|
testCase(JSONRPCFramingContentLengthHeaderDecoderTests.allTests),
|
||||||
testCase(PCAPRingBufferTest.allTests),
|
testCase(JSONRPCFramingContentLengthHeaderEncoderTests.allTests),
|
||||||
testCase(QuiescingHelperTest.allTests),
|
testCase(LengthFieldBasedFrameDecoderTest.allTests),
|
||||||
testCase(RequestResponseHandlerTest.allTests),
|
testCase(LengthFieldPrependerTest.allTests),
|
||||||
testCase(SOCKSServerHandlerTests.allTests),
|
testCase(LineBasedFrameDecoderTest.allTests),
|
||||||
testCase(ServerResponseTests.allTests),
|
testCase(MethodSelectionTests.allTests),
|
||||||
testCase(ServerStateMachineTests.allTests),
|
testCase(PCAPRingBufferTest.allTests),
|
||||||
testCase(SocksClientHandlerTests.allTests),
|
testCase(QuiescingHelperTest.allTests),
|
||||||
testCase(WritePCAPHandlerTest.allTests),
|
testCase(RequestResponseHandlerTest.allTests),
|
||||||
])
|
testCase(SOCKSServerHandlerTests.allTests),
|
||||||
|
testCase(ServerResponseTests.allTests),
|
||||||
|
testCase(ServerStateMachineTests.allTests),
|
||||||
|
testCase(SocksClientHandlerTests.allTests),
|
||||||
|
testCase(WritePCAPHandlerTest.allTests),
|
||||||
|
])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#error("on Swift 5.5 and newer, --enable-test-discovery is required")
|
||||||
#endif
|
#endif
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
//
|
//
|
||||||
// This source file is part of the SwiftNIO open source project
|
// This source file is part of the SwiftNIO open source project
|
||||||
//
|
//
|
||||||
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
|
// Copyright (c) 2018-2022 Apple Inc. and the SwiftNIO project authors
|
||||||
// Licensed under Apache License v2.0
|
// Licensed under Apache License v2.0
|
||||||
//
|
//
|
||||||
// See LICENSE.txt for license information
|
// See LICENSE.txt for license information
|
||||||
@ -24,6 +24,7 @@ import XCTest
|
|||||||
|
|
||||||
extension DebugInboundEventsHandlerTest {
|
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)] {
|
static var allTests : [(String, (DebugInboundEventsHandlerTest) -> () throws -> Void)] {
|
||||||
return [
|
return [
|
||||||
("testRegistered", testRegistered),
|
("testRegistered", testRegistered),
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
//
|
//
|
||||||
// This source file is part of the SwiftNIO open source project
|
// This source file is part of the SwiftNIO open source project
|
||||||
//
|
//
|
||||||
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
|
// Copyright (c) 2018-2022 Apple Inc. and the SwiftNIO project authors
|
||||||
// Licensed under Apache License v2.0
|
// Licensed under Apache License v2.0
|
||||||
//
|
//
|
||||||
// See LICENSE.txt for license information
|
// See LICENSE.txt for license information
|
||||||
@ -24,6 +24,7 @@ import XCTest
|
|||||||
|
|
||||||
extension DebugOutboundEventsHandlerTest {
|
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)] {
|
static var allTests : [(String, (DebugOutboundEventsHandlerTest) -> () throws -> Void)] {
|
||||||
return [
|
return [
|
||||||
("testRegister", testRegister),
|
("testRegister", testRegister),
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
//
|
//
|
||||||
// This source file is part of the SwiftNIO open source project
|
// This source file is part of the SwiftNIO open source project
|
||||||
//
|
//
|
||||||
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
|
// Copyright (c) 2018-2022 Apple Inc. and the SwiftNIO project authors
|
||||||
// Licensed under Apache License v2.0
|
// Licensed under Apache License v2.0
|
||||||
//
|
//
|
||||||
// See LICENSE.txt for license information
|
// See LICENSE.txt for license information
|
||||||
@ -24,6 +24,7 @@ import XCTest
|
|||||||
|
|
||||||
extension FixedLengthFrameDecoderTest {
|
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)] {
|
static var allTests : [(String, (FixedLengthFrameDecoderTest) -> () throws -> Void)] {
|
||||||
return [
|
return [
|
||||||
("testDecodeIfFewerBytesAreSent", testDecodeIfFewerBytesAreSent),
|
("testDecodeIfFewerBytesAreSent", testDecodeIfFewerBytesAreSent),
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
//
|
//
|
||||||
// This source file is part of the SwiftNIO open source project
|
// This source file is part of the SwiftNIO open source project
|
||||||
//
|
//
|
||||||
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
|
// Copyright (c) 2019-2022 Apple Inc. and the SwiftNIO project authors
|
||||||
// Licensed under Apache License v2.0
|
// Licensed under Apache License v2.0
|
||||||
//
|
//
|
||||||
// See LICENSE.txt for license information
|
// See LICENSE.txt for license information
|
||||||
@ -24,6 +24,7 @@ import XCTest
|
|||||||
|
|
||||||
extension JSONRPCFramingContentLengthHeaderDecoderTests {
|
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)] {
|
static var allTests : [(String, (JSONRPCFramingContentLengthHeaderDecoderTests) -> () throws -> Void)] {
|
||||||
return [
|
return [
|
||||||
("testBasicMessage", testBasicMessage),
|
("testBasicMessage", testBasicMessage),
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
//
|
//
|
||||||
// This source file is part of the SwiftNIO open source project
|
// This source file is part of the SwiftNIO open source project
|
||||||
//
|
//
|
||||||
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
|
// Copyright (c) 2018-2022 Apple Inc. and the SwiftNIO project authors
|
||||||
// Licensed under Apache License v2.0
|
// Licensed under Apache License v2.0
|
||||||
//
|
//
|
||||||
// See LICENSE.txt for license information
|
// See LICENSE.txt for license information
|
||||||
@ -24,6 +24,7 @@ import XCTest
|
|||||||
|
|
||||||
extension JSONRPCFramingContentLengthHeaderEncoderTests {
|
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)] {
|
static var allTests : [(String, (JSONRPCFramingContentLengthHeaderEncoderTests) -> () throws -> Void)] {
|
||||||
return [
|
return [
|
||||||
("testEmptyMessage", testEmptyMessage),
|
("testEmptyMessage", testEmptyMessage),
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
//
|
//
|
||||||
// This source file is part of the SwiftNIO open source project
|
// This source file is part of the SwiftNIO open source project
|
||||||
//
|
//
|
||||||
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
|
// Copyright (c) 2018-2022 Apple Inc. and the SwiftNIO project authors
|
||||||
// Licensed under Apache License v2.0
|
// Licensed under Apache License v2.0
|
||||||
//
|
//
|
||||||
// See LICENSE.txt for license information
|
// See LICENSE.txt for license information
|
||||||
@ -24,6 +24,7 @@ import XCTest
|
|||||||
|
|
||||||
extension LengthFieldBasedFrameDecoderTest {
|
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)] {
|
static var allTests : [(String, (LengthFieldBasedFrameDecoderTest) -> () throws -> Void)] {
|
||||||
return [
|
return [
|
||||||
("testReadUInt32From3Bytes", testReadUInt32From3Bytes),
|
("testReadUInt32From3Bytes", testReadUInt32From3Bytes),
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
//
|
//
|
||||||
// This source file is part of the SwiftNIO open source project
|
// This source file is part of the SwiftNIO open source project
|
||||||
//
|
//
|
||||||
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
|
// Copyright (c) 2019-2022 Apple Inc. and the SwiftNIO project authors
|
||||||
// Licensed under Apache License v2.0
|
// Licensed under Apache License v2.0
|
||||||
//
|
//
|
||||||
// See LICENSE.txt for license information
|
// See LICENSE.txt for license information
|
||||||
@ -24,6 +24,7 @@ import XCTest
|
|||||||
|
|
||||||
extension LengthFieldPrependerTest {
|
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)] {
|
static var allTests : [(String, (LengthFieldPrependerTest) -> () throws -> Void)] {
|
||||||
return [
|
return [
|
||||||
("testWrite3BytesOfUInt32Write", testWrite3BytesOfUInt32Write),
|
("testWrite3BytesOfUInt32Write", testWrite3BytesOfUInt32Write),
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
//
|
//
|
||||||
// This source file is part of the SwiftNIO open source project
|
// This source file is part of the SwiftNIO open source project
|
||||||
//
|
//
|
||||||
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
|
// Copyright (c) 2018-2022 Apple Inc. and the SwiftNIO project authors
|
||||||
// Licensed under Apache License v2.0
|
// Licensed under Apache License v2.0
|
||||||
//
|
//
|
||||||
// See LICENSE.txt for license information
|
// See LICENSE.txt for license information
|
||||||
@ -24,6 +24,7 @@ import XCTest
|
|||||||
|
|
||||||
extension LineBasedFrameDecoderTest {
|
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)] {
|
static var allTests : [(String, (LineBasedFrameDecoderTest) -> () throws -> Void)] {
|
||||||
return [
|
return [
|
||||||
("testDecodeOneCharacterAtATime", testDecodeOneCharacterAtATime),
|
("testDecodeOneCharacterAtATime", testDecodeOneCharacterAtATime),
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
//
|
//
|
||||||
// This source file is part of the SwiftNIO open source project
|
// This source file is part of the SwiftNIO open source project
|
||||||
//
|
//
|
||||||
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
|
// Copyright (c) 2018-2022 Apple Inc. and the SwiftNIO project authors
|
||||||
// Licensed under Apache License v2.0
|
// Licensed under Apache License v2.0
|
||||||
//
|
//
|
||||||
// See LICENSE.txt for license information
|
// See LICENSE.txt for license information
|
||||||
@ -24,6 +24,7 @@ import XCTest
|
|||||||
|
|
||||||
extension PCAPRingBufferTest {
|
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)] {
|
static var allTests : [(String, (PCAPRingBufferTest) -> () throws -> Void)] {
|
||||||
return [
|
return [
|
||||||
("testNotLimited", testNotLimited),
|
("testNotLimited", testNotLimited),
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
//
|
//
|
||||||
// This source file is part of the SwiftNIO open source project
|
// This source file is part of the SwiftNIO open source project
|
||||||
//
|
//
|
||||||
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
|
// Copyright (c) 2018-2022 Apple Inc. and the SwiftNIO project authors
|
||||||
// Licensed under Apache License v2.0
|
// Licensed under Apache License v2.0
|
||||||
//
|
//
|
||||||
// See LICENSE.txt for license information
|
// See LICENSE.txt for license information
|
||||||
@ -24,6 +24,7 @@ import XCTest
|
|||||||
|
|
||||||
extension QuiescingHelperTest {
|
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)] {
|
static var allTests : [(String, (QuiescingHelperTest) -> () throws -> Void)] {
|
||||||
return [
|
return [
|
||||||
("testShutdownIsImmediateWhenNoChannelsCollected", testShutdownIsImmediateWhenNoChannelsCollected),
|
("testShutdownIsImmediateWhenNoChannelsCollected", testShutdownIsImmediateWhenNoChannelsCollected),
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
//
|
//
|
||||||
// This source file is part of the SwiftNIO open source project
|
// This source file is part of the SwiftNIO open source project
|
||||||
//
|
//
|
||||||
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
|
// Copyright (c) 2018-2022 Apple Inc. and the SwiftNIO project authors
|
||||||
// Licensed under Apache License v2.0
|
// Licensed under Apache License v2.0
|
||||||
//
|
//
|
||||||
// See LICENSE.txt for license information
|
// See LICENSE.txt for license information
|
||||||
@ -24,6 +24,7 @@ import XCTest
|
|||||||
|
|
||||||
extension RequestResponseHandlerTest {
|
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)] {
|
static var allTests : [(String, (RequestResponseHandlerTest) -> () throws -> Void)] {
|
||||||
return [
|
return [
|
||||||
("testSimpleRequestWorks", testSimpleRequestWorks),
|
("testSimpleRequestWorks", testSimpleRequestWorks),
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
//
|
//
|
||||||
// This source file is part of the SwiftNIO open source project
|
// This source file is part of the SwiftNIO open source project
|
||||||
//
|
//
|
||||||
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
|
// Copyright (c) 2019-2022 Apple Inc. and the SwiftNIO project authors
|
||||||
// Licensed under Apache License v2.0
|
// Licensed under Apache License v2.0
|
||||||
//
|
//
|
||||||
// See LICENSE.txt for license information
|
// See LICENSE.txt for license information
|
||||||
@ -24,6 +24,7 @@ import XCTest
|
|||||||
|
|
||||||
extension WritePCAPHandlerTest {
|
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)] {
|
static var allTests : [(String, (WritePCAPHandlerTest) -> () throws -> Void)] {
|
||||||
return [
|
return [
|
||||||
("testConnectIssuesThreePacketsForIPv4", testConnectIssuesThreePacketsForIPv4),
|
("testConnectIssuesThreePacketsForIPv4", testConnectIssuesThreePacketsForIPv4),
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
//
|
//
|
||||||
// This source file is part of the SwiftNIO open source project
|
// This source file is part of the SwiftNIO open source project
|
||||||
//
|
//
|
||||||
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
|
// Copyright (c) 2020-2022 Apple Inc. and the SwiftNIO project authors
|
||||||
// Licensed under Apache License v2.0
|
// Licensed under Apache License v2.0
|
||||||
//
|
//
|
||||||
// See LICENSE.txt for license information
|
// See LICENSE.txt for license information
|
||||||
@ -24,6 +24,7 @@ import XCTest
|
|||||||
|
|
||||||
extension HTTPRequestCompressorTest {
|
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)] {
|
static var allTests : [(String, (HTTPRequestCompressorTest) -> () throws -> Void)] {
|
||||||
return [
|
return [
|
||||||
("testGzipContentEncoding", testGzipContentEncoding),
|
("testGzipContentEncoding", testGzipContentEncoding),
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
//
|
//
|
||||||
// This source file is part of the SwiftNIO open source project
|
// This source file is part of the SwiftNIO open source project
|
||||||
//
|
//
|
||||||
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
|
// Copyright (c) 2018-2022 Apple Inc. and the SwiftNIO project authors
|
||||||
// Licensed under Apache License v2.0
|
// Licensed under Apache License v2.0
|
||||||
//
|
//
|
||||||
// See LICENSE.txt for license information
|
// See LICENSE.txt for license information
|
||||||
@ -24,6 +24,7 @@ import XCTest
|
|||||||
|
|
||||||
extension HTTPRequestDecompressorTest {
|
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)] {
|
static var allTests : [(String, (HTTPRequestDecompressorTest) -> () throws -> Void)] {
|
||||||
return [
|
return [
|
||||||
("testDecompressionNoLimit", testDecompressionNoLimit),
|
("testDecompressionNoLimit", testDecompressionNoLimit),
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
//
|
//
|
||||||
// This source file is part of the SwiftNIO open source project
|
// This source file is part of the SwiftNIO open source project
|
||||||
//
|
//
|
||||||
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
|
// Copyright (c) 2019-2022 Apple Inc. and the SwiftNIO project authors
|
||||||
// Licensed under Apache License v2.0
|
// Licensed under Apache License v2.0
|
||||||
//
|
//
|
||||||
// See LICENSE.txt for license information
|
// See LICENSE.txt for license information
|
||||||
@ -24,6 +24,7 @@ import XCTest
|
|||||||
|
|
||||||
extension HTTPResponseCompressorTest {
|
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)] {
|
static var allTests : [(String, (HTTPResponseCompressorTest) -> () throws -> Void)] {
|
||||||
return [
|
return [
|
||||||
("testCanCompressSimpleBodies", testCanCompressSimpleBodies),
|
("testCanCompressSimpleBodies", testCanCompressSimpleBodies),
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
//
|
//
|
||||||
// This source file is part of the SwiftNIO open source project
|
// This source file is part of the SwiftNIO open source project
|
||||||
//
|
//
|
||||||
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
|
// Copyright (c) 2018-2022 Apple Inc. and the SwiftNIO project authors
|
||||||
// Licensed under Apache License v2.0
|
// Licensed under Apache License v2.0
|
||||||
//
|
//
|
||||||
// See LICENSE.txt for license information
|
// See LICENSE.txt for license information
|
||||||
@ -24,6 +24,7 @@ import XCTest
|
|||||||
|
|
||||||
extension HTTPResponseDecompressorTest {
|
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)] {
|
static var allTests : [(String, (HTTPResponseDecompressorTest) -> () throws -> Void)] {
|
||||||
return [
|
return [
|
||||||
("testDecompressionNoLimit", testDecompressionNoLimit),
|
("testDecompressionNoLimit", testDecompressionNoLimit),
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
//
|
//
|
||||||
// This source file is part of the SwiftNIO open source project
|
// This source file is part of the SwiftNIO open source project
|
||||||
//
|
//
|
||||||
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
|
// Copyright (c) 2018-2022 Apple Inc. and the SwiftNIO project authors
|
||||||
// Licensed under Apache License v2.0
|
// Licensed under Apache License v2.0
|
||||||
//
|
//
|
||||||
// See LICENSE.txt for license information
|
// See LICENSE.txt for license information
|
||||||
@ -24,6 +24,7 @@ import XCTest
|
|||||||
|
|
||||||
extension ClientGreetingTests {
|
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)] {
|
static var allTests : [(String, (ClientGreetingTests) -> () throws -> Void)] {
|
||||||
return [
|
return [
|
||||||
("testInitFromBuffer", testInitFromBuffer),
|
("testInitFromBuffer", testInitFromBuffer),
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
//
|
//
|
||||||
// This source file is part of the SwiftNIO open source project
|
// This source file is part of the SwiftNIO open source project
|
||||||
//
|
//
|
||||||
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
|
// Copyright (c) 2018-2022 Apple Inc. and the SwiftNIO project authors
|
||||||
// Licensed under Apache License v2.0
|
// Licensed under Apache License v2.0
|
||||||
//
|
//
|
||||||
// See LICENSE.txt for license information
|
// See LICENSE.txt for license information
|
||||||
@ -24,6 +24,7 @@ import XCTest
|
|||||||
|
|
||||||
extension ClientRequestTests {
|
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)] {
|
static var allTests : [(String, (ClientRequestTests) -> () throws -> Void)] {
|
||||||
return [
|
return [
|
||||||
("testWriteClientRequest", testWriteClientRequest),
|
("testWriteClientRequest", testWriteClientRequest),
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
//
|
//
|
||||||
// This source file is part of the SwiftNIO open source project
|
// This source file is part of the SwiftNIO open source project
|
||||||
//
|
//
|
||||||
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
|
// Copyright (c) 2018-2022 Apple Inc. and the SwiftNIO project authors
|
||||||
// Licensed under Apache License v2.0
|
// Licensed under Apache License v2.0
|
||||||
//
|
//
|
||||||
// See LICENSE.txt for license information
|
// See LICENSE.txt for license information
|
||||||
@ -24,6 +24,7 @@ import XCTest
|
|||||||
|
|
||||||
extension ClientStateMachineTests {
|
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)] {
|
static var allTests : [(String, (ClientStateMachineTests) -> () throws -> Void)] {
|
||||||
return [
|
return [
|
||||||
("testUsualWorkflow", testUsualWorkflow),
|
("testUsualWorkflow", testUsualWorkflow),
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
//
|
//
|
||||||
// This source file is part of the SwiftNIO open source project
|
// This source file is part of the SwiftNIO open source project
|
||||||
//
|
//
|
||||||
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
|
// Copyright (c) 2018-2022 Apple Inc. and the SwiftNIO project authors
|
||||||
// Licensed under Apache License v2.0
|
// Licensed under Apache License v2.0
|
||||||
//
|
//
|
||||||
// See LICENSE.txt for license information
|
// See LICENSE.txt for license information
|
||||||
@ -24,6 +24,7 @@ import XCTest
|
|||||||
|
|
||||||
extension HelperTests {
|
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)] {
|
static var allTests : [(String, (HelperTests) -> () throws -> Void)] {
|
||||||
return [
|
return [
|
||||||
("testUnwindingReturnNil", testUnwindingReturnNil),
|
("testUnwindingReturnNil", testUnwindingReturnNil),
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
//
|
//
|
||||||
// This source file is part of the SwiftNIO open source project
|
// This source file is part of the SwiftNIO open source project
|
||||||
//
|
//
|
||||||
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
|
// Copyright (c) 2018-2022 Apple Inc. and the SwiftNIO project authors
|
||||||
// Licensed under Apache License v2.0
|
// Licensed under Apache License v2.0
|
||||||
//
|
//
|
||||||
// See LICENSE.txt for license information
|
// See LICENSE.txt for license information
|
||||||
@ -24,6 +24,7 @@ import XCTest
|
|||||||
|
|
||||||
extension MethodSelectionTests {
|
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)] {
|
static var allTests : [(String, (MethodSelectionTests) -> () throws -> Void)] {
|
||||||
return [
|
return [
|
||||||
("testReadFromByteBuffer", testReadFromByteBuffer),
|
("testReadFromByteBuffer", testReadFromByteBuffer),
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
//
|
//
|
||||||
// This source file is part of the SwiftNIO open source project
|
// This source file is part of the SwiftNIO open source project
|
||||||
//
|
//
|
||||||
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
|
// Copyright (c) 2018-2022 Apple Inc. and the SwiftNIO project authors
|
||||||
// Licensed under Apache License v2.0
|
// Licensed under Apache License v2.0
|
||||||
//
|
//
|
||||||
// See LICENSE.txt for license information
|
// See LICENSE.txt for license information
|
||||||
@ -24,6 +24,7 @@ import XCTest
|
|||||||
|
|
||||||
extension SOCKSServerHandlerTests {
|
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)] {
|
static var allTests : [(String, (SOCKSServerHandlerTests) -> () throws -> Void)] {
|
||||||
return [
|
return [
|
||||||
("testTypicalWorkflow", testTypicalWorkflow),
|
("testTypicalWorkflow", testTypicalWorkflow),
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
//
|
//
|
||||||
// This source file is part of the SwiftNIO open source project
|
// This source file is part of the SwiftNIO open source project
|
||||||
//
|
//
|
||||||
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
|
// Copyright (c) 2018-2022 Apple Inc. and the SwiftNIO project authors
|
||||||
// Licensed under Apache License v2.0
|
// Licensed under Apache License v2.0
|
||||||
//
|
//
|
||||||
// See LICENSE.txt for license information
|
// See LICENSE.txt for license information
|
||||||
@ -24,6 +24,7 @@ import XCTest
|
|||||||
|
|
||||||
extension ServerResponseTests {
|
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)] {
|
static var allTests : [(String, (ServerResponseTests) -> () throws -> Void)] {
|
||||||
return [
|
return [
|
||||||
("testServerResponseReadFromByteBuffer", testServerResponseReadFromByteBuffer),
|
("testServerResponseReadFromByteBuffer", testServerResponseReadFromByteBuffer),
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
//
|
//
|
||||||
// This source file is part of the SwiftNIO open source project
|
// This source file is part of the SwiftNIO open source project
|
||||||
//
|
//
|
||||||
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
|
// Copyright (c) 2018-2022 Apple Inc. and the SwiftNIO project authors
|
||||||
// Licensed under Apache License v2.0
|
// Licensed under Apache License v2.0
|
||||||
//
|
//
|
||||||
// See LICENSE.txt for license information
|
// See LICENSE.txt for license information
|
||||||
@ -24,6 +24,7 @@ import XCTest
|
|||||||
|
|
||||||
extension ServerStateMachineTests {
|
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)] {
|
static var allTests : [(String, (ServerStateMachineTests) -> () throws -> Void)] {
|
||||||
return [
|
return [
|
||||||
("testUsualWorkflow", testUsualWorkflow),
|
("testUsualWorkflow", testUsualWorkflow),
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
//
|
//
|
||||||
// This source file is part of the SwiftNIO open source project
|
// This source file is part of the SwiftNIO open source project
|
||||||
//
|
//
|
||||||
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
|
// Copyright (c) 2018-2022 Apple Inc. and the SwiftNIO project authors
|
||||||
// Licensed under Apache License v2.0
|
// Licensed under Apache License v2.0
|
||||||
//
|
//
|
||||||
// See LICENSE.txt for license information
|
// See LICENSE.txt for license information
|
||||||
@ -24,6 +24,7 @@ import XCTest
|
|||||||
|
|
||||||
extension SocksClientHandlerTests {
|
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)] {
|
static var allTests : [(String, (SocksClientHandlerTests) -> () throws -> Void)] {
|
||||||
return [
|
return [
|
||||||
("testTypicalWorkflow", testTypicalWorkflow),
|
("testTypicalWorkflow", testTypicalWorkflow),
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
#
|
#
|
||||||
# Created by Tony Stone on 5/4/16.
|
# Created by Tony Stone on 5/4/16.
|
||||||
#
|
#
|
||||||
|
require 'date'
|
||||||
require 'getoptlong'
|
require 'getoptlong'
|
||||||
require 'fileutils'
|
require 'fileutils'
|
||||||
require 'pathname'
|
require 'pathname'
|
||||||
@ -28,13 +29,61 @@ include FileUtils
|
|||||||
#
|
#
|
||||||
# This ruby script will auto generate LinuxMain.swift and the +XCTest.swift extension files for Swift Package Manager on Linux platforms.
|
# 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)
|
def header(fileName)
|
||||||
|
log = %x(git log --follow -p #{fileName})
|
||||||
|
copyrightYears = extractCopyright(log).strip
|
||||||
|
|
||||||
string = <<-eos
|
string = <<-eos
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
//
|
//
|
||||||
// This source file is part of the SwiftNIO open source project
|
// This source file is part of the SwiftNIO open source project
|
||||||
//
|
//
|
||||||
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
|
// Copyright (c) #{copyrightYears} Apple Inc. and the SwiftNIO project authors
|
||||||
// Licensed under Apache License v2.0
|
// Licensed under Apache License v2.0
|
||||||
//
|
//
|
||||||
// See LICENSE.txt for license information
|
// See LICENSE.txt for license information
|
||||||
@ -70,6 +119,7 @@ def createExtensionFile(fileName, classes)
|
|||||||
|
|
||||||
for classArray in classes
|
for classArray in classes
|
||||||
file.write 'extension ' + classArray[0] + " {\n\n"
|
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 ' static var allTests : [(String, (' + classArray[0] + ") -> () throws -> Void)] {\n"
|
||||||
file.write " return [\n"
|
file.write " return [\n"
|
||||||
|
|
||||||
@ -92,12 +142,18 @@ def createLinuxMain(testsDirectory, allTestSubDirectories, files)
|
|||||||
file.write header(fileName)
|
file.write header(fileName)
|
||||||
file.write "\n"
|
file.write "\n"
|
||||||
|
|
||||||
file.write "#if os(Linux) || os(FreeBSD)\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 }
|
for testSubDirectory in allTestSubDirectories.sort { |x, y| x <=> y }
|
||||||
file.write ' @testable import ' + testSubDirectory + "\n"
|
file.write ' @testable import ' + testSubDirectory + "\n"
|
||||||
end
|
end
|
||||||
file.write "\n"
|
file.write "\n"
|
||||||
file.write " XCTMain([\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 = []
|
testCases = []
|
||||||
for classes in files
|
for classes in files
|
||||||
@ -107,9 +163,14 @@ def createLinuxMain(testsDirectory, allTestSubDirectories, files)
|
|||||||
end
|
end
|
||||||
|
|
||||||
for testCase in testCases.sort { |x, y| x <=> y }
|
for testCase in testCases.sort { |x, y| x <=> y }
|
||||||
file.write ' testCase(' + testCase + ".allTests),\n"
|
file.write ' testCase(' + testCase + ".allTests),\n"
|
||||||
end
|
end
|
||||||
file.write " ])\n"
|
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"
|
file.write "#endif\n"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -18,7 +18,7 @@ here="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|||||||
|
|
||||||
function replace_acceptable_years() {
|
function replace_acceptable_years() {
|
||||||
# this needs to replace all acceptable forms with 'YEARS'
|
# this needs to replace all acceptable forms with 'YEARS'
|
||||||
sed -e 's/20[12][78901]-20[12][78901]/YEARS/' -e 's/2019/YEARS/' -e 's/2020/YEARS/g' -e 's/2021/YEARS/g'
|
sed -e 's/20[12][789012]-20[12][789012]/YEARS/' -e 's/20[12][89012]/YEARS/'
|
||||||
}
|
}
|
||||||
|
|
||||||
printf "=> Checking linux tests... "
|
printf "=> Checking linux tests... "
|
||||||
|
Loading…
x
Reference in New Issue
Block a user