Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions Sources/_InternalTestSupport/SwiftTesting+Tags.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ extension Tag.Feature {
public enum PackageType {}
public enum ProductType {}
public enum TargetType {}
public enum Product {}

@Tag public static var BuildCache: Tag
@Tag public static var CodeCoverage: Tag
Expand All @@ -38,6 +39,7 @@ extension Tag.Feature {
@Tag public static var SpecialCharacters: Tag
@Tag public static var Snippets: Tag
@Tag public static var Traits: Tag
@Tag public static var TargetSettings: Tag

}

Expand Down Expand Up @@ -77,6 +79,17 @@ extension Tag.Feature.CommandLineArguments {
@Tag public static var Xcxx: Tag
@Tag public static var SWIFT_ORIGINAL_PATH: Tag
@Tag public static var Xswiftc: Tag
@Tag public static var TestParallel: Tag
@Tag public static var TestNoParallel: Tag
@Tag public static var TestOutputXunit: Tag
@Tag public static var TestEnableSwiftTesting: Tag
@Tag public static var TestDisableSwiftTesting: Tag
@Tag public static var TestEnableXCTest: Tag
@Tag public static var TestDisableXCTest: Tag
@Tag public static var TestFilter: Tag
@Tag public static var TestSkip: Tag
@Tag public static var SkipBuild: Tag
@Tag public static var EnableCodeCoverage: Tag
}

extension Tag.Feature.CommandLineArguments.Experimental {
Expand Down Expand Up @@ -151,3 +164,8 @@ extension Tag.Feature.PackageType {
@Tag public static var CommandPlugin: Tag
@Tag public static var Macro: Tag
}

extension Tag.Feature.Product {
@Tag public static var Execute: Tag
@Tag public static var Link: Tag
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ extension Trait where Self == Testing.Bug {
)
}

public static var IssueWindowsPathLastConponent: Self {
public static var IssueWindowsPathLastComponent: Self {
// $0.path.lastComponent in test code returns fullpaths on Windows
issue(
"https://github.com/swiftlang/swift-package-manager/issues/8554",
Expand Down
25 changes: 23 additions & 2 deletions Tests/CommandsTests/APIDiffTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,9 @@ struct APIDiffTests {
}

@Test(
.tags(
.Feature.Command.Run,
),
.requiresAPIDigester,
.issue("https://github.com/swiftlang/swift-package-manager/issues/8926", relationship: .defect),
arguments: SupportedBuildSystemOnAllPlatforms,
Expand Down Expand Up @@ -272,7 +275,13 @@ struct APIDiffTests {
}
}

@Test(.requiresAPIDigester, arguments: SupportedBuildSystemOnAllPlatforms)
@Test(
.tags(
.Feature.Command.Run,
),
.requiresAPIDigester,
arguments: SupportedBuildSystemOnAllPlatforms
)
func testAPIDiffOfModuleWithCDependency(buildSystem: BuildSystemProvider.Kind) async throws {
try await withKnownIssue("https://github.com/swiftlang/swift/issues/82394") {
try await fixture(name: "Miscellaneous/APIDiff/") { fixturePath in
Expand Down Expand Up @@ -303,7 +312,13 @@ struct APIDiffTests {
}
}

@Test(.requiresAPIDigester, arguments: SupportedBuildSystemOnAllPlatforms)
@Test(
.tags(
.Feature.Command.Run,
),
.requiresAPIDigester,
arguments: SupportedBuildSystemOnAllPlatforms
)
func testAPIDiffOfVendoredCDependency(buildSystem: BuildSystemProvider.Kind) async throws {
try await withKnownIssue("https://github.com/swiftlang/swift/issues/82394") {
try await fixture(name: "Miscellaneous/APIDiff/") { fixturePath in
Expand All @@ -318,6 +333,9 @@ struct APIDiffTests {
}

@Test(
.tags(
.Feature.Command.Run,
),
.requiresAPIDigester,
.issue("https://github.com/swiftlang/swift-package-manager/issues/8926", relationship: .defect),
arguments: SupportedBuildSystemOnAllPlatforms,
Expand All @@ -341,6 +359,9 @@ struct APIDiffTests {
}

@Test(
.tags(
.Feature.Command.Run,
),
.requiresAPIDigester,
.issue("https://github.com/swiftlang/swift-package-manager/issues/8926", relationship: .defect),
arguments: SupportedBuildSystemOnAllPlatforms,
Expand Down
4 changes: 4 additions & 0 deletions Tests/CommandsTests/BuildCommandTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,10 @@ struct BuildCommandTestCases {
}

@Test(
.tags(
.Feature.Command.Build,
.Feature.TargetType.Executable
),
.IssueWindowsLongPath,
buildDataUsingAllBuildSystemWithTags.tags,
arguments: buildDataUsingAllBuildSystemWithTags.buildData,
Expand Down
13 changes: 9 additions & 4 deletions Tests/CommandsTests/CoverageTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,16 @@ import Testing
.tags(
.TestSize.large,
.Feature.CodeCoverage,
.Feature.CommandLineArguments.EnableCodeCoverage
)
)
struct CoverageTests {
@Test(
.SWBINTTODO("Test failed because of missing plugin support in the PIF builder. This can be reinvestigated after the support is there."),
.tags(
Tag.Feature.CodeCoverage,
Tag.Feature.Command.Test,
.Feature.Command.Build,
.Feature.Command.Test,
.Feature.CommandLineArguments.BuildTests,
),
arguments: SupportedBuildSystemOnAllPlatforms,
)
Expand Down Expand Up @@ -69,8 +71,8 @@ struct CoverageTests {
.SWBINTTODO("Test failed because of missing plugin support in the PIF builder. This can be reinvestigated after the support is there."),
.IssueWindowsCannotSaveAttachment,
.tags(
Tag.Feature.CodeCoverage,
Tag.Feature.Command.Test,
.Feature.Command.Test,
.Feature.CommandLineArguments.BuildTests,
),
arguments: SupportedBuildSystemOnAllPlatforms,
)
Expand Down Expand Up @@ -129,6 +131,9 @@ struct CoverageTests {
}

@Test(
.tags(
.Feature.Command.Test,
),
arguments: getBuildData(for: SupportedBuildSystemOnAllPlatforms), [
"Coverage/Simple",
"Miscellaneous/TestDiscovery/Simple",
Expand Down
48 changes: 46 additions & 2 deletions Tests/CommandsTests/PackageCommandTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -911,6 +911,9 @@ struct PackageCommandTests {
}

@Test(
.tags(
.Feature.Command.Package.Describe
),
.IssueWindowsRelativePathAssert,
arguments: getBuildData(for: SupportedBuildSystemOnAllPlatforms),
)
Expand Down Expand Up @@ -4393,6 +4396,10 @@ struct PackageCommandTests {
}

@Test(
.tags(
.Feature.Command.Build,
.Feature.PackageType.BuildToolPlugin
),
.requiresSwiftConcurrencySupport,
arguments: getBuildData(for: SupportedBuildSystemOnAllPlatforms),
)
Expand Down Expand Up @@ -5131,6 +5138,10 @@ struct PackageCommandTests {

// Test reporting of plugin diagnostic messages at different verbosity levels
@Test(
.tags(
.Feature.Command.Build,
.Feature.PackageType.CommandPlugin
),
.requiresSwiftConcurrencySupport,
.issue(
"https://github.com/swiftlang/swift-package-manager/issues/8180",
Expand Down Expand Up @@ -5322,6 +5333,10 @@ struct PackageCommandTests {

// Test target builds requested by a command plugin
@Test(
.tags(
.Feature.Command.Run,
.Feature.PackageType.CommandPlugin
),
.IssueWindowsRelativePathAssert,
.requiresSwiftConcurrencySupport,
arguments: getBuildData(for: SupportedBuildSystemOnAllPlatforms),
Expand Down Expand Up @@ -5353,6 +5368,10 @@ struct PackageCommandTests {

// Test target builds requested by a command plugin
@Test(
.tags(
.Feature.Command.Run,
.Feature.PackageType.CommandPlugin
),
.IssueWindowsRelativePathAssert,
.requiresSwiftConcurrencySupport,
arguments: getBuildData(for: SupportedBuildSystemOnAllPlatforms),
Expand Down Expand Up @@ -5388,6 +5407,10 @@ struct PackageCommandTests {

// Test target builds requested by a command plugin
@Test(
.tags(
.Feature.Command.Run,
.Feature.PackageType.CommandPlugin
),
.IssueWindowsRelativePathAssert,
.requiresSwiftConcurrencySupport,
arguments: getBuildData(for: SupportedBuildSystemOnAllPlatforms),
Expand Down Expand Up @@ -5422,6 +5445,10 @@ struct PackageCommandTests {

// Test target builds requested by a command plugin
@Test(
.tags(
.Feature.Command.Run,
.Feature.PackageType.CommandPlugin
),
.IssueWindowsRelativePathAssert,
.requiresSwiftConcurrencySupport,
arguments: getBuildData(for: SupportedBuildSystemOnAllPlatforms),
Expand Down Expand Up @@ -5459,6 +5486,10 @@ struct PackageCommandTests {
}

@Test(
.tags(
.Feature.Command.Run,
.Feature.PackageType.CommandPlugin
),
.IssueWindowsRelativePathAssert,
arguments: getBuildData(for: SupportedBuildSystemOnAllPlatforms),
)
Expand All @@ -5484,6 +5515,10 @@ struct PackageCommandTests {
}

@Test(
.tags(
.Feature.Command.Run,
.Feature.PackageType.CommandPlugin
),
.IssueWindowsRelativePathAssert,
arguments: getBuildData(for: SupportedBuildSystemOnAllPlatforms),
)
Expand All @@ -5508,6 +5543,10 @@ struct PackageCommandTests {
}

@Test(
.tags(
.Feature.Command.Run,
.Feature.PackageType.CommandPlugin
),
.IssueWindowsRelativePathAssert,
.tags(
.Feature.Command.Package.CommandPlugin,
Expand Down Expand Up @@ -5537,6 +5576,10 @@ struct PackageCommandTests {

// Test logging of builds initiated by a command plugin
@Test(
.tags(
.Feature.Command.Build,
.Feature.PackageType.CommandPlugin
),
.IssueWindowsRelativePathAssert,
.requiresSwiftConcurrencySupport,
.tags(
Expand Down Expand Up @@ -5774,11 +5817,12 @@ struct PackageCommandTests {
@Test(
.requiresSwiftConcurrencySupport,
.tags(
.Feature.Command.Run,
.Feature.Command.Package.CommandPlugin,
),
.IssueWindowsRelativePathAssert,
.IssueWindowsLongPath,
.IssueWindowsPathLastConponent,
.IssueWindowsPathLastComponent,
.issue(
"https://github.com/swiftlang/swift-package-manager/issues/9083",
relationship: .defect,
Expand Down Expand Up @@ -6747,7 +6791,7 @@ struct PackageCommandTests {
}

@Test(
.IssueWindowsPathLastConponent,
.IssueWindowsPathLastComponent,
// Only run the test if the environment in which we're running actually supports Swift concurrency (which the plugin APIs require).
.requiresSwiftConcurrencySupport,
.tags(
Expand Down
24 changes: 24 additions & 0 deletions Tests/CommandsTests/RunCommandTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ struct RunCommandTests {
}

@Test(
.tags(
.Feature.TargetType.Executable,
),
.IssueWindowsPathTestsFailures,
.IssueWindowsRelativePathAssert,
arguments: SupportedBuildSystemOnPlatform,
Expand Down Expand Up @@ -207,6 +210,9 @@ struct RunCommandTests {


@Test(
.tags(
.Feature.TargetType.Executable,
),
.SWBINTTODO("Swift run using Swift Build does not output executable content to the terminal"),
.bug("https://github.com/swiftlang/swift-package-manager/issues/8279"),
arguments: SupportedBuildSystemOnPlatform,
Expand Down Expand Up @@ -244,6 +250,9 @@ struct RunCommandTests {


@Test(
.tags(
.Feature.TargetType.Executable,
),
.IssueWindowsPathTestsFailures,
.IssueWindowsRelativePathAssert,
arguments: SupportedBuildSystemOnPlatform,
Expand All @@ -263,6 +272,9 @@ struct RunCommandTests {
}

@Test(
.tags(
.Feature.TargetType.Executable,
),
arguments: SupportedBuildSystemOnPlatform,
)
func fileDeprecation(
Expand All @@ -282,6 +294,11 @@ struct RunCommandTests {
}

@Test(
.tags(
.Feature.TargetType.Executable,
.Feature.CommandLineArguments.BuildTests,
.Feature.CommandLineArguments.SkipBuild
),
arguments: SupportedBuildSystemOnPlatform,
)
func mutualExclusiveFlags(
Expand All @@ -304,6 +321,9 @@ struct RunCommandTests {
}

@Test(
.tags(
.Feature.TargetType.Executable,
),
arguments: SupportedBuildSystemOnPlatform,
)
func swiftRunSIGINT(
Expand Down Expand Up @@ -404,6 +424,10 @@ struct RunCommandTests {
}

@Test(
.tags(
.Feature.TargetType.Executable,
.Feature.CommandLineArguments.Quiet
),
.issue("https://github.com/swiftlang/swift-package-manager/issues/8844", relationship: .verifies),
.issue("https://github.com/swiftlang/swift-package-manager/issues/8911", relationship: .defect),
.issue("https://github.com/swiftlang/swift-package-manager/issues/8912", relationship: .defect),
Expand Down
Loading