Skip to content

Commit 5613b51

Browse files
authored
Merge branch 'main' into ff-async-sequence-support
2 parents fbdfadc + b05c6f2 commit 5613b51

File tree

205 files changed

+433
-257
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

205 files changed

+433
-257
lines changed

IntegrationTests/tests_02_syscall_wrappers/defines.sh

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ set -eu
1717

1818
function make_package() {
1919
cat > "$tmpdir/syscallwrapper/Package.swift" <<"EOF"
20-
// swift-tools-version:5.0
20+
// swift-tools-version:5.2
2121
// The swift-tools-version declares the minimum version of Swift required to build this package.
2222
2323
import PackageDescription
@@ -28,24 +28,30 @@ let package = Package(
2828
targets: [
2929
.target(
3030
name: "syscallwrapper",
31-
dependencies: ["CNIOLinux", "CNIODarwin"]),
31+
dependencies: ["CNIOLinux", "CNIODarwin", "NIOCore"]),
3232
.target(
3333
name: "CNIOLinux",
3434
dependencies: []),
3535
.target(
3636
name: "CNIODarwin",
3737
dependencies: []),
38+
// This target does nothing, it just makes imports work.
39+
.target(
40+
name: "NIOCore",
41+
dependencies: []),
3842
]
3943
)
4044
EOF
41-
cp "$here/../../Tests/NIOTests/SystemCallWrapperHelpers.swift" \
45+
cp "$here/../../Tests/NIOPosixTests/SystemCallWrapperHelpers.swift" \
4246
"$here/../../Sources/NIOCore/BSDSocketAPI.swift" \
43-
"$here/../../Sources/NIO/BSDSocketAPICommon.swift" \
44-
"$here/../../Sources/NIO/BSDSocketAPIPosix.swift" \
45-
"$here/../../Sources/NIO/System.swift" \
47+
"$here/../../Sources/NIOPosix/BSDSocketAPICommon.swift" \
48+
"$here/../../Sources/NIOPosix/BSDSocketAPIPosix.swift" \
49+
"$here/../../Sources/NIOPosix/System.swift" \
4650
"$here/../../Sources/NIOCore/IO.swift" \
4751
"$tmpdir/syscallwrapper/Sources/syscallwrapper"
48-
cp "$here/../../Sources/NIO/IO.swift" "$tmpdir/syscallwrapper/Sources/syscallwrapper/NIOIO.swift"
52+
cp "$here/../../Sources/NIOPosix/IO.swift" "$tmpdir/syscallwrapper/Sources/syscallwrapper/NIOPosixIO.swift"
4953
ln -s "$here/../../Sources/CNIOLinux" "$tmpdir/syscallwrapper/Sources"
5054
ln -s "$here/../../Sources/CNIODarwin" "$tmpdir/syscallwrapper/Sources"
55+
mkdir "$tmpdir/syscallwrapper/Sources/NIOCore"
56+
touch "$tmpdir/syscallwrapper/Sources/NIOCore/empty.swift"
5157
}

IntegrationTests/tests_04_performance/test_01_resources/run-nio-alloc-counter-tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ fi
3939

4040
"$here/../../allocation-counter-tests-framework/run-allocation-counter.sh" \
4141
-p "$here/../../.." \
42-
-m NIO -m NIOHTTP1 -m NIOWebSocket \
42+
-m NIOCore -m NIOEmbedded -m NIOPosix -m NIOHTTP1 -m NIOWebSocket \
4343
-s "$here/shared.swift" \
4444
-t "$tmp_dir" \
4545
"${tests_to_run[@]}"

IntegrationTests/tests_04_performance/test_01_resources/shared.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the SwiftNIO open source project
44
//
5-
// Copyright (c) 2017-2019 Apple Inc. and the SwiftNIO project authors
5+
// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors
66
// Licensed under Apache License v2.0
77
//
88
// See LICENSE.txt for license information
@@ -13,7 +13,8 @@
1313
//===----------------------------------------------------------------------===//
1414

1515
import Foundation
16-
import NIO
16+
import NIOCore
17+
import NIOPosix
1718
import NIOHTTP1
1819

1920
let localhostPickPort = try! SocketAddress.makeAddressResolvingHost("127.0.0.1", port: 0)

IntegrationTests/tests_04_performance/test_01_resources/test_1000_addHandlers.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the SwiftNIO open source project
44
//
5-
// Copyright (c) 2020 Apple Inc. and the SwiftNIO project authors
5+
// Copyright (c) 2020-2021 Apple Inc. and the SwiftNIO project authors
66
// Licensed under Apache License v2.0
77
//
88
// See LICENSE.txt for license information
@@ -12,7 +12,8 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
import NIO
15+
import NIOCore
16+
import NIOEmbedded
1617

1718
fileprivate final class SimpleHandler: ChannelInboundHandler {
1819
typealias InboundIn = NIOAny

IntegrationTests/tests_04_performance/test_01_resources/test_1000_addHandlers_sync.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
import NIO
15+
import NIOCore
16+
import NIOEmbedded
1617

1718
fileprivate final class SimpleHandler: ChannelInboundHandler {
1819
typealias InboundIn = NIOAny

IntegrationTests/tests_04_performance/test_01_resources/test_1000_addRemoveHandlers.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
import NIO
15+
import NIOCore
16+
import NIOEmbedded
1617

1718
fileprivate final class RemovableHandler: ChannelInboundHandler, RemovableChannelHandler {
1819
typealias InboundIn = NIOAny

IntegrationTests/tests_04_performance/test_01_resources/test_1000_autoReadGetAndSet.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
import NIO
15+
import NIOCore
16+
import NIOPosix
1617

1718
func run(identifier: String) {
1819
let group = MultiThreadedEventLoopGroup(numberOfThreads: 1)

IntegrationTests/tests_04_performance/test_01_resources/test_1000_autoReadGetAndSet_sync.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
import NIO
15+
import NIOCore
16+
import NIOPosix
1617

1718
func run(identifier: String) {
1819
MultiThreadedEventLoopGroup.withCurrentThreadAsEventLoop { loop in

IntegrationTests/tests_04_performance/test_01_resources/test_1000_getHandlers.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
import NIO
15+
import NIOCore
16+
import NIOEmbedded
1617

1718
fileprivate final class SimpleHandler: ChannelInboundHandler {
1819
typealias InboundIn = NIOAny

IntegrationTests/tests_04_performance/test_01_resources/test_1000_getHandlers_sync.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
import NIO
15+
import NIOCore
16+
import NIOEmbedded
1617

1718
fileprivate final class SimpleHandler: ChannelInboundHandler {
1819
typealias InboundIn = NIOAny

IntegrationTests/tests_04_performance/test_01_resources/test_1000_tcpbootstraps.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the SwiftNIO open source project
44
//
5-
// Copyright (c) 2020 Apple Inc. and the SwiftNIO project authors
5+
// Copyright (c) 2020-2021 Apple Inc. and the SwiftNIO project authors
66
// Licensed under Apache License v2.0
77
//
88
// See LICENSE.txt for license information
@@ -12,7 +12,8 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
import NIO
15+
import NIOCore
16+
import NIOPosix
1617

1718
fileprivate final class DoNothingHandler: ChannelInboundHandler {
1819
public typealias InboundIn = ByteBuffer

IntegrationTests/tests_04_performance/test_01_resources/test_1000_tcpconnections.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the SwiftNIO open source project
44
//
5-
// Copyright (c) 2020 Apple Inc. and the SwiftNIO project authors
5+
// Copyright (c) 2020-2021 Apple Inc. and the SwiftNIO project authors
66
// Licensed under Apache License v2.0
77
//
88
// See LICENSE.txt for license information
@@ -12,7 +12,8 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
import NIO
15+
import NIOCore
16+
import NIOPosix
1617

1718
fileprivate final class ReceiveAndCloseHandler: ChannelInboundHandler {
1819
public typealias InboundIn = ByteBuffer

IntegrationTests/tests_04_performance/test_01_resources/test_1000_udp_reqs.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the SwiftNIO open source project
44
//
5-
// Copyright (c) 2020 Apple Inc. and the SwiftNIO project authors
5+
// Copyright (c) 2020-2021 Apple Inc. and the SwiftNIO project authors
66
// Licensed under Apache License v2.0
77
//
88
// See LICENSE.txt for license information
@@ -12,7 +12,8 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
import NIO
15+
import NIOCore
16+
import NIOPosix
1617

1718
fileprivate final class ServerEchoHandler: ChannelInboundHandler {
1819
public typealias InboundIn = AddressedEnvelope<ByteBuffer>

IntegrationTests/tests_04_performance/test_01_resources/test_1000_udpbootstraps.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the SwiftNIO open source project
44
//
5-
// Copyright (c) 2020 Apple Inc. and the SwiftNIO project authors
5+
// Copyright (c) 2020-2021 Apple Inc. and the SwiftNIO project authors
66
// Licensed under Apache License v2.0
77
//
88
// See LICENSE.txt for license information
@@ -12,7 +12,8 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
import NIO
15+
import NIOCore
16+
import NIOPosix
1617

1718
fileprivate final class DoNothingHandler: ChannelInboundHandler {
1819
public typealias InboundIn = ByteBuffer

IntegrationTests/tests_04_performance/test_01_resources/test_1000_udpconnections.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the SwiftNIO open source project
44
//
5-
// Copyright (c) 2020 Apple Inc. and the SwiftNIO project authors
5+
// Copyright (c) 2020-2021 Apple Inc. and the SwiftNIO project authors
66
// Licensed under Apache License v2.0
77
//
88
// See LICENSE.txt for license information
@@ -12,7 +12,8 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
import NIO
15+
import NIOCore
16+
import NIOPosix
1617

1718
fileprivate final class CountReadsHandler: ChannelInboundHandler {
1819
public typealias InboundIn = ByteBuffer

IntegrationTests/tests_04_performance/test_01_resources/test_bytebuffer_lots_of_rw.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the SwiftNIO open source project
44
//
5-
// Copyright (c) 2017-2019 Apple Inc. and the SwiftNIO project authors
5+
// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors
66
// Licensed under Apache License v2.0
77
//
88
// See LICENSE.txt for license information
@@ -13,7 +13,7 @@
1313
//===----------------------------------------------------------------------===//
1414

1515
import Dispatch
16-
import NIO
16+
import NIOCore
1717

1818
func run(identifier: String) {
1919
measure(identifier: identifier) {

IntegrationTests/tests_04_performance/test_01_resources/test_decode_1000_ws_frames.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the SwiftNIO open source project
44
//
5-
// Copyright (c) 2017-2019 Apple Inc. and the SwiftNIO project authors
5+
// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors
66
// Licensed under Apache License v2.0
77
//
88
// See LICENSE.txt for license information
@@ -12,7 +12,8 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
import NIO
15+
import NIOCore
16+
import NIOEmbedded
1617
import NIOWebSocket
1718

1819
class UnboxingChannelHandler: ChannelInboundHandler {

IntegrationTests/tests_04_performance/test_01_resources/test_encode_1000_ws_frames.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the SwiftNIO open source project
44
//
5-
// Copyright (c) 2017-2019 Apple Inc. and the SwiftNIO project authors
5+
// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors
66
// Licensed under Apache License v2.0
77
//
88
// See LICENSE.txt for license information
@@ -12,7 +12,8 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
import NIO
15+
import NIOCore
16+
import NIOEmbedded
1617
import NIOWebSocket
1718

1819
func doSendFramesHoldingBuffer(channel: EmbeddedChannel, number numberOfFrameSends: Int, data originalData: [UInt8], spareBytesAtFront: Int) throws -> Int {

IntegrationTests/tests_04_performance/test_01_resources/test_future_erase_result.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
import NIO
15+
import NIOCore
16+
import NIOEmbedded
1617

1718
func run(identifier: String) {
1819
measure(identifier: identifier) {

IntegrationTests/tests_04_performance/test_01_resources/test_future_lots_of_callbacks.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the SwiftNIO open source project
44
//
5-
// Copyright (c) 2017-2019 Apple Inc. and the SwiftNIO project authors
5+
// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors
66
// Licensed under Apache License v2.0
77
//
88
// See LICENSE.txt for license information
@@ -12,7 +12,8 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
import NIO
15+
import NIOCore
16+
import NIOEmbedded
1617

1718
func run(identifier: String) {
1819
measure(identifier: identifier) {

IntegrationTests/tests_04_performance/test_01_resources/test_modifying_1000_circular_buffer_elements.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the SwiftNIO open source project
44
//
5-
// Copyright (c) 2017-2019 Apple Inc. and the SwiftNIO project authors
5+
// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors
66
// Licensed under Apache License v2.0
77
//
88
// See LICENSE.txt for license information
@@ -12,7 +12,7 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
import NIO
15+
import NIOCore
1616

1717
func run(identifier: String) {
1818
var buffer = CircularBuffer<Array<Int>>(initialCapacity: 100)

IntegrationTests/tests_04_performance/test_01_resources/test_modifying_byte_buffer_view.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the SwiftNIO open source project
44
//
5-
// Copyright (c) 2017-2019 Apple Inc. and the SwiftNIO project authors
5+
// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors
66
// Licensed under Apache License v2.0
77
//
88
// See LICENSE.txt for license information
@@ -11,7 +11,7 @@
1111
// SPDX-License-Identifier: Apache-2.0
1212
//
1313
//===----------------------------------------------------------------------===//
14-
import NIO
14+
import NIOCore
1515

1616
func run(identifier: String) {
1717
let allocator = ByteBufferAllocator()

IntegrationTests/tests_04_performance/test_01_resources/test_ping_pong_1000_reqs_1_conn.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the SwiftNIO open source project
44
//
5-
// Copyright (c) 2017-2019 Apple Inc. and the SwiftNIO project authors
5+
// Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors
66
// Licensed under Apache License v2.0
77
//
88
// See LICENSE.txt for license information
@@ -12,7 +12,8 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
import NIO
15+
import NIOCore
16+
import NIOPosix
1617

1718
private struct PingPongFailure: Error, CustomStringConvertible {
1819
public var description: String

0 commit comments

Comments
 (0)