Skip to content

Commit d9bcb45

Browse files
authored
Add tags to Swift Testing Tests (#9292)
relates to: #9287
1 parent 1770fc1 commit d9bcb45

File tree

7 files changed

+386
-77
lines changed

7 files changed

+386
-77
lines changed

Sources/CoreCommands/Options.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ public struct BuildOptions: ParsableArguments {
489489
/// Which compile-time sanitizers should be enabled.
490490
@Option(
491491
name: .customLong("sanitize"),
492-
help: "Turn on runtime checks for erroneous behavior, possible values: \(Sanitizer.formattedValues)."
492+
help: "Turn on runtime checks for erroneous behavior."
493493
)
494494
public var sanitizers: [Sanitizer] = []
495495

Sources/_InternalTestSupport/BuildSystemProvider+Supported.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@ public struct BuildData {
3131
public func getBuildData(for buildSystems: [BuildSystemProvider.Kind]) -> [BuildData] {
3232
buildSystems.flatMap { buildSystem in
3333
BuildConfiguration.allCases.compactMap { config in
34-
return BuildData(buildSystem: buildSystem, config: config)
34+
return BuildData(
35+
buildSystem: buildSystem,
36+
config: config,
37+
)
3538
}
3639
}
3740
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
This source file is part of the Swift.org open source project
3+
4+
Copyright (c) 2025 Apple Inc. and the Swift project authors
5+
Licensed under Apache License v2.0 with Runtime Library Exception
6+
7+
See http://swift.org/LICENSE.txt for license information
8+
See http://swift.org/CONTRIBUTORS.txt for Swift project authors
9+
*/
10+
11+
import Testing
12+
13+
public struct TestBuildData {
14+
public let buildData: [BuildData]
15+
public let tags: any TestTrait
16+
}
17+
18+
public let buildDataUsingAllBuildSystemWithTags = TestBuildData(
19+
buildData: getBuildData(for: SupportedBuildSystemOnPlatform),
20+
tags: .tags(
21+
.Feature.CommandLineArguments.BuildSystem,
22+
.Feature.CommandLineArguments.Configuration
23+
)
24+
)
25+
26+
public let buildDataUsingBuildSystemAvailableOnAllPlatformsWithTags = TestBuildData(
27+
buildData: getBuildData(for: SupportedBuildSystemOnAllPlatforms),
28+
tags: .tags(
29+
.Feature.CommandLineArguments.BuildSystem,
30+
.Feature.CommandLineArguments.Configuration
31+
)
32+
)

Sources/_InternalTestSupport/SwiftTesting+Tags.swift

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,13 @@ extension Tag.TestSize {
2424

2525
extension Tag.Feature {
2626
public enum Command {}
27+
public enum CommandLineArguments {}
28+
public enum EnvironmentVariables {}
2729
public enum PackageType {}
2830
public enum ProductType {}
2931
public enum TargetType {}
3032

33+
@Tag public static var BuildCache: Tag
3134
@Tag public static var CodeCoverage: Tag
3235
@Tag public static var Mirror: Tag
3336
@Tag public static var NetRc: Tag
@@ -47,6 +50,45 @@ extension Tag.Feature.Command {
4750
@Tag public static var Test: Tag
4851
}
4952

53+
extension Tag.Feature.CommandLineArguments {
54+
public enum Experimental {}
55+
@Tag public static var BuildSystem: Tag
56+
@Tag public static var BuildTests: Tag
57+
@Tag public static var Configuration: Tag
58+
@Tag public static var DisableGetTaskAllowEntitlement: Tag
59+
@Tag public static var EnableParseableModuleInterfaces: Tag
60+
@Tag public static var EnableGetTaskAllowEntitlement: Tag
61+
@Tag public static var EnableTestDiscovery: Tag
62+
@Tag public static var ExplicitTargetDependencyImportCheck: Tag
63+
@Tag public static var Help: Tag
64+
@Tag public static var Product: Tag
65+
@Tag public static var PrintManifestJobGraph: Tag
66+
@Tag public static var PrintPIFManifestGraph: Tag
67+
@Tag public static var Quiet: Tag
68+
@Tag public static var ShowBinPath: Tag
69+
@Tag public static var Target: Tag
70+
@Tag public static var Toolset: Tag
71+
@Tag public static var Triple: Tag
72+
@Tag public static var Version: Tag
73+
@Tag public static var Verbose: Tag
74+
@Tag public static var VeryVerbose: Tag
75+
@Tag public static var Xlinker: Tag
76+
@Tag public static var Xcc: Tag
77+
@Tag public static var Xcxx: Tag
78+
@Tag public static var SWIFT_ORIGINAL_PATH: Tag
79+
@Tag public static var Xswiftc: Tag
80+
}
81+
82+
extension Tag.Feature.CommandLineArguments.Experimental {
83+
@Tag public static var BuildDylibsAsFrameworks: Tag
84+
}
85+
extension Tag.Feature.EnvironmentVariables {
86+
@Tag public static var CUSTOM_SWIFT_VERSION: Tag
87+
@Tag public static var SWIFT_EXEC: Tag
88+
@Tag public static var SWIFT_EXEC_MANIFEST: Tag
89+
@Tag public static var SWIFT_ORIGINAL_PATH: Tag
90+
}
91+
5092
extension Tag.Feature.Command.Package {
5193
@Tag public static var General: Tag
5294
@Tag public static var AddDependency: Tag

0 commit comments

Comments
 (0)