Skip to content

Commit e2c3089

Browse files
authored
Merge pull request swiftlang#39862 from apple/wip-speedup-test
2 parents b413a0f + 407bd53 commit e2c3089

File tree

2 files changed

+26
-39
lines changed

2 files changed

+26
-39
lines changed

test/Distributed/Runtime/distributed_actor_dynamic_remote_func.swift

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-run-simple-swift(-Xfrontend -enable-experimental-distributed -parse-as-library) | %FileCheck %s
1+
// RUN: %target-run-simple-swift(-Xfrontend -enable-experimental-distributed -parse-as-library -Xfrontend -disable-availability-checking) | %FileCheck %s
22

33
// REQUIRES: executable_test
44
// REQUIRES: concurrency
@@ -12,7 +12,6 @@
1212

1313
import _Distributed
1414

15-
@available(SwiftStdlib 5.5, *)
1615
distributed actor LocalWorker {
1716
init(transport: ActorTransport) {
1817
defer { transport.actorReady(self) } // FIXME(distributed): rdar://81783599 this should be injected automatically
@@ -27,7 +26,6 @@ distributed actor LocalWorker {
2726
}
2827
}
2928

30-
@available(SwiftStdlib 5.5, *)
3129
extension LocalWorker {
3230
@_dynamicReplacement(for: _remote_function())
3331
// TODO(distributed): @_remoteDynamicReplacement(for: function()) - could be a nicer spelling, hiding that we use dynamic under the covers
@@ -44,16 +42,13 @@ extension LocalWorker {
4442

4543
// ==== Fake Transport ---------------------------------------------------------
4644

47-
48-
@available(SwiftStdlib 5.5, *)
4945
struct ActorAddress: ActorIdentity {
5046
let address: String
5147
init(parse address : String) {
5248
self.address = address
5349
}
5450
}
5551

56-
@available(SwiftStdlib 5.5, *)
5752
struct FakeTransport: ActorTransport {
5853
func decodeIdentity(from decoder: Decoder) throws -> AnyActorIdentity {
5954
fatalError("not implemented:\(#function)")
@@ -83,7 +78,6 @@ struct FakeTransport: ActorTransport {
8378

8479
// ==== Execute ----------------------------------------------------------------
8580

86-
@available(SwiftStdlib 5.5, *)
8781
func test_local() async throws {
8882
let transport = FakeTransport()
8983

@@ -95,7 +89,6 @@ func test_local() async throws {
9589
// CHECK: call: local:
9690
}
9791

98-
@available(SwiftStdlib 5.5, *)
9992
func test_remote() async throws {
10093
let address = ActorAddress(parse: "")
10194
let transport = FakeTransport()
@@ -110,7 +103,6 @@ func test_remote() async throws {
110103
// CHECK: call: _cluster_remote_echo(name:):Charlie
111104
}
112105

113-
@available(SwiftStdlib 5.5, *)
114106
@main struct Main {
115107
static func main() async {
116108
try! await test_local()
Lines changed: 25 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-run-simple-swift( -Xfrontend -disable-availability-checking -Xfrontend -enable-experimental-distributed -parse-as-library)
1+
// RUN: %target-run-simple-swift(-Xfrontend -disable-availability-checking -Xfrontend -enable-experimental-distributed -parse-as-library) | %FileCheck %s
22

33
// REQUIRES: executable_test
44
// REQUIRES: concurrency
@@ -8,52 +8,47 @@
88
// UNSUPPORTED: use_os_stdlib
99
// UNSUPPORTED: back_deployment_runtime
1010

11-
import StdlibUnittest
1211
import _Distributed
1312

14-
@available(SwiftStdlib 5.5, *)
1513
struct ActorAddress: ActorIdentity, CustomStringConvertible {
1614
let id: String
1715
var description: Swift.String {
1816
"ActorAddress(id: \(id))"
1917
}
2018
}
2119

22-
@main struct Main {
23-
static func main() async {
24-
if #available(SwiftStdlib 5.5, *) {
25-
26-
let ActorIdentityTests = TestSuite("ActorIdentity")
2720

28-
ActorIdentityTests.test("equality") {
29-
let a = ActorAddress(id: "a")
30-
let b = ActorAddress(id: "b")
21+
func equality() {
22+
let a = ActorAddress(id: "a")
23+
let b = ActorAddress(id: "b")
3124

32-
let anyA = AnyActorIdentity(a)
33-
let anyB = AnyActorIdentity(b)
25+
let anyA = AnyActorIdentity(a)
26+
let anyB = AnyActorIdentity(b)
3427

35-
expectEqual(a, a)
36-
expectEqual(anyA, anyA)
28+
print("\(a == a)") // CHECK: true
29+
print("\(anyA == anyA)") // CHECK: true
3730

38-
expectNotEqual(a, b)
39-
expectNotEqual(anyA, anyB)
40-
}
31+
print("\(a != b)") // CHECK: true
32+
print("\(anyA != anyB)") // CHECK: true
33+
}
4134

42-
ActorIdentityTests.test("hash") {
43-
let a = ActorAddress(id: "a")
44-
let b = ActorAddress(id: "b")
35+
func hash() {
36+
let a = ActorAddress(id: "a")
37+
let b = ActorAddress(id: "b")
4538

46-
let anyA = AnyActorIdentity(a)
47-
let anyB = AnyActorIdentity(b)
39+
let anyA = AnyActorIdentity(a)
40+
let anyB = AnyActorIdentity(b)
4841

49-
expectEqual(a.hashValue, a.hashValue)
50-
expectEqual(anyA.hashValue, anyA.hashValue)
42+
print("\(a.hashValue == a.hashValue)") // CHECK: true
43+
print("\(anyA.hashValue == anyA.hashValue)") // CHECK: true
5144

52-
expectNotEqual(a.hashValue, b.hashValue)
53-
expectNotEqual(anyA.hashValue, anyB.hashValue)
54-
}
55-
}
45+
print("\(a.hashValue != b.hashValue)") // CHECK: true
46+
print("\(anyA.hashValue != anyB.hashValue)") // CHECK: true
47+
}
5648

57-
await runAllTestsAsync()
49+
@main struct Main {
50+
static func main() {
51+
equality()
52+
hash()
5853
}
5954
}

0 commit comments

Comments
 (0)