Skip to content

Commit 8860e6d

Browse files
committed
Add a StringChecker tests
1 parent 8a01ecd commit 8860e6d

File tree

6 files changed

+241
-12
lines changed

6 files changed

+241
-12
lines changed

Package.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,6 +1019,12 @@ if ProcessInfo.processInfo.environment["SWIFTCI_DISABLE_SDK_DEPENDENT_TESTS"] ==
10191019
"_InternalTestSupport"
10201020
]
10211021
),
1022+
.testTarget(
1023+
name: "_IntegrationTestSupportTests",
1024+
dependencies: [
1025+
"_IntegrationTestSupport"
1026+
]
1027+
),
10221028
.testTarget(
10231029
name: "IntegrationTests",
10241030
dependencies: [

Sources/_InternalTestSupport/SkippedTestSupport.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ extension Trait where Self == Testing.ConditionTrait {
7373
extension Tag {
7474
public enum TestSize {}
7575
public enum Feature {}
76+
@Tag public static var UserWorkflow: Tag
7677
}
7778

7879
extension Tag.TestSize {
@@ -84,15 +85,21 @@ extension Tag.TestSize {
8485
extension Tag.Feature {
8586
public enum Command {}
8687
public enum PackageType {}
88+
89+
@Tag public static var Resource: Tag
90+
@Tag public static var SpecialCharacters: Tag
8791
}
8892

8993
extension Tag.Feature.Command {
90-
@Tag public static var package: Tag
94+
public enum Package {}
9195
@Tag public static var build: Tag
9296
@Tag public static var test: Tag
9397
@Tag public static var run: Tag
9498
}
9599

100+
extension Tag.Feature.Command.Package {
101+
@Tag public static var Init: Tag
102+
}
96103
extension Tag.Feature.PackageType {
97104
@Tag public static var library: Tag
98105
@Tag public static var executable: Tag

Tests/IntegrationTests/BasicTests.swift

Lines changed: 67 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,18 @@ import _InternalTestSupport
1414
import Testing
1515
import struct TSCBasic.ByteString
1616
import Basics
17-
@Suite
17+
@Suite(
18+
.tags(Tag.TestSize.large)
19+
)
1820
private struct BasicTests {
1921

2022
@Test(
2123
.bug("https://github.com/swiftlang/swift-package-manager/issues/8409"),
2224
.requireUnrestrictedNetworkAccess("Test requires access to https://github.com"),
25+
.tags(
26+
Tag.UserWorkflow,
27+
Tag.Feature.Command.build,
28+
),
2329
)
2430
func testExamplePackageDealer() throws {
2531
try withTemporaryDirectory { tempDir in
@@ -51,7 +57,11 @@ private struct BasicTests {
5157
}
5258
}
5359

54-
@Test
60+
@Test(
61+
.tags(
62+
Tag.Feature.Command.build,
63+
),
64+
)
5565
func testSwiftBuild() async throws {
5666
try await withTemporaryDirectory { tempDir in
5767
let packagePath = tempDir.appending(component: "tool")
@@ -88,7 +98,13 @@ private struct BasicTests {
8898
}
8999
}
90100

91-
@Test
101+
@Test(
102+
.tags(
103+
Tag.Feature.Command.Package.Init,
104+
Tag.Feature.Command.build,
105+
Tag.Feature.PackageType.executable,
106+
),
107+
)
92108
func testSwiftPackageInitExec() async throws {
93109
try await withKnownIssue("failed to build package") {
94110
try await withTemporaryDirectory { tempDir in
@@ -118,7 +134,13 @@ private struct BasicTests {
118134
}
119135
}
120136

121-
@Test
137+
@Test(
138+
.tags(
139+
Tag.Feature.Command.Package.Init,
140+
Tag.Feature.Command.test,
141+
Tag.Feature.PackageType.executable,
142+
),
143+
)
122144
func testSwiftPackageInitExecTests() async throws {
123145
try await withTemporaryDirectory { tempDir in
124146
// Create a new package with an executable target.
@@ -140,7 +162,13 @@ private struct BasicTests {
140162
}
141163
}
142164

143-
@Test
165+
@Test(
166+
.tags(
167+
Tag.Feature.Command.Package.Init,
168+
Tag.Feature.Command.build,
169+
Tag.Feature.PackageType.library,
170+
),
171+
)
144172
func testSwiftPackageInitLib() throws {
145173
try withTemporaryDirectory { tempDir in
146174
// Create a new package with an executable target.
@@ -159,7 +187,14 @@ private struct BasicTests {
159187
}
160188
}
161189

162-
@Test
190+
@Test(
191+
.tags(
192+
Tag.Feature.Command.Package.Init,
193+
Tag.Feature.Command.test,
194+
Tag.Feature.PackageType.library,
195+
Tag.Feature.SpecialCharacters,
196+
),
197+
)
163198
func testSwiftPackageLibsTests() throws {
164199
try withTemporaryDirectory { tempDir in
165200
// Create a new package with an executable target.
@@ -174,7 +209,12 @@ private struct BasicTests {
174209
}
175210
}
176211

177-
@Test
212+
@Test(
213+
.tags(
214+
Tag.Feature.Command.build,
215+
Tag.Feature.SpecialCharacters,
216+
),
217+
)
178218
func testSwiftPackageWithSpaces() async throws {
179219
try await withTemporaryDirectory { tempDir in
180220
let packagePath = tempDir.appending(components: "more spaces", "special tool")
@@ -222,7 +262,13 @@ private struct BasicTests {
222262
}
223263
}
224264

225-
@Test
265+
@Test(
266+
.tags(
267+
Tag.Feature.Command.run,
268+
Tag.Feature.Command.Package.Init,
269+
Tag.Feature.PackageType.executable,
270+
),
271+
)
226272
func testSwiftRun() throws {
227273
try withTemporaryDirectory { tempDir in
228274
let packagePath = tempDir.appending(component: "secho")
@@ -260,6 +306,13 @@ private struct BasicTests {
260306
}
261307
}
262308

309+
@Test(
310+
.tags(
311+
Tag.Feature.Command.test,
312+
Tag.Feature.Command.Package.Init,
313+
Tag.Feature.PackageType.library,
314+
),
315+
)
263316
func testSwiftTest() throws {
264317
try withTemporaryDirectory { tempDir in
265318
let packagePath = tempDir.appending(component: "swiftTest")
@@ -302,7 +355,12 @@ private struct BasicTests {
302355
}
303356
}
304357

305-
@Test
358+
@Test(
359+
.tags(
360+
Tag.Feature.Command.test,
361+
Tag.Feature.Resource,
362+
),
363+
)
306364
func testSwiftTestWithResources() async throws {
307365
try await fixture(name: "Miscellaneous/PackageWithResource/") { packagePath in
308366

Tests/IntegrationTests/SwiftPMTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ private struct SwiftPMTests {
8585
"[Windows] Integration test SwiftPMTests.packageInitExecutable with --build-system swiftbuild is skipped"
8686
),
8787
.tags(
88-
Tag.Feature.Command.package,
88+
Tag.Feature.Command.Package.Init,
8989
Tag.Feature.PackageType.executable,
9090
),
9191
arguments: SupportedBuildSystemOnPlatform,
@@ -123,7 +123,7 @@ private struct SwiftPMTests {
123123
.bug("https://github.com/swiftlang/swift-package-manager/issues/8380", "lld-link: error: subsystem must be defined"),
124124
.bug(id: 0, "SWBINTTODO: MacOS: Could not find or use auto-linked library 'Testing': library 'Testing' not found"),
125125
.tags(
126-
Tag.Feature.Command.package,
126+
Tag.Feature.Command.Package.Init,
127127
Tag.Feature.PackageType.library,
128128
),
129129
arguments: SupportedBuildSystemOnPlatform,

0 commit comments

Comments
 (0)