sort linux tests

motivation: generated linux tests dont have consitent sorting in different OSs

changes:

* change test generator to sort tests and imports in memory before writing to file
* update LinuxMain to the sorted version
This commit is contained in:
Tom Doron committed 2017-10-17 09:51:59 -07:00
1 parent 2889c7e3de
commit f76a2bfa66
2 files changed
+23 -18

No files matched your search

+16 -16
View File
@@ -23,29 +23,29 @@ import XCTest
///
#if os(Linux) || os(FreeBSD)
@testable import NIOTests
@testable import NIOOpenSSLTests
@testable import NIOHTTP1Tests
@testable import NIOOpenSSLTests
@testable import NIOTests
XCTMain([
testCase(MarkedCircularBufferTests.allTests),
testCase(TypeAssistedChannelHandlerTest.allTests),
testCase(CircularBufferTests.allTests),
testCase(AdaptiveRecvByteBufferAllocatorTest.allTests),
testCase(EchoServerClientTest.allTests),
testCase(ByteToMessageDecoderTest.allTests),
testCase(MessageToByteEncoderTest.allTests),
testCase(FileRegionTest.allTests),
testCase(ByteBufferTest.allTests),
testCase(EmbeddedChannelTest.allTests),
testCase(ByteToMessageDecoderTest.allTests),
testCase(ChannelPipelineTest.allTests),
testCase(SocketAddressTest.allTests),
testCase(FutureTest.allTests),
testCase(CircularBufferTests.allTests),
testCase(EchoServerClientTest.allTests),
testCase(EmbeddedChannelTest.allTests),
testCase(EventLoopTest.allTests),
testCase(OpenSSLIntegrationTest.allTests),
testCase(HTTPServerClientTest.allTests),
testCase(HTTPHeadersTest.allTests),
testCase(HTTPTest.allTests),
testCase(FileRegionTest.allTests),
testCase(FutureTest.allTests),
testCase(HTTPEncoderTests.allTests),
testCase(HTTPHeadersTest.allTests),
testCase(HTTPServerClientTest.allTests),
testCase(HTTPTest.allTests),
testCase(MarkedCircularBufferTests.allTests),
testCase(MessageToByteEncoderTest.allTests),
testCase(OpenSSLIntegrationTest.allTests),
testCase(SocketAddressTest.allTests),
testCase(TypeAssistedChannelHandlerTest.allTests),
])
#endif
+7 -2
View File
@@ -85,17 +85,22 @@ def createLinuxMain(testsDirectory, allTestSubDirectories, files)
file.write "\n"
file.write "#if os(Linux) || os(FreeBSD)\n"
for testSubDirectory in allTestSubDirectories
for testSubDirectory in allTestSubDirectories.sort { |x,y| x <=> y }
file.write " @testable import " + testSubDirectory + "\n"
end
file.write "\n"
file.write " XCTMain([\n"
testCases = []
for classes in files
for classArray in classes
file.write " testCase(" + classArray[0] + ".allTests),\n"
testCases << classArray[0]
end
end
for testCase in testCases.sort { |x,y| x <=> y }
file.write " testCase(" + testCase + ".allTests),\n"
end
file.write" ])\n"
file.write "#endif"
}