allow deprecated tests to test deprecated functionality (#1271)

Motivation:

It's important to also test deprecated functionliaty. One way of
achieving this without warnings is to also deprecate the tests that test
this deprecated functionality. Unfortunately, on Linux we need to
generate lists of tests which would then reference deprecated tests
(which gives us a warning).

Modifications:

Deprecate test suites and the main test runner all the way to the top so
never get warnings.

Result:

Possible to test deprecated functionlity without warnings.
This commit is contained in:
Johannes Weiss 2019-11-27 14:26:51 +00:00 committed by GitHub
parent 302dee3e1a
commit c2c725044a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
71 changed files with 178 additions and 75 deletions

View File

@ -31,76 +31,87 @@ import XCTest
@testable import NIOTests @testable import NIOTests
@testable import NIOWebSocketTests @testable import NIOWebSocketTests
XCTMain([ // This protocol is necessary to we can call the 'run' method (on an existential of this protocol)
testCase(AcceptBackoffHandlerTest.allTests), // without the compiler noticing that we're calling a deprecated function.
testCase(AdaptiveRecvByteBufferAllocatorTest.allTests), // This hack exists so we can deprecate individual tests which test deprecated functionality without
testCase(ApplicationProtocolNegotiationHandlerTests.allTests), // getting a compiler warning...
testCase(Base64Test.allTests), protocol LinuxMainRunner { func run() }
testCase(BaseObjectTest.allTests), class LinuxMainRunnerImpl: LinuxMainRunner {
testCase(BlockingIOThreadPoolTest.allTests), @available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
testCase(BootstrapTest.allTests), func run() {
testCase(ByteBufferTest.allTests), XCTMain([
testCase(ByteBufferUtilsTest.allTests), testCase(AcceptBackoffHandlerTest.allTests),
testCase(ByteToMessageDecoderTest.allTests), testCase(AdaptiveRecvByteBufferAllocatorTest.allTests),
testCase(ByteToMessageDecoderVerifierTest.allTests), testCase(ApplicationProtocolNegotiationHandlerTests.allTests),
testCase(ChannelNotificationTest.allTests), testCase(Base64Test.allTests),
testCase(ChannelOptionStorageTest.allTests), testCase(BaseObjectTest.allTests),
testCase(ChannelPipelineTest.allTests), testCase(BlockingIOThreadPoolTest.allTests),
testCase(ChannelTests.allTests), testCase(BootstrapTest.allTests),
testCase(CircularBufferTests.allTests), testCase(ByteBufferTest.allTests),
testCase(CodableByteBufferTest.allTests), testCase(ByteBufferUtilsTest.allTests),
testCase(CustomChannelTests.allTests), testCase(ByteToMessageDecoderTest.allTests),
testCase(DatagramChannelTests.allTests), testCase(ByteToMessageDecoderVerifierTest.allTests),
testCase(EchoServerClientTest.allTests), testCase(ChannelNotificationTest.allTests),
testCase(EmbeddedChannelTest.allTests), testCase(ChannelOptionStorageTest.allTests),
testCase(EmbeddedEventLoopTest.allTests), testCase(ChannelPipelineTest.allTests),
testCase(EventCounterHandlerTest.allTests), testCase(ChannelTests.allTests),
testCase(EventLoopFutureTest.allTests), testCase(CircularBufferTests.allTests),
testCase(EventLoopTest.allTests), testCase(CodableByteBufferTest.allTests),
testCase(FileRegionTest.allTests), testCase(CustomChannelTests.allTests),
testCase(GetaddrinfoResolverTest.allTests), testCase(DatagramChannelTests.allTests),
testCase(HTTPClientUpgradeTestCase.allTests), testCase(EchoServerClientTest.allTests),
testCase(HTTPDecoderLengthTest.allTests), testCase(EmbeddedChannelTest.allTests),
testCase(HTTPDecoderTest.allTests), testCase(EmbeddedEventLoopTest.allTests),
testCase(HTTPHeadersTest.allTests), testCase(EventCounterHandlerTest.allTests),
testCase(HTTPRequestEncoderTests.allTests), testCase(EventLoopFutureTest.allTests),
testCase(HTTPResponseEncoderTests.allTests), testCase(EventLoopTest.allTests),
testCase(HTTPResponseStatusTests.allTests), testCase(FileRegionTest.allTests),
testCase(HTTPServerClientTest.allTests), testCase(GetaddrinfoResolverTest.allTests),
testCase(HTTPServerPipelineHandlerTest.allTests), testCase(HTTPClientUpgradeTestCase.allTests),
testCase(HTTPServerProtocolErrorHandlerTest.allTests), testCase(HTTPDecoderLengthTest.allTests),
testCase(HTTPServerUpgradeTestCase.allTests), testCase(HTTPDecoderTest.allTests),
testCase(HTTPTest.allTests), testCase(HTTPHeadersTest.allTests),
testCase(HTTPTypesTest.allTests), testCase(HTTPRequestEncoderTests.allTests),
testCase(HappyEyeballsTest.allTests), testCase(HTTPResponseEncoderTests.allTests),
testCase(HeapTests.allTests), testCase(HTTPResponseStatusTests.allTests),
testCase(IdleStateHandlerTest.allTests), testCase(HTTPServerClientTest.allTests),
testCase(IntegerTypesTest.allTests), testCase(HTTPServerPipelineHandlerTest.allTests),
testCase(MarkedCircularBufferTests.allTests), testCase(HTTPServerProtocolErrorHandlerTest.allTests),
testCase(MessageToByteEncoderTest.allTests), testCase(HTTPServerUpgradeTestCase.allTests),
testCase(MessageToByteHandlerTest.allTests), testCase(HTTPTest.allTests),
testCase(MulticastTest.allTests), testCase(HTTPTypesTest.allTests),
testCase(NIOAnyDebugTest.allTests), testCase(HappyEyeballsTest.allTests),
testCase(NIOCloseOnErrorHandlerTest.allTests), testCase(HeapTests.allTests),
testCase(NIOConcurrencyHelpersTests.allTests), testCase(IdleStateHandlerTest.allTests),
testCase(NIOHTTP1TestServerTest.allTests), testCase(IntegerTypesTest.allTests),
testCase(NonBlockingFileIOTest.allTests), testCase(MarkedCircularBufferTests.allTests),
testCase(PendingDatagramWritesManagerTests.allTests), testCase(MessageToByteEncoderTest.allTests),
testCase(PipeChannelTest.allTests), testCase(MessageToByteHandlerTest.allTests),
testCase(PriorityQueueTest.allTests), testCase(MulticastTest.allTests),
testCase(SNIHandlerTest.allTests), testCase(NIOAnyDebugTest.allTests),
testCase(SelectorTest.allTests), testCase(NIOCloseOnErrorHandlerTest.allTests),
testCase(SocketAddressTest.allTests), testCase(NIOConcurrencyHelpersTests.allTests),
testCase(SocketChannelTest.allTests), testCase(NIOHTTP1TestServerTest.allTests),
testCase(SocketOptionProviderTest.allTests), testCase(NonBlockingFileIOTest.allTests),
testCase(StreamChannelTest.allTests), testCase(PendingDatagramWritesManagerTests.allTests),
testCase(SystemTest.allTests), testCase(PipeChannelTest.allTests),
testCase(ThreadTest.allTests), testCase(PriorityQueueTest.allTests),
testCase(TypeAssistedChannelHandlerTest.allTests), testCase(SNIHandlerTest.allTests),
testCase(UtilitiesTest.allTests), testCase(SelectorTest.allTests),
testCase(WebSocketClientEndToEndTests.allTests), testCase(SocketAddressTest.allTests),
testCase(WebSocketFrameDecoderTest.allTests), testCase(SocketChannelTest.allTests),
testCase(WebSocketFrameEncoderTest.allTests), testCase(SocketOptionProviderTest.allTests),
testCase(WebSocketServerEndToEndTests.allTests), testCase(StreamChannelTest.allTests),
]) testCase(SystemTest.allTests),
testCase(ThreadTest.allTests),
testCase(TypeAssistedChannelHandlerTest.allTests),
testCase(UtilitiesTest.allTests),
testCase(WebSocketClientEndToEndTests.allTests),
testCase(WebSocketFrameDecoderTest.allTests),
testCase(WebSocketFrameEncoderTest.allTests),
testCase(WebSocketServerEndToEndTests.allTests),
])
}
}
(LinuxMainRunnerImpl() as LinuxMainRunner).run()
#endif #endif

View File

@ -24,6 +24,7 @@ import XCTest
extension NIOConcurrencyHelpersTests { extension NIOConcurrencyHelpersTests {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (NIOConcurrencyHelpersTests) -> () throws -> Void)] { static var allTests : [(String, (NIOConcurrencyHelpersTests) -> () throws -> Void)] {
return [ return [
("testLargeContendedAtomicSum", testLargeContendedAtomicSum), ("testLargeContendedAtomicSum", testLargeContendedAtomicSum),

View File

@ -24,6 +24,7 @@ import XCTest
extension CodableByteBufferTest { extension CodableByteBufferTest {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (CodableByteBufferTest) -> () throws -> Void)] { static var allTests : [(String, (CodableByteBufferTest) -> () throws -> Void)] {
return [ return [
("testSimpleDecode", testSimpleDecode), ("testSimpleDecode", testSimpleDecode),

View File

@ -24,6 +24,7 @@ import XCTest
extension ByteBufferUtilsTest { extension ByteBufferUtilsTest {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (ByteBufferUtilsTest) -> () throws -> Void)] { static var allTests : [(String, (ByteBufferUtilsTest) -> () throws -> Void)] {
return [ return [
("testComparators", testComparators), ("testComparators", testComparators),

View File

@ -24,6 +24,7 @@ import XCTest
extension HTTPClientUpgradeTestCase { extension HTTPClientUpgradeTestCase {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (HTTPClientUpgradeTestCase) -> () throws -> Void)] { static var allTests : [(String, (HTTPClientUpgradeTestCase) -> () throws -> Void)] {
return [ return [
("testSimpleUpgradeSucceeds", testSimpleUpgradeSucceeds), ("testSimpleUpgradeSucceeds", testSimpleUpgradeSucceeds),

View File

@ -24,6 +24,7 @@ import XCTest
extension HTTPDecoderLengthTest { extension HTTPDecoderLengthTest {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (HTTPDecoderLengthTest) -> () throws -> Void)] { static var allTests : [(String, (HTTPDecoderLengthTest) -> () throws -> Void)] {
return [ return [
("testHTTP11SemanticEOFOnChannelInactive", testHTTP11SemanticEOFOnChannelInactive), ("testHTTP11SemanticEOFOnChannelInactive", testHTTP11SemanticEOFOnChannelInactive),

View File

@ -24,6 +24,7 @@ import XCTest
extension HTTPDecoderTest { extension HTTPDecoderTest {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (HTTPDecoderTest) -> () throws -> Void)] { static var allTests : [(String, (HTTPDecoderTest) -> () throws -> Void)] {
return [ return [
("testDoesNotDecodeRealHTTP09Request", testDoesNotDecodeRealHTTP09Request), ("testDoesNotDecodeRealHTTP09Request", testDoesNotDecodeRealHTTP09Request),

View File

@ -24,6 +24,7 @@ import XCTest
extension HTTPHeadersTest { extension HTTPHeadersTest {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (HTTPHeadersTest) -> () throws -> Void)] { static var allTests : [(String, (HTTPHeadersTest) -> () throws -> Void)] {
return [ return [
("testCasePreservedButInsensitiveLookup", testCasePreservedButInsensitiveLookup), ("testCasePreservedButInsensitiveLookup", testCasePreservedButInsensitiveLookup),

View File

@ -24,6 +24,7 @@ import XCTest
extension HTTPRequestEncoderTests { extension HTTPRequestEncoderTests {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (HTTPRequestEncoderTests) -> () throws -> Void)] { static var allTests : [(String, (HTTPRequestEncoderTests) -> () throws -> Void)] {
return [ return [
("testNoAutoHeadersForHEAD", testNoAutoHeadersForHEAD), ("testNoAutoHeadersForHEAD", testNoAutoHeadersForHEAD),

View File

@ -24,6 +24,7 @@ import XCTest
extension HTTPResponseEncoderTests { extension HTTPResponseEncoderTests {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (HTTPResponseEncoderTests) -> () throws -> Void)] { static var allTests : [(String, (HTTPResponseEncoderTests) -> () throws -> Void)] {
return [ return [
("testNoAutoHeadersFor101", testNoAutoHeadersFor101), ("testNoAutoHeadersFor101", testNoAutoHeadersFor101),

View File

@ -24,6 +24,7 @@ import XCTest
extension HTTPResponseStatusTests { extension HTTPResponseStatusTests {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (HTTPResponseStatusTests) -> () throws -> Void)] { static var allTests : [(String, (HTTPResponseStatusTests) -> () throws -> Void)] {
return [ return [
("testHTTPResponseStatusFromStatusCode", testHTTPResponseStatusFromStatusCode), ("testHTTPResponseStatusFromStatusCode", testHTTPResponseStatusFromStatusCode),

View File

@ -24,6 +24,7 @@ import XCTest
extension HTTPServerClientTest { extension HTTPServerClientTest {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (HTTPServerClientTest) -> () throws -> Void)] { static var allTests : [(String, (HTTPServerClientTest) -> () throws -> Void)] {
return [ return [
("testSimpleGetByteBuffer", testSimpleGetByteBuffer), ("testSimpleGetByteBuffer", testSimpleGetByteBuffer),

View File

@ -24,6 +24,7 @@ import XCTest
extension HTTPServerPipelineHandlerTest { extension HTTPServerPipelineHandlerTest {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (HTTPServerPipelineHandlerTest) -> () throws -> Void)] { static var allTests : [(String, (HTTPServerPipelineHandlerTest) -> () throws -> Void)] {
return [ return [
("testBasicBufferingBehaviour", testBasicBufferingBehaviour), ("testBasicBufferingBehaviour", testBasicBufferingBehaviour),

View File

@ -24,6 +24,7 @@ import XCTest
extension HTTPServerProtocolErrorHandlerTest { extension HTTPServerProtocolErrorHandlerTest {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (HTTPServerProtocolErrorHandlerTest) -> () throws -> Void)] { static var allTests : [(String, (HTTPServerProtocolErrorHandlerTest) -> () throws -> Void)] {
return [ return [
("testHandlesBasicErrors", testHandlesBasicErrors), ("testHandlesBasicErrors", testHandlesBasicErrors),

View File

@ -24,6 +24,7 @@ import XCTest
extension HTTPServerUpgradeTestCase { extension HTTPServerUpgradeTestCase {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (HTTPServerUpgradeTestCase) -> () throws -> Void)] { static var allTests : [(String, (HTTPServerUpgradeTestCase) -> () throws -> Void)] {
return [ return [
("testUpgradeWithoutUpgrade", testUpgradeWithoutUpgrade), ("testUpgradeWithoutUpgrade", testUpgradeWithoutUpgrade),

View File

@ -24,6 +24,7 @@ import XCTest
extension HTTPTest { extension HTTPTest {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (HTTPTest) -> () throws -> Void)] { static var allTests : [(String, (HTTPTest) -> () throws -> Void)] {
return [ return [
("testHTTPSimpleNoHeaders", testHTTPSimpleNoHeaders), ("testHTTPSimpleNoHeaders", testHTTPSimpleNoHeaders),

View File

@ -24,6 +24,7 @@ import XCTest
extension HTTPTypesTest { extension HTTPTypesTest {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (HTTPTypesTest) -> () throws -> Void)] { static var allTests : [(String, (HTTPTypesTest) -> () throws -> Void)] {
return [ return [
("testConvertToString", testConvertToString), ("testConvertToString", testConvertToString),

View File

@ -24,6 +24,7 @@ import XCTest
extension ApplicationProtocolNegotiationHandlerTests { extension ApplicationProtocolNegotiationHandlerTests {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (ApplicationProtocolNegotiationHandlerTests) -> () throws -> Void)] { static var allTests : [(String, (ApplicationProtocolNegotiationHandlerTests) -> () throws -> Void)] {
return [ return [
("testChannelProvidedToCallback", testChannelProvidedToCallback), ("testChannelProvidedToCallback", testChannelProvidedToCallback),

View File

@ -24,6 +24,7 @@ import XCTest
extension SNIHandlerTest { extension SNIHandlerTest {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (SNIHandlerTest) -> () throws -> Void)] { static var allTests : [(String, (SNIHandlerTest) -> () throws -> Void)] {
return [ return [
("testLibre227NoSNIDripFeed", testLibre227NoSNIDripFeed), ("testLibre227NoSNIDripFeed", testLibre227NoSNIDripFeed),

View File

@ -24,6 +24,7 @@ import XCTest
extension ByteToMessageDecoderVerifierTest { extension ByteToMessageDecoderVerifierTest {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (ByteToMessageDecoderVerifierTest) -> () throws -> Void)] { static var allTests : [(String, (ByteToMessageDecoderVerifierTest) -> () throws -> Void)] {
return [ return [
("testWrongResults", testWrongResults), ("testWrongResults", testWrongResults),

View File

@ -24,6 +24,7 @@ import XCTest
extension EventCounterHandlerTest { extension EventCounterHandlerTest {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (EventCounterHandlerTest) -> () throws -> Void)] { static var allTests : [(String, (EventCounterHandlerTest) -> () throws -> Void)] {
return [ return [
("testNothingButEmbeddedChannelInit", testNothingButEmbeddedChannelInit), ("testNothingButEmbeddedChannelInit", testNothingButEmbeddedChannelInit),

View File

@ -24,6 +24,7 @@ import XCTest
extension NIOHTTP1TestServerTest { extension NIOHTTP1TestServerTest {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (NIOHTTP1TestServerTest) -> () throws -> Void)] { static var allTests : [(String, (NIOHTTP1TestServerTest) -> () throws -> Void)] {
return [ return [
("testTheExampleInTheDocs", testTheExampleInTheDocs), ("testTheExampleInTheDocs", testTheExampleInTheDocs),

View File

@ -24,6 +24,7 @@ import XCTest
extension AcceptBackoffHandlerTest { extension AcceptBackoffHandlerTest {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (AcceptBackoffHandlerTest) -> () throws -> Void)] { static var allTests : [(String, (AcceptBackoffHandlerTest) -> () throws -> Void)] {
return [ return [
("testECONNABORTED", testECONNABORTED), ("testECONNABORTED", testECONNABORTED),

View File

@ -24,6 +24,7 @@ import XCTest
extension BaseObjectTest { extension BaseObjectTest {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (BaseObjectTest) -> () throws -> Void)] { static var allTests : [(String, (BaseObjectTest) -> () throws -> Void)] {
return [ return [
("testNIOByteBufferConversion", testNIOByteBufferConversion), ("testNIOByteBufferConversion", testNIOByteBufferConversion),

View File

@ -24,6 +24,7 @@ import XCTest
extension BlockingIOThreadPoolTest { extension BlockingIOThreadPoolTest {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (BlockingIOThreadPoolTest) -> () throws -> Void)] { static var allTests : [(String, (BlockingIOThreadPoolTest) -> () throws -> Void)] {
return [ return [
("testDoubleShutdownWorks", testDoubleShutdownWorks), ("testDoubleShutdownWorks", testDoubleShutdownWorks),

View File

@ -24,6 +24,7 @@ import XCTest
extension BootstrapTest { extension BootstrapTest {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (BootstrapTest) -> () throws -> Void)] { static var allTests : [(String, (BootstrapTest) -> () throws -> Void)] {
return [ return [
("testBootstrapsCallInitializersOnCorrectEventLoop", testBootstrapsCallInitializersOnCorrectEventLoop), ("testBootstrapsCallInitializersOnCorrectEventLoop", testBootstrapsCallInitializersOnCorrectEventLoop),

View File

@ -24,6 +24,7 @@ import XCTest
extension ByteBufferTest { extension ByteBufferTest {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (ByteBufferTest) -> () throws -> Void)] { static var allTests : [(String, (ByteBufferTest) -> () throws -> Void)] {
return [ return [
("testAllocateAndCount", testAllocateAndCount), ("testAllocateAndCount", testAllocateAndCount),
@ -173,6 +174,7 @@ extension ByteBufferTest {
("testByteBufferAllocatorSize1Capacity", testByteBufferAllocatorSize1Capacity), ("testByteBufferAllocatorSize1Capacity", testByteBufferAllocatorSize1Capacity),
("testByteBufferModifiedWithoutAllocationLogic", testByteBufferModifiedWithoutAllocationLogic), ("testByteBufferModifiedWithoutAllocationLogic", testByteBufferModifiedWithoutAllocationLogic),
("testByteBufferModifyIfUniquelyOwnedMayThrow", testByteBufferModifyIfUniquelyOwnedMayThrow), ("testByteBufferModifyIfUniquelyOwnedMayThrow", testByteBufferModifyIfUniquelyOwnedMayThrow),
("testDeprecatedSetBytes", testDeprecatedSetBytes),
] ]
} }
} }

View File

@ -2441,6 +2441,15 @@ class ByteBufferTest: XCTestCase {
XCTAssertTrue(error is MyError) XCTAssertTrue(error is MyError)
} }
} }
@available(*, deprecated, message: "deprecated because it tests deprecated functionality")
func testDeprecatedSetBytes() {
self.buf.clear()
self.buf.writeString("hello")
self.buf.set(buffer: self.buf, at: 5)
self.buf.moveWriterIndex(forwardBy: 5)
XCTAssertEqual("hellohello", self.buf.readString(length: 10))
}
} }
private enum AllocationExpectationState: Int { private enum AllocationExpectationState: Int {

View File

@ -24,6 +24,7 @@ import XCTest
extension ChannelNotificationTest { extension ChannelNotificationTest {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (ChannelNotificationTest) -> () throws -> Void)] { static var allTests : [(String, (ChannelNotificationTest) -> () throws -> Void)] {
return [ return [
("testNotificationOrder", testNotificationOrder), ("testNotificationOrder", testNotificationOrder),

View File

@ -24,6 +24,7 @@ import XCTest
extension ChannelOptionStorageTest { extension ChannelOptionStorageTest {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (ChannelOptionStorageTest) -> () throws -> Void)] { static var allTests : [(String, (ChannelOptionStorageTest) -> () throws -> Void)] {
return [ return [
("testWeStartWithNoOptions", testWeStartWithNoOptions), ("testWeStartWithNoOptions", testWeStartWithNoOptions),

View File

@ -24,6 +24,7 @@ import XCTest
extension ChannelPipelineTest { extension ChannelPipelineTest {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (ChannelPipelineTest) -> () throws -> Void)] { static var allTests : [(String, (ChannelPipelineTest) -> () throws -> Void)] {
return [ return [
("testGetHandler", testGetHandler), ("testGetHandler", testGetHandler),

View File

@ -24,6 +24,7 @@ import XCTest
extension ChannelTests { extension ChannelTests {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (ChannelTests) -> () throws -> Void)] { static var allTests : [(String, (ChannelTests) -> () throws -> Void)] {
return [ return [
("testBasicLifecycle", testBasicLifecycle), ("testBasicLifecycle", testBasicLifecycle),

View File

@ -24,6 +24,7 @@ import XCTest
extension CircularBufferTests { extension CircularBufferTests {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (CircularBufferTests) -> () throws -> Void)] { static var allTests : [(String, (CircularBufferTests) -> () throws -> Void)] {
return [ return [
("testTrivial", testTrivial), ("testTrivial", testTrivial),

View File

@ -24,6 +24,7 @@ import XCTest
extension ByteToMessageDecoderTest { extension ByteToMessageDecoderTest {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (ByteToMessageDecoderTest) -> () throws -> Void)] { static var allTests : [(String, (ByteToMessageDecoderTest) -> () throws -> Void)] {
return [ return [
("testDecoder", testDecoder), ("testDecoder", testDecoder),
@ -66,6 +67,7 @@ extension ByteToMessageDecoderTest {
extension MessageToByteEncoderTest { extension MessageToByteEncoderTest {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (MessageToByteEncoderTest) -> () throws -> Void)] { static var allTests : [(String, (MessageToByteEncoderTest) -> () throws -> Void)] {
return [ return [
("testEncoderOverrideAllocateOutBuffer", testEncoderOverrideAllocateOutBuffer), ("testEncoderOverrideAllocateOutBuffer", testEncoderOverrideAllocateOutBuffer),
@ -76,6 +78,7 @@ extension MessageToByteEncoderTest {
extension MessageToByteHandlerTest { extension MessageToByteHandlerTest {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (MessageToByteHandlerTest) -> () throws -> Void)] { static var allTests : [(String, (MessageToByteHandlerTest) -> () throws -> Void)] {
return [ return [
("testThrowingEncoderFailsPromises", testThrowingEncoderFailsPromises), ("testThrowingEncoderFailsPromises", testThrowingEncoderFailsPromises),

View File

@ -24,6 +24,7 @@ import XCTest
extension CustomChannelTests { extension CustomChannelTests {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (CustomChannelTests) -> () throws -> Void)] { static var allTests : [(String, (CustomChannelTests) -> () throws -> Void)] {
return [ return [
("testWritingIntToSpecialChannel", testWritingIntToSpecialChannel), ("testWritingIntToSpecialChannel", testWritingIntToSpecialChannel),

View File

@ -24,6 +24,7 @@ import XCTest
extension DatagramChannelTests { extension DatagramChannelTests {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (DatagramChannelTests) -> () throws -> Void)] { static var allTests : [(String, (DatagramChannelTests) -> () throws -> Void)] {
return [ return [
("testBasicChannelCommunication", testBasicChannelCommunication), ("testBasicChannelCommunication", testBasicChannelCommunication),

View File

@ -24,6 +24,7 @@ import XCTest
extension EchoServerClientTest { extension EchoServerClientTest {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (EchoServerClientTest) -> () throws -> Void)] { static var allTests : [(String, (EchoServerClientTest) -> () throws -> Void)] {
return [ return [
("testEcho", testEcho), ("testEcho", testEcho),

View File

@ -24,6 +24,7 @@ import XCTest
extension EmbeddedChannelTest { extension EmbeddedChannelTest {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (EmbeddedChannelTest) -> () throws -> Void)] { static var allTests : [(String, (EmbeddedChannelTest) -> () throws -> Void)] {
return [ return [
("testWriteOutboundByteBuffer", testWriteOutboundByteBuffer), ("testWriteOutboundByteBuffer", testWriteOutboundByteBuffer),

View File

@ -24,6 +24,7 @@ import XCTest
extension EmbeddedEventLoopTest { extension EmbeddedEventLoopTest {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (EmbeddedEventLoopTest) -> () throws -> Void)] { static var allTests : [(String, (EmbeddedEventLoopTest) -> () throws -> Void)] {
return [ return [
("testExecuteDoesNotImmediatelyRunTasks", testExecuteDoesNotImmediatelyRunTasks), ("testExecuteDoesNotImmediatelyRunTasks", testExecuteDoesNotImmediatelyRunTasks),

View File

@ -24,6 +24,7 @@ import XCTest
extension EventLoopFutureTest { extension EventLoopFutureTest {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (EventLoopFutureTest) -> () throws -> Void)] { static var allTests : [(String, (EventLoopFutureTest) -> () throws -> Void)] {
return [ return [
("testFutureFulfilledIfHasResult", testFutureFulfilledIfHasResult), ("testFutureFulfilledIfHasResult", testFutureFulfilledIfHasResult),

View File

@ -24,6 +24,7 @@ import XCTest
extension EventLoopTest { extension EventLoopTest {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (EventLoopTest) -> () throws -> Void)] { static var allTests : [(String, (EventLoopTest) -> () throws -> Void)] {
return [ return [
("testSchedule", testSchedule), ("testSchedule", testSchedule),

View File

@ -24,6 +24,7 @@ import XCTest
extension FileRegionTest { extension FileRegionTest {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (FileRegionTest) -> () throws -> Void)] { static var allTests : [(String, (FileRegionTest) -> () throws -> Void)] {
return [ return [
("testWriteFileRegion", testWriteFileRegion), ("testWriteFileRegion", testWriteFileRegion),

View File

@ -24,6 +24,7 @@ import XCTest
extension GetaddrinfoResolverTest { extension GetaddrinfoResolverTest {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (GetaddrinfoResolverTest) -> () throws -> Void)] { static var allTests : [(String, (GetaddrinfoResolverTest) -> () throws -> Void)] {
return [ return [
("testResolveNoDuplicatesV4", testResolveNoDuplicatesV4), ("testResolveNoDuplicatesV4", testResolveNoDuplicatesV4),

View File

@ -24,6 +24,7 @@ import XCTest
extension HappyEyeballsTest { extension HappyEyeballsTest {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (HappyEyeballsTest) -> () throws -> Void)] { static var allTests : [(String, (HappyEyeballsTest) -> () throws -> Void)] {
return [ return [
("testIPv4OnlyResolution", testIPv4OnlyResolution), ("testIPv4OnlyResolution", testIPv4OnlyResolution),

View File

@ -24,6 +24,7 @@ import XCTest
extension HeapTests { extension HeapTests {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (HeapTests) -> () throws -> Void)] { static var allTests : [(String, (HeapTests) -> () throws -> Void)] {
return [ return [
("testSimple", testSimple), ("testSimple", testSimple),

View File

@ -24,6 +24,7 @@ import XCTest
extension IdleStateHandlerTest { extension IdleStateHandlerTest {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (IdleStateHandlerTest) -> () throws -> Void)] { static var allTests : [(String, (IdleStateHandlerTest) -> () throws -> Void)] {
return [ return [
("testIdleRead", testIdleRead), ("testIdleRead", testIdleRead),

View File

@ -24,6 +24,7 @@ import XCTest
extension IntegerTypesTest { extension IntegerTypesTest {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (IntegerTypesTest) -> () throws -> Void)] { static var allTests : [(String, (IntegerTypesTest) -> () throws -> Void)] {
return [ return [
("testNextPowerOfOfTwoZero", testNextPowerOfOfTwoZero), ("testNextPowerOfOfTwoZero", testNextPowerOfOfTwoZero),

View File

@ -24,6 +24,7 @@ import XCTest
extension MarkedCircularBufferTests { extension MarkedCircularBufferTests {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (MarkedCircularBufferTests) -> () throws -> Void)] { static var allTests : [(String, (MarkedCircularBufferTests) -> () throws -> Void)] {
return [ return [
("testEmptyMark", testEmptyMark), ("testEmptyMark", testEmptyMark),

View File

@ -24,6 +24,7 @@ import XCTest
extension MulticastTest { extension MulticastTest {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (MulticastTest) -> () throws -> Void)] { static var allTests : [(String, (MulticastTest) -> () throws -> Void)] {
return [ return [
("testCanJoinBasicMulticastGroupIPv4", testCanJoinBasicMulticastGroupIPv4), ("testCanJoinBasicMulticastGroupIPv4", testCanJoinBasicMulticastGroupIPv4),

View File

@ -24,6 +24,7 @@ import XCTest
extension NIOAnyDebugTest { extension NIOAnyDebugTest {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (NIOAnyDebugTest) -> () throws -> Void)] { static var allTests : [(String, (NIOAnyDebugTest) -> () throws -> Void)] {
return [ return [
("testCustomStringConvertible", testCustomStringConvertible), ("testCustomStringConvertible", testCustomStringConvertible),

View File

@ -24,6 +24,7 @@ import XCTest
extension NIOCloseOnErrorHandlerTest { extension NIOCloseOnErrorHandlerTest {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (NIOCloseOnErrorHandlerTest) -> () throws -> Void)] { static var allTests : [(String, (NIOCloseOnErrorHandlerTest) -> () throws -> Void)] {
return [ return [
("testChannelCloseOnError", testChannelCloseOnError), ("testChannelCloseOnError", testChannelCloseOnError),

View File

@ -24,6 +24,7 @@ import XCTest
extension NonBlockingFileIOTest { extension NonBlockingFileIOTest {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (NonBlockingFileIOTest) -> () throws -> Void)] { static var allTests : [(String, (NonBlockingFileIOTest) -> () throws -> Void)] {
return [ return [
("testBasicFileIOWorks", testBasicFileIOWorks), ("testBasicFileIOWorks", testBasicFileIOWorks),

View File

@ -24,6 +24,7 @@ import XCTest
extension PendingDatagramWritesManagerTests { extension PendingDatagramWritesManagerTests {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (PendingDatagramWritesManagerTests) -> () throws -> Void)] { static var allTests : [(String, (PendingDatagramWritesManagerTests) -> () throws -> Void)] {
return [ return [
("testPendingWritesEmptyWritesWorkAndWeDontWriteUnflushedThings", testPendingWritesEmptyWritesWorkAndWeDontWriteUnflushedThings), ("testPendingWritesEmptyWritesWorkAndWeDontWriteUnflushedThings", testPendingWritesEmptyWritesWorkAndWeDontWriteUnflushedThings),

View File

@ -24,6 +24,7 @@ import XCTest
extension PipeChannelTest { extension PipeChannelTest {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (PipeChannelTest) -> () throws -> Void)] { static var allTests : [(String, (PipeChannelTest) -> () throws -> Void)] {
return [ return [
("testBasicIO", testBasicIO), ("testBasicIO", testBasicIO),

View File

@ -24,6 +24,7 @@ import XCTest
extension PriorityQueueTest { extension PriorityQueueTest {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (PriorityQueueTest) -> () throws -> Void)] { static var allTests : [(String, (PriorityQueueTest) -> () throws -> Void)] {
return [ return [
("testSomeStringsAsc", testSomeStringsAsc), ("testSomeStringsAsc", testSomeStringsAsc),

View File

@ -24,6 +24,7 @@ import XCTest
extension AdaptiveRecvByteBufferAllocatorTest { extension AdaptiveRecvByteBufferAllocatorTest {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (AdaptiveRecvByteBufferAllocatorTest) -> () throws -> Void)] { static var allTests : [(String, (AdaptiveRecvByteBufferAllocatorTest) -> () throws -> Void)] {
return [ return [
("testAdaptive", testAdaptive), ("testAdaptive", testAdaptive),

View File

@ -24,6 +24,7 @@ import XCTest
extension SelectorTest { extension SelectorTest {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (SelectorTest) -> () throws -> Void)] { static var allTests : [(String, (SelectorTest) -> () throws -> Void)] {
return [ return [
("testDeregisterWhileProcessingEvents", testDeregisterWhileProcessingEvents), ("testDeregisterWhileProcessingEvents", testDeregisterWhileProcessingEvents),

View File

@ -24,6 +24,7 @@ import XCTest
extension SocketAddressTest { extension SocketAddressTest {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (SocketAddressTest) -> () throws -> Void)] { static var allTests : [(String, (SocketAddressTest) -> () throws -> Void)] {
return [ return [
("testDescriptionWorks", testDescriptionWorks), ("testDescriptionWorks", testDescriptionWorks),

View File

@ -24,6 +24,7 @@ import XCTest
extension SocketChannelTest { extension SocketChannelTest {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (SocketChannelTest) -> () throws -> Void)] { static var allTests : [(String, (SocketChannelTest) -> () throws -> Void)] {
return [ return [
("testAsyncSetOption", testAsyncSetOption), ("testAsyncSetOption", testAsyncSetOption),

View File

@ -24,6 +24,7 @@ import XCTest
extension SocketOptionProviderTest { extension SocketOptionProviderTest {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (SocketOptionProviderTest) -> () throws -> Void)] { static var allTests : [(String, (SocketOptionProviderTest) -> () throws -> Void)] {
return [ return [
("testSettingAndGettingComplexSocketOption", testSettingAndGettingComplexSocketOption), ("testSettingAndGettingComplexSocketOption", testSettingAndGettingComplexSocketOption),

View File

@ -24,6 +24,7 @@ import XCTest
extension StreamChannelTest { extension StreamChannelTest {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (StreamChannelTest) -> () throws -> Void)] { static var allTests : [(String, (StreamChannelTest) -> () throws -> Void)] {
return [ return [
("testEchoBasic", testEchoBasic), ("testEchoBasic", testEchoBasic),

View File

@ -24,6 +24,7 @@ import XCTest
extension SystemTest { extension SystemTest {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (SystemTest) -> () throws -> Void)] { static var allTests : [(String, (SystemTest) -> () throws -> Void)] {
return [ return [
("testSystemCallWrapperPerformance", testSystemCallWrapperPerformance), ("testSystemCallWrapperPerformance", testSystemCallWrapperPerformance),

View File

@ -24,6 +24,7 @@ import XCTest
extension ThreadTest { extension ThreadTest {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (ThreadTest) -> () throws -> Void)] { static var allTests : [(String, (ThreadTest) -> () throws -> Void)] {
return [ return [
("testCurrentThreadWorks", testCurrentThreadWorks), ("testCurrentThreadWorks", testCurrentThreadWorks),

View File

@ -24,6 +24,7 @@ import XCTest
extension TypeAssistedChannelHandlerTest { extension TypeAssistedChannelHandlerTest {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (TypeAssistedChannelHandlerTest) -> () throws -> Void)] { static var allTests : [(String, (TypeAssistedChannelHandlerTest) -> () throws -> Void)] {
return [ return [
("testCanDefineBothInboundAndOutbound", testCanDefineBothInboundAndOutbound), ("testCanDefineBothInboundAndOutbound", testCanDefineBothInboundAndOutbound),

View File

@ -24,6 +24,7 @@ import XCTest
extension UtilitiesTest { extension UtilitiesTest {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (UtilitiesTest) -> () throws -> Void)] { static var allTests : [(String, (UtilitiesTest) -> () throws -> Void)] {
return [ return [
("testCoreCountWorks", testCoreCountWorks), ("testCoreCountWorks", testCoreCountWorks),

View File

@ -24,6 +24,7 @@ import XCTest
extension Base64Test { extension Base64Test {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (Base64Test) -> () throws -> Void)] { static var allTests : [(String, (Base64Test) -> () throws -> Void)] {
return [ return [
("testEncodeEmptyData", testEncodeEmptyData), ("testEncodeEmptyData", testEncodeEmptyData),

View File

@ -24,6 +24,7 @@ import XCTest
extension WebSocketClientEndToEndTests { extension WebSocketClientEndToEndTests {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (WebSocketClientEndToEndTests) -> () throws -> Void)] { static var allTests : [(String, (WebSocketClientEndToEndTests) -> () throws -> Void)] {
return [ return [
("testSimpleUpgradeSucceeds", testSimpleUpgradeSucceeds), ("testSimpleUpgradeSucceeds", testSimpleUpgradeSucceeds),

View File

@ -24,6 +24,7 @@ import XCTest
extension WebSocketFrameDecoderTest { extension WebSocketFrameDecoderTest {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (WebSocketFrameDecoderTest) -> () throws -> Void)] { static var allTests : [(String, (WebSocketFrameDecoderTest) -> () throws -> Void)] {
return [ return [
("testFramesWithoutBodies", testFramesWithoutBodies), ("testFramesWithoutBodies", testFramesWithoutBodies),

View File

@ -24,6 +24,7 @@ import XCTest
extension WebSocketFrameEncoderTest { extension WebSocketFrameEncoderTest {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (WebSocketFrameEncoderTest) -> () throws -> Void)] { static var allTests : [(String, (WebSocketFrameEncoderTest) -> () throws -> Void)] {
return [ return [
("testBasicFrameEncoding", testBasicFrameEncoding), ("testBasicFrameEncoding", testBasicFrameEncoding),

View File

@ -24,6 +24,7 @@ import XCTest
extension WebSocketServerEndToEndTests { extension WebSocketServerEndToEndTests {
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
static var allTests : [(String, (WebSocketServerEndToEndTests) -> () throws -> Void)] { static var allTests : [(String, (WebSocketServerEndToEndTests) -> () throws -> Void)] {
return [ return [
("testBasicUpgradeDance", testBasicUpgradeDance), ("testBasicUpgradeDance", testBasicUpgradeDance),

View File

@ -72,6 +72,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"
@ -99,7 +100,15 @@ def createLinuxMain(testsDirectory, allTestSubDirectories, files)
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 "// This protocol is necessary to we can call the 'run' method (on an existential of this protocol)\n"
file.write "// without the compiler noticing that we're calling a deprecated function.\n"
file.write "// This hack exists so we can deprecate individual tests which test deprecated functionality without\n"
file.write "// getting a compiler warning...\n"
file.write "protocol LinuxMainRunner { func run() }\n"
file.write "class LinuxMainRunnerImpl: 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 " func run() {\n"
file.write " XCTMain([\n"
testCases = [] testCases = []
for classes in files for classes in files
@ -109,9 +118,12 @@ 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 "(LinuxMainRunnerImpl() as LinuxMainRunner).run()\n"
file.write "#endif\n" file.write "#endif\n"
end end
end end