Files
swift-mirror/test/Distributed/Inputs/CustomSerialExecutorAvailability.swift
Allan Shortlidge fdc7ebddbc Tests: Make distributed_actor_custom_executor_availability.swift use an explicit deployment target.
Split distributed_actor_custom_executor_availability.swift into two tests, one
that only runs on existing platforms that support back deployment to Swift 5.7
aligned runtimes, and another test that is not restricted by platform that
tests behavior when deploying to a Swift 5.9 aligned runtime or later.
2024-01-24 22:21:51 -08:00

63 lines
1.5 KiB
Swift

import Distributed
import FakeDistributedActorSystems
@available(SwiftStdlib 5.7, *)
typealias DefaultDistributedActorSystem = LocalTestingDistributedActorSystem
@available(SwiftStdlib 5.7, *)
distributed actor FiveSevenActor_NothingExecutor {
nonisolated var unownedExecutor: UnownedSerialExecutor {
print("get unowned executor")
return MainActor.sharedUnownedExecutor
}
@available(SwiftStdlib 5.9, *)
distributed func test(x: Int) throws {
print("executed: \(#function)")
defer {
print("done executed: \(#function)")
}
MainActor.assumeIsolated {
// ignore
}
}
}
@available(SwiftStdlib 5.9, *)
distributed actor FiveNineActor_NothingExecutor {
nonisolated var unownedExecutor: UnownedSerialExecutor {
print("get unowned executor")
return MainActor.sharedUnownedExecutor
}
distributed func test(x: Int) throws {
print("executed: \(#function)")
defer {
print("done executed: \(#function)")
}
MainActor.assumeIsolated {
// ignore
}
}
}
@available(SwiftStdlib 5.7, *)
distributed actor FiveSevenActor_FiveNineExecutor {
@available(SwiftStdlib 5.9, *)
nonisolated var unownedExecutor: UnownedSerialExecutor {
print("get unowned executor")
return MainActor.sharedUnownedExecutor
}
@available(SwiftStdlib 5.9, *)
distributed func test(x: Int) throws {
print("executed: \(#function)")
defer {
print("done executed: \(#function)")
}
MainActor.assumeIsolated {
// ignore
}
}
}