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:
parent
302dee3e1a
commit
c2c725044a
|
@ -31,76 +31,87 @@ import XCTest
|
|||
@testable import NIOTests
|
||||
@testable import NIOWebSocketTests
|
||||
|
||||
XCTMain([
|
||||
testCase(AcceptBackoffHandlerTest.allTests),
|
||||
testCase(AdaptiveRecvByteBufferAllocatorTest.allTests),
|
||||
testCase(ApplicationProtocolNegotiationHandlerTests.allTests),
|
||||
testCase(Base64Test.allTests),
|
||||
testCase(BaseObjectTest.allTests),
|
||||
testCase(BlockingIOThreadPoolTest.allTests),
|
||||
testCase(BootstrapTest.allTests),
|
||||
testCase(ByteBufferTest.allTests),
|
||||
testCase(ByteBufferUtilsTest.allTests),
|
||||
testCase(ByteToMessageDecoderTest.allTests),
|
||||
testCase(ByteToMessageDecoderVerifierTest.allTests),
|
||||
testCase(ChannelNotificationTest.allTests),
|
||||
testCase(ChannelOptionStorageTest.allTests),
|
||||
testCase(ChannelPipelineTest.allTests),
|
||||
testCase(ChannelTests.allTests),
|
||||
testCase(CircularBufferTests.allTests),
|
||||
testCase(CodableByteBufferTest.allTests),
|
||||
testCase(CustomChannelTests.allTests),
|
||||
testCase(DatagramChannelTests.allTests),
|
||||
testCase(EchoServerClientTest.allTests),
|
||||
testCase(EmbeddedChannelTest.allTests),
|
||||
testCase(EmbeddedEventLoopTest.allTests),
|
||||
testCase(EventCounterHandlerTest.allTests),
|
||||
testCase(EventLoopFutureTest.allTests),
|
||||
testCase(EventLoopTest.allTests),
|
||||
testCase(FileRegionTest.allTests),
|
||||
testCase(GetaddrinfoResolverTest.allTests),
|
||||
testCase(HTTPClientUpgradeTestCase.allTests),
|
||||
testCase(HTTPDecoderLengthTest.allTests),
|
||||
testCase(HTTPDecoderTest.allTests),
|
||||
testCase(HTTPHeadersTest.allTests),
|
||||
testCase(HTTPRequestEncoderTests.allTests),
|
||||
testCase(HTTPResponseEncoderTests.allTests),
|
||||
testCase(HTTPResponseStatusTests.allTests),
|
||||
testCase(HTTPServerClientTest.allTests),
|
||||
testCase(HTTPServerPipelineHandlerTest.allTests),
|
||||
testCase(HTTPServerProtocolErrorHandlerTest.allTests),
|
||||
testCase(HTTPServerUpgradeTestCase.allTests),
|
||||
testCase(HTTPTest.allTests),
|
||||
testCase(HTTPTypesTest.allTests),
|
||||
testCase(HappyEyeballsTest.allTests),
|
||||
testCase(HeapTests.allTests),
|
||||
testCase(IdleStateHandlerTest.allTests),
|
||||
testCase(IntegerTypesTest.allTests),
|
||||
testCase(MarkedCircularBufferTests.allTests),
|
||||
testCase(MessageToByteEncoderTest.allTests),
|
||||
testCase(MessageToByteHandlerTest.allTests),
|
||||
testCase(MulticastTest.allTests),
|
||||
testCase(NIOAnyDebugTest.allTests),
|
||||
testCase(NIOCloseOnErrorHandlerTest.allTests),
|
||||
testCase(NIOConcurrencyHelpersTests.allTests),
|
||||
testCase(NIOHTTP1TestServerTest.allTests),
|
||||
testCase(NonBlockingFileIOTest.allTests),
|
||||
testCase(PendingDatagramWritesManagerTests.allTests),
|
||||
testCase(PipeChannelTest.allTests),
|
||||
testCase(PriorityQueueTest.allTests),
|
||||
testCase(SNIHandlerTest.allTests),
|
||||
testCase(SelectorTest.allTests),
|
||||
testCase(SocketAddressTest.allTests),
|
||||
testCase(SocketChannelTest.allTests),
|
||||
testCase(SocketOptionProviderTest.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),
|
||||
])
|
||||
// This protocol is necessary to we can call the 'run' method (on an existential of this protocol)
|
||||
// without the compiler noticing that we're calling a deprecated function.
|
||||
// This hack exists so we can deprecate individual tests which test deprecated functionality without
|
||||
// getting a compiler warning...
|
||||
protocol LinuxMainRunner { func run() }
|
||||
class LinuxMainRunnerImpl: LinuxMainRunner {
|
||||
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
|
||||
func run() {
|
||||
XCTMain([
|
||||
testCase(AcceptBackoffHandlerTest.allTests),
|
||||
testCase(AdaptiveRecvByteBufferAllocatorTest.allTests),
|
||||
testCase(ApplicationProtocolNegotiationHandlerTests.allTests),
|
||||
testCase(Base64Test.allTests),
|
||||
testCase(BaseObjectTest.allTests),
|
||||
testCase(BlockingIOThreadPoolTest.allTests),
|
||||
testCase(BootstrapTest.allTests),
|
||||
testCase(ByteBufferTest.allTests),
|
||||
testCase(ByteBufferUtilsTest.allTests),
|
||||
testCase(ByteToMessageDecoderTest.allTests),
|
||||
testCase(ByteToMessageDecoderVerifierTest.allTests),
|
||||
testCase(ChannelNotificationTest.allTests),
|
||||
testCase(ChannelOptionStorageTest.allTests),
|
||||
testCase(ChannelPipelineTest.allTests),
|
||||
testCase(ChannelTests.allTests),
|
||||
testCase(CircularBufferTests.allTests),
|
||||
testCase(CodableByteBufferTest.allTests),
|
||||
testCase(CustomChannelTests.allTests),
|
||||
testCase(DatagramChannelTests.allTests),
|
||||
testCase(EchoServerClientTest.allTests),
|
||||
testCase(EmbeddedChannelTest.allTests),
|
||||
testCase(EmbeddedEventLoopTest.allTests),
|
||||
testCase(EventCounterHandlerTest.allTests),
|
||||
testCase(EventLoopFutureTest.allTests),
|
||||
testCase(EventLoopTest.allTests),
|
||||
testCase(FileRegionTest.allTests),
|
||||
testCase(GetaddrinfoResolverTest.allTests),
|
||||
testCase(HTTPClientUpgradeTestCase.allTests),
|
||||
testCase(HTTPDecoderLengthTest.allTests),
|
||||
testCase(HTTPDecoderTest.allTests),
|
||||
testCase(HTTPHeadersTest.allTests),
|
||||
testCase(HTTPRequestEncoderTests.allTests),
|
||||
testCase(HTTPResponseEncoderTests.allTests),
|
||||
testCase(HTTPResponseStatusTests.allTests),
|
||||
testCase(HTTPServerClientTest.allTests),
|
||||
testCase(HTTPServerPipelineHandlerTest.allTests),
|
||||
testCase(HTTPServerProtocolErrorHandlerTest.allTests),
|
||||
testCase(HTTPServerUpgradeTestCase.allTests),
|
||||
testCase(HTTPTest.allTests),
|
||||
testCase(HTTPTypesTest.allTests),
|
||||
testCase(HappyEyeballsTest.allTests),
|
||||
testCase(HeapTests.allTests),
|
||||
testCase(IdleStateHandlerTest.allTests),
|
||||
testCase(IntegerTypesTest.allTests),
|
||||
testCase(MarkedCircularBufferTests.allTests),
|
||||
testCase(MessageToByteEncoderTest.allTests),
|
||||
testCase(MessageToByteHandlerTest.allTests),
|
||||
testCase(MulticastTest.allTests),
|
||||
testCase(NIOAnyDebugTest.allTests),
|
||||
testCase(NIOCloseOnErrorHandlerTest.allTests),
|
||||
testCase(NIOConcurrencyHelpersTests.allTests),
|
||||
testCase(NIOHTTP1TestServerTest.allTests),
|
||||
testCase(NonBlockingFileIOTest.allTests),
|
||||
testCase(PendingDatagramWritesManagerTests.allTests),
|
||||
testCase(PipeChannelTest.allTests),
|
||||
testCase(PriorityQueueTest.allTests),
|
||||
testCase(SNIHandlerTest.allTests),
|
||||
testCase(SelectorTest.allTests),
|
||||
testCase(SocketAddressTest.allTests),
|
||||
testCase(SocketChannelTest.allTests),
|
||||
testCase(SocketOptionProviderTest.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
|
||||
|
|
|
@ -24,6 +24,7 @@ import XCTest
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testLargeContendedAtomicSum", testLargeContendedAtomicSum),
|
||||
|
|
|
@ -24,6 +24,7 @@ import XCTest
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testSimpleDecode", testSimpleDecode),
|
||||
|
|
|
@ -24,6 +24,7 @@ import XCTest
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testComparators", testComparators),
|
||||
|
|
|
@ -24,6 +24,7 @@ import XCTest
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testSimpleUpgradeSucceeds", testSimpleUpgradeSucceeds),
|
||||
|
|
|
@ -24,6 +24,7 @@ import XCTest
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testHTTP11SemanticEOFOnChannelInactive", testHTTP11SemanticEOFOnChannelInactive),
|
||||
|
|
|
@ -24,6 +24,7 @@ import XCTest
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testDoesNotDecodeRealHTTP09Request", testDoesNotDecodeRealHTTP09Request),
|
||||
|
|
|
@ -24,6 +24,7 @@ import XCTest
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testCasePreservedButInsensitiveLookup", testCasePreservedButInsensitiveLookup),
|
||||
|
|
|
@ -24,6 +24,7 @@ import XCTest
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testNoAutoHeadersForHEAD", testNoAutoHeadersForHEAD),
|
||||
|
|
|
@ -24,6 +24,7 @@ import XCTest
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testNoAutoHeadersFor101", testNoAutoHeadersFor101),
|
||||
|
|
|
@ -24,6 +24,7 @@ import XCTest
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testHTTPResponseStatusFromStatusCode", testHTTPResponseStatusFromStatusCode),
|
||||
|
|
|
@ -24,6 +24,7 @@ import XCTest
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testSimpleGetByteBuffer", testSimpleGetByteBuffer),
|
||||
|
|
|
@ -24,6 +24,7 @@ import XCTest
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testBasicBufferingBehaviour", testBasicBufferingBehaviour),
|
||||
|
|
|
@ -24,6 +24,7 @@ import XCTest
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testHandlesBasicErrors", testHandlesBasicErrors),
|
||||
|
|
|
@ -24,6 +24,7 @@ import XCTest
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testUpgradeWithoutUpgrade", testUpgradeWithoutUpgrade),
|
||||
|
|
|
@ -24,6 +24,7 @@ import XCTest
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testHTTPSimpleNoHeaders", testHTTPSimpleNoHeaders),
|
||||
|
|
|
@ -24,6 +24,7 @@ import XCTest
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testConvertToString", testConvertToString),
|
||||
|
|
|
@ -24,6 +24,7 @@ import XCTest
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testChannelProvidedToCallback", testChannelProvidedToCallback),
|
||||
|
|
|
@ -24,6 +24,7 @@ import XCTest
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testLibre227NoSNIDripFeed", testLibre227NoSNIDripFeed),
|
||||
|
|
|
@ -24,6 +24,7 @@ import XCTest
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testWrongResults", testWrongResults),
|
||||
|
|
|
@ -24,6 +24,7 @@ import XCTest
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testNothingButEmbeddedChannelInit", testNothingButEmbeddedChannelInit),
|
||||
|
|
|
@ -24,6 +24,7 @@ import XCTest
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testTheExampleInTheDocs", testTheExampleInTheDocs),
|
||||
|
|
|
@ -24,6 +24,7 @@ import XCTest
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testECONNABORTED", testECONNABORTED),
|
||||
|
|
|
@ -24,6 +24,7 @@ import XCTest
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testNIOByteBufferConversion", testNIOByteBufferConversion),
|
||||
|
|
|
@ -24,6 +24,7 @@ import XCTest
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testDoubleShutdownWorks", testDoubleShutdownWorks),
|
||||
|
|
|
@ -24,6 +24,7 @@ import XCTest
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testBootstrapsCallInitializersOnCorrectEventLoop", testBootstrapsCallInitializersOnCorrectEventLoop),
|
||||
|
|
|
@ -24,6 +24,7 @@ import XCTest
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testAllocateAndCount", testAllocateAndCount),
|
||||
|
@ -173,6 +174,7 @@ extension ByteBufferTest {
|
|||
("testByteBufferAllocatorSize1Capacity", testByteBufferAllocatorSize1Capacity),
|
||||
("testByteBufferModifiedWithoutAllocationLogic", testByteBufferModifiedWithoutAllocationLogic),
|
||||
("testByteBufferModifyIfUniquelyOwnedMayThrow", testByteBufferModifyIfUniquelyOwnedMayThrow),
|
||||
("testDeprecatedSetBytes", testDeprecatedSetBytes),
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2441,6 +2441,15 @@ class ByteBufferTest: XCTestCase {
|
|||
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 {
|
||||
|
|
|
@ -24,6 +24,7 @@ import XCTest
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testNotificationOrder", testNotificationOrder),
|
||||
|
|
|
@ -24,6 +24,7 @@ import XCTest
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testWeStartWithNoOptions", testWeStartWithNoOptions),
|
||||
|
|
|
@ -24,6 +24,7 @@ import XCTest
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testGetHandler", testGetHandler),
|
||||
|
|
|
@ -24,6 +24,7 @@ import XCTest
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testBasicLifecycle", testBasicLifecycle),
|
||||
|
|
|
@ -24,6 +24,7 @@ import XCTest
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testTrivial", testTrivial),
|
||||
|
|
|
@ -24,6 +24,7 @@ import XCTest
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testDecoder", testDecoder),
|
||||
|
@ -66,6 +67,7 @@ extension ByteToMessageDecoderTest {
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testEncoderOverrideAllocateOutBuffer", testEncoderOverrideAllocateOutBuffer),
|
||||
|
@ -76,6 +78,7 @@ extension MessageToByteEncoderTest {
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testThrowingEncoderFailsPromises", testThrowingEncoderFailsPromises),
|
||||
|
|
|
@ -24,6 +24,7 @@ import XCTest
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testWritingIntToSpecialChannel", testWritingIntToSpecialChannel),
|
||||
|
|
|
@ -24,6 +24,7 @@ import XCTest
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testBasicChannelCommunication", testBasicChannelCommunication),
|
||||
|
|
|
@ -24,6 +24,7 @@ import XCTest
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testEcho", testEcho),
|
||||
|
|
|
@ -24,6 +24,7 @@ import XCTest
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testWriteOutboundByteBuffer", testWriteOutboundByteBuffer),
|
||||
|
|
|
@ -24,6 +24,7 @@ import XCTest
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testExecuteDoesNotImmediatelyRunTasks", testExecuteDoesNotImmediatelyRunTasks),
|
||||
|
|
|
@ -24,6 +24,7 @@ import XCTest
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testFutureFulfilledIfHasResult", testFutureFulfilledIfHasResult),
|
||||
|
|
|
@ -24,6 +24,7 @@ import XCTest
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testSchedule", testSchedule),
|
||||
|
|
|
@ -24,6 +24,7 @@ import XCTest
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testWriteFileRegion", testWriteFileRegion),
|
||||
|
|
|
@ -24,6 +24,7 @@ import XCTest
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testResolveNoDuplicatesV4", testResolveNoDuplicatesV4),
|
||||
|
|
|
@ -24,6 +24,7 @@ import XCTest
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testIPv4OnlyResolution", testIPv4OnlyResolution),
|
||||
|
|
|
@ -24,6 +24,7 @@ import XCTest
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testSimple", testSimple),
|
||||
|
|
|
@ -24,6 +24,7 @@ import XCTest
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testIdleRead", testIdleRead),
|
||||
|
|
|
@ -24,6 +24,7 @@ import XCTest
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testNextPowerOfOfTwoZero", testNextPowerOfOfTwoZero),
|
||||
|
|
|
@ -24,6 +24,7 @@ import XCTest
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testEmptyMark", testEmptyMark),
|
||||
|
|
|
@ -24,6 +24,7 @@ import XCTest
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testCanJoinBasicMulticastGroupIPv4", testCanJoinBasicMulticastGroupIPv4),
|
||||
|
|
|
@ -24,6 +24,7 @@ import XCTest
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testCustomStringConvertible", testCustomStringConvertible),
|
||||
|
|
|
@ -24,6 +24,7 @@ import XCTest
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testChannelCloseOnError", testChannelCloseOnError),
|
||||
|
|
|
@ -24,6 +24,7 @@ import XCTest
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testBasicFileIOWorks", testBasicFileIOWorks),
|
||||
|
|
|
@ -24,6 +24,7 @@ import XCTest
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testPendingWritesEmptyWritesWorkAndWeDontWriteUnflushedThings", testPendingWritesEmptyWritesWorkAndWeDontWriteUnflushedThings),
|
||||
|
|
|
@ -24,6 +24,7 @@ import XCTest
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testBasicIO", testBasicIO),
|
||||
|
|
|
@ -24,6 +24,7 @@ import XCTest
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testSomeStringsAsc", testSomeStringsAsc),
|
||||
|
|
|
@ -24,6 +24,7 @@ import XCTest
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testAdaptive", testAdaptive),
|
||||
|
|
|
@ -24,6 +24,7 @@ import XCTest
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testDeregisterWhileProcessingEvents", testDeregisterWhileProcessingEvents),
|
||||
|
|
|
@ -24,6 +24,7 @@ import XCTest
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testDescriptionWorks", testDescriptionWorks),
|
||||
|
|
|
@ -24,6 +24,7 @@ import XCTest
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testAsyncSetOption", testAsyncSetOption),
|
||||
|
|
|
@ -24,6 +24,7 @@ import XCTest
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testSettingAndGettingComplexSocketOption", testSettingAndGettingComplexSocketOption),
|
||||
|
|
|
@ -24,6 +24,7 @@ import XCTest
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testEchoBasic", testEchoBasic),
|
||||
|
|
|
@ -24,6 +24,7 @@ import XCTest
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testSystemCallWrapperPerformance", testSystemCallWrapperPerformance),
|
||||
|
|
|
@ -24,6 +24,7 @@ import XCTest
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testCurrentThreadWorks", testCurrentThreadWorks),
|
||||
|
|
|
@ -24,6 +24,7 @@ import XCTest
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testCanDefineBothInboundAndOutbound", testCanDefineBothInboundAndOutbound),
|
||||
|
|
|
@ -24,6 +24,7 @@ import XCTest
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testCoreCountWorks", testCoreCountWorks),
|
||||
|
|
|
@ -24,6 +24,7 @@ import XCTest
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testEncodeEmptyData", testEncodeEmptyData),
|
||||
|
|
|
@ -24,6 +24,7 @@ import XCTest
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testSimpleUpgradeSucceeds", testSimpleUpgradeSucceeds),
|
||||
|
|
|
@ -24,6 +24,7 @@ import XCTest
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testFramesWithoutBodies", testFramesWithoutBodies),
|
||||
|
|
|
@ -24,6 +24,7 @@ import XCTest
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testBasicFrameEncoding", testBasicFrameEncoding),
|
||||
|
|
|
@ -24,6 +24,7 @@ import XCTest
|
|||
|
||||
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)] {
|
||||
return [
|
||||
("testBasicUpgradeDance", testBasicUpgradeDance),
|
||||
|
|
|
@ -72,6 +72,7 @@ def createExtensionFile(fileName, classes)
|
|||
|
||||
for classArray in classes
|
||||
file.write 'extension ' + classArray[0] + " {\n\n"
|
||||
file.write ' @available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")' +"\n"
|
||||
file.write ' static var allTests : [(String, (' + classArray[0] + ") -> () throws -> Void)] {\n"
|
||||
file.write " return [\n"
|
||||
|
||||
|
@ -99,7 +100,15 @@ def createLinuxMain(testsDirectory, allTestSubDirectories, files)
|
|||
file.write ' @testable import ' + testSubDirectory + "\n"
|
||||
end
|
||||
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 = []
|
||||
for classes in files
|
||||
|
@ -109,9 +118,12 @@ def createLinuxMain(testsDirectory, allTestSubDirectories, files)
|
|||
end
|
||||
|
||||
for testCase in testCases.sort { |x, y| x <=> y }
|
||||
file.write ' testCase(' + testCase + ".allTests),\n"
|
||||
file.write ' testCase(' + testCase + ".allTests),\n"
|
||||
end
|
||||
file.write " ])\n"
|
||||
file.write " ])\n"
|
||||
file.write " }\n"
|
||||
file.write "}\n"
|
||||
file.write "(LinuxMainRunnerImpl() as LinuxMainRunner).run()\n"
|
||||
file.write "#endif\n"
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue