mirror of
https://github.com/apple/swift-nio
synced 2026-11-26 04:57:49 +00:00
Motivation: Testing specific ordering behaviours (e.g. cancelling tasks) requires that EmbeddedEventLoop behave as similarly as possible to the full event loop. Modifications: Adopt the batched scheduled task dispatch logic from the regular event loop. Result: Easier to test subtle behaviours around task dispatch.
47 lines
2.0 KiB
Swift
47 lines
2.0 KiB
Swift
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This source file is part of the SwiftNIO open source project
|
|
//
|
|
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
|
|
// Licensed under Apache License v2.0
|
|
//
|
|
// See LICENSE.txt for license information
|
|
// See CONTRIBUTORS.txt for the list of SwiftNIO project authors
|
|
//
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// EmbeddedEventLoopTest+XCTest.swift
|
|
//
|
|
import XCTest
|
|
|
|
///
|
|
/// NOTE: This file was generated by generate_linux_tests.rb
|
|
///
|
|
/// Do NOT edit this file directly as it will be regenerated automatically when needed.
|
|
///
|
|
|
|
extension EmbeddedEventLoopTest {
|
|
|
|
static var allTests : [(String, (EmbeddedEventLoopTest) -> () throws -> Void)] {
|
|
return [
|
|
("testExecuteDoesNotImmediatelyRunTasks", testExecuteDoesNotImmediatelyRunTasks),
|
|
("testExecuteWillRunAllTasks", testExecuteWillRunAllTasks),
|
|
("testExecuteWillRunTasksAddedRecursively", testExecuteWillRunTasksAddedRecursively),
|
|
("testTasksSubmittedAfterRunDontRun", testTasksSubmittedAfterRunDontRun),
|
|
("testShutdownGracefullyRunsTasks", testShutdownGracefullyRunsTasks),
|
|
("testCanControlTime", testCanControlTime),
|
|
("testCanScheduleMultipleTasks", testCanScheduleMultipleTasks),
|
|
("testExecutedTasksFromScheduledOnesAreRun", testExecutedTasksFromScheduledOnesAreRun),
|
|
("testScheduledTasksFromScheduledTasksProperlySchedule", testScheduledTasksFromScheduledTasksProperlySchedule),
|
|
("testScheduledTasksFromExecutedTasks", testScheduledTasksFromExecutedTasks),
|
|
("testCancellingScheduledTasks", testCancellingScheduledTasks),
|
|
("testScheduledTasksFuturesFire", testScheduledTasksFuturesFire),
|
|
("testScheduledTasksFuturesError", testScheduledTasksFuturesError),
|
|
("testTaskOrdering", testTaskOrdering),
|
|
]
|
|
}
|
|
}
|
|
|