Skip to content

Commit 9eafd94

Browse files
committed
Add test target without test support linking.
1 parent e876472 commit 9eafd94

File tree

4 files changed

+77
-2
lines changed

4 files changed

+77
-2
lines changed

Package.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ let package = Package(
3131
"IssueReportingTestSupport",
3232
]
3333
),
34+
.testTarget(
35+
name: "IssueReportingTestsNoSupport",
36+
dependencies: [
37+
"IssueReporting",
38+
]
39+
),
3440
.target(
3541
name: "IssueReportingTestSupport"
3642
),

Package@swift-6.0.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ let package = Package(
3030
"IssueReportingTestSupport",
3131
]
3232
),
33+
.testTarget(
34+
name: "IssueReportingTestsNoSupport",
35+
dependencies: [
36+
"IssueReporting",
37+
]
38+
),
3339
.target(
3440
name: "IssueReportingTestSupport"
3541
),

Tests/IssueReporting.xctestplan

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,20 @@
1212

1313
},
1414
"testTargets" : [
15+
{
16+
"target" : {
17+
"containerPath" : "container:Examples\/Examples.xcodeproj",
18+
"identifier" : "CADE79BA2C4A9D2D005A85F7",
19+
"name" : "ExamplesTests"
20+
}
21+
},
22+
{
23+
"target" : {
24+
"containerPath" : "container:",
25+
"identifier" : "XCTestDynamicOverlayTests",
26+
"name" : "XCTestDynamicOverlayTests"
27+
}
28+
},
1529
{
1630
"target" : {
1731
"containerPath" : "container:",
@@ -22,8 +36,8 @@
2236
{
2337
"target" : {
2438
"containerPath" : "container:",
25-
"identifier" : "XCTestDynamicOverlayTests",
26-
"name" : "XCTestDynamicOverlayTests"
39+
"identifier" : "IssueReportingTestsNoSupport",
40+
"name" : "IssueReportingTestsNoSupport"
2741
}
2842
}
2943
],
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import IssueReporting
2+
import Testing
3+
4+
@Suite struct WithExpectedIssueTests {
5+
@Test func sync() {
6+
withExpectedIssue {
7+
reportIssue()
8+
}
9+
}
10+
11+
@Test func syncThrows() throws {
12+
withExpectedIssue {
13+
reportIssue()
14+
throw SomeError()
15+
}
16+
}
17+
18+
@Test func asyncAwaitBefore() async {
19+
await withExpectedIssue {
20+
await Task.yield()
21+
reportIssue()
22+
}
23+
}
24+
25+
@Test func asyncAwaitAfter() async {
26+
await withExpectedIssue {
27+
reportIssue()
28+
await Task.yield()
29+
}
30+
}
31+
32+
@Test func asyncAwaitBeforeThrows() async throws {
33+
await withExpectedIssue {
34+
await Task.yield()
35+
reportIssue()
36+
throw SomeError()
37+
}
38+
}
39+
40+
@Test func asyncAwaitAfterThrows() async throws {
41+
await withExpectedIssue {
42+
reportIssue()
43+
await Task.yield()
44+
throw SomeError()
45+
}
46+
}
47+
}
48+
49+
private struct SomeError: Error {}

0 commit comments

Comments
 (0)