Skip to content

Commit 54def83

Browse files
authored
update generated test script from swift-nio (#188)
The newer version of the script automatically calculates accurate copyright date statements.
1 parent b89549b commit 54def83

28 files changed

+157
-60
lines changed

Tests/LinuxMain.swift

Lines changed: 40 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the SwiftNIO open source project
44
//
5-
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
5+
// Copyright (c) 2018-2022 Apple Inc. and the SwiftNIO project authors
66
// Licensed under Apache License v2.0
77
//
88
// See LICENSE.txt for license information
@@ -22,36 +22,47 @@ import XCTest
2222
/// Do NOT edit this file directly as it will be regenerated automatically when needed.
2323
///
2424

25-
#if os(Linux) || os(FreeBSD)
25+
#if !compiler(>=5.5)
26+
#if os(Linux) || os(FreeBSD) || os(Android)
2627
@testable import NIOExtrasTests
2728
@testable import NIOHTTPCompressionTests
2829
@testable import NIOSOCKSTests
2930

30-
XCTMain([
31-
testCase(ClientGreetingTests.allTests),
32-
testCase(ClientRequestTests.allTests),
33-
testCase(ClientStateMachineTests.allTests),
34-
testCase(DebugInboundEventsHandlerTest.allTests),
35-
testCase(DebugOutboundEventsHandlerTest.allTests),
36-
testCase(FixedLengthFrameDecoderTest.allTests),
37-
testCase(HTTPRequestCompressorTest.allTests),
38-
testCase(HTTPRequestDecompressorTest.allTests),
39-
testCase(HTTPResponseCompressorTest.allTests),
40-
testCase(HTTPResponseDecompressorTest.allTests),
41-
testCase(HelperTests.allTests),
42-
testCase(JSONRPCFramingContentLengthHeaderDecoderTests.allTests),
43-
testCase(JSONRPCFramingContentLengthHeaderEncoderTests.allTests),
44-
testCase(LengthFieldBasedFrameDecoderTest.allTests),
45-
testCase(LengthFieldPrependerTest.allTests),
46-
testCase(LineBasedFrameDecoderTest.allTests),
47-
testCase(MethodSelectionTests.allTests),
48-
testCase(PCAPRingBufferTest.allTests),
49-
testCase(QuiescingHelperTest.allTests),
50-
testCase(RequestResponseHandlerTest.allTests),
51-
testCase(SOCKSServerHandlerTests.allTests),
52-
testCase(ServerResponseTests.allTests),
53-
testCase(ServerStateMachineTests.allTests),
54-
testCase(SocksClientHandlerTests.allTests),
55-
testCase(WritePCAPHandlerTest.allTests),
56-
])
31+
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
32+
@main
33+
class LinuxMainRunner {
34+
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
35+
static func main() {
36+
XCTMain([
37+
testCase(ClientGreetingTests.allTests),
38+
testCase(ClientRequestTests.allTests),
39+
testCase(ClientStateMachineTests.allTests),
40+
testCase(DebugInboundEventsHandlerTest.allTests),
41+
testCase(DebugOutboundEventsHandlerTest.allTests),
42+
testCase(FixedLengthFrameDecoderTest.allTests),
43+
testCase(HTTPRequestCompressorTest.allTests),
44+
testCase(HTTPRequestDecompressorTest.allTests),
45+
testCase(HTTPResponseCompressorTest.allTests),
46+
testCase(HTTPResponseDecompressorTest.allTests),
47+
testCase(HelperTests.allTests),
48+
testCase(JSONRPCFramingContentLengthHeaderDecoderTests.allTests),
49+
testCase(JSONRPCFramingContentLengthHeaderEncoderTests.allTests),
50+
testCase(LengthFieldBasedFrameDecoderTest.allTests),
51+
testCase(LengthFieldPrependerTest.allTests),
52+
testCase(LineBasedFrameDecoderTest.allTests),
53+
testCase(MethodSelectionTests.allTests),
54+
testCase(PCAPRingBufferTest.allTests),
55+
testCase(QuiescingHelperTest.allTests),
56+
testCase(RequestResponseHandlerTest.allTests),
57+
testCase(SOCKSServerHandlerTests.allTests),
58+
testCase(ServerResponseTests.allTests),
59+
testCase(ServerStateMachineTests.allTests),
60+
testCase(SocksClientHandlerTests.allTests),
61+
testCase(WritePCAPHandlerTest.allTests),
62+
])
63+
}
64+
}
65+
#endif
66+
#else
67+
#error("on Swift 5.5 and newer, --enable-test-discovery is required")
5768
#endif

Tests/NIOExtrasTests/DebugInboundEventsHandlerTest+XCTest.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the SwiftNIO open source project
44
//
5-
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
5+
// Copyright (c) 2018-2022 Apple Inc. and the SwiftNIO project authors
66
// Licensed under Apache License v2.0
77
//
88
// See LICENSE.txt for license information
@@ -24,6 +24,7 @@ import XCTest
2424

2525
extension DebugInboundEventsHandlerTest {
2626

27+
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
2728
static var allTests : [(String, (DebugInboundEventsHandlerTest) -> () throws -> Void)] {
2829
return [
2930
("testRegistered", testRegistered),

Tests/NIOExtrasTests/DebugOutboundEventsHandlerTest+XCTest.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the SwiftNIO open source project
44
//
5-
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
5+
// Copyright (c) 2018-2022 Apple Inc. and the SwiftNIO project authors
66
// Licensed under Apache License v2.0
77
//
88
// See LICENSE.txt for license information
@@ -24,6 +24,7 @@ import XCTest
2424

2525
extension DebugOutboundEventsHandlerTest {
2626

27+
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
2728
static var allTests : [(String, (DebugOutboundEventsHandlerTest) -> () throws -> Void)] {
2829
return [
2930
("testRegister", testRegister),

Tests/NIOExtrasTests/FixedLengthFrameDecoderTest+XCTest.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the SwiftNIO open source project
44
//
5-
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
5+
// Copyright (c) 2018-2022 Apple Inc. and the SwiftNIO project authors
66
// Licensed under Apache License v2.0
77
//
88
// See LICENSE.txt for license information
@@ -24,6 +24,7 @@ import XCTest
2424

2525
extension FixedLengthFrameDecoderTest {
2626

27+
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
2728
static var allTests : [(String, (FixedLengthFrameDecoderTest) -> () throws -> Void)] {
2829
return [
2930
("testDecodeIfFewerBytesAreSent", testDecodeIfFewerBytesAreSent),

Tests/NIOExtrasTests/JSONRPCFramingContentLengthHeaderDecoderTests+XCTest.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the SwiftNIO open source project
44
//
5-
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
5+
// Copyright (c) 2019-2022 Apple Inc. and the SwiftNIO project authors
66
// Licensed under Apache License v2.0
77
//
88
// See LICENSE.txt for license information
@@ -24,6 +24,7 @@ import XCTest
2424

2525
extension JSONRPCFramingContentLengthHeaderDecoderTests {
2626

27+
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
2728
static var allTests : [(String, (JSONRPCFramingContentLengthHeaderDecoderTests) -> () throws -> Void)] {
2829
return [
2930
("testBasicMessage", testBasicMessage),

Tests/NIOExtrasTests/JSONRPCFramingContentLengthHeaderEncoderTests+XCTest.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the SwiftNIO open source project
44
//
5-
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
5+
// Copyright (c) 2018-2022 Apple Inc. and the SwiftNIO project authors
66
// Licensed under Apache License v2.0
77
//
88
// See LICENSE.txt for license information
@@ -24,6 +24,7 @@ import XCTest
2424

2525
extension JSONRPCFramingContentLengthHeaderEncoderTests {
2626

27+
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
2728
static var allTests : [(String, (JSONRPCFramingContentLengthHeaderEncoderTests) -> () throws -> Void)] {
2829
return [
2930
("testEmptyMessage", testEmptyMessage),

Tests/NIOExtrasTests/LengthFieldBasedFrameDecoderTest+XCTest.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the SwiftNIO open source project
44
//
5-
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
5+
// Copyright (c) 2018-2022 Apple Inc. and the SwiftNIO project authors
66
// Licensed under Apache License v2.0
77
//
88
// See LICENSE.txt for license information
@@ -24,6 +24,7 @@ import XCTest
2424

2525
extension LengthFieldBasedFrameDecoderTest {
2626

27+
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
2728
static var allTests : [(String, (LengthFieldBasedFrameDecoderTest) -> () throws -> Void)] {
2829
return [
2930
("testReadUInt32From3Bytes", testReadUInt32From3Bytes),

Tests/NIOExtrasTests/LengthFieldPrependerTest+XCTest.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the SwiftNIO open source project
44
//
5-
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
5+
// Copyright (c) 2019-2022 Apple Inc. and the SwiftNIO project authors
66
// Licensed under Apache License v2.0
77
//
88
// See LICENSE.txt for license information
@@ -24,6 +24,7 @@ import XCTest
2424

2525
extension LengthFieldPrependerTest {
2626

27+
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
2728
static var allTests : [(String, (LengthFieldPrependerTest) -> () throws -> Void)] {
2829
return [
2930
("testWrite3BytesOfUInt32Write", testWrite3BytesOfUInt32Write),

Tests/NIOExtrasTests/LineBasedFrameDecoderTest+XCTest.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the SwiftNIO open source project
44
//
5-
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
5+
// Copyright (c) 2018-2022 Apple Inc. and the SwiftNIO project authors
66
// Licensed under Apache License v2.0
77
//
88
// See LICENSE.txt for license information
@@ -24,6 +24,7 @@ import XCTest
2424

2525
extension LineBasedFrameDecoderTest {
2626

27+
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
2728
static var allTests : [(String, (LineBasedFrameDecoderTest) -> () throws -> Void)] {
2829
return [
2930
("testDecodeOneCharacterAtATime", testDecodeOneCharacterAtATime),

Tests/NIOExtrasTests/PCAPRingBufferTest+XCTest.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the SwiftNIO open source project
44
//
5-
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
5+
// Copyright (c) 2018-2022 Apple Inc. and the SwiftNIO project authors
66
// Licensed under Apache License v2.0
77
//
88
// See LICENSE.txt for license information
@@ -24,6 +24,7 @@ import XCTest
2424

2525
extension PCAPRingBufferTest {
2626

27+
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
2728
static var allTests : [(String, (PCAPRingBufferTest) -> () throws -> Void)] {
2829
return [
2930
("testNotLimited", testNotLimited),

0 commit comments

Comments
 (0)