From a51a548a83e5644ffc839c9066d27331d560d2b6 Mon Sep 17 00:00:00 2001 From: Marcos Griselli <14804033+marcosgriselli@users.noreply.github.com> Date: Sun, 27 Oct 2024 02:34:50 -0700 Subject: [PATCH] Skip failing test on Linux until upstream fix (#1517) * Skip failing test on Linux * Skip more tests * Skip more tests * One more skip --- Sources/TestSupport/TestHelpers.swift | 8 ++++++++ Tests/FixtureTests/FixtureTests.swift | 3 ++- Tests/PerformanceTests/PerformanceTests.swift | 3 +++ Tests/XcodeGenKitTests/ProjectGeneratorTests.swift | 3 ++- Tests/XcodeGenKitTests/SchemeGeneratorTests.swift | 3 ++- Tests/XcodeGenKitTests/SourceGeneratorTests.swift | 3 ++- 6 files changed, 19 insertions(+), 4 deletions(-) diff --git a/Sources/TestSupport/TestHelpers.swift b/Sources/TestSupport/TestHelpers.swift index 62cbaab33..757856dff 100644 --- a/Sources/TestSupport/TestHelpers.swift +++ b/Sources/TestSupport/TestHelpers.swift @@ -124,3 +124,11 @@ extension XCTestCase { describe(name, test) } } + + +public func skipIfNecessary() throws { + #if os(Linux) && swift(<6.0.2) + // https://github.com/swiftlang/swift-foundation/pull/1002 + throw XCTSkip("Skipping test on Linux until PropertyListDecoder issues are fixed.") + #endif +} \ No newline at end of file diff --git a/Tests/FixtureTests/FixtureTests.swift b/Tests/FixtureTests/FixtureTests.swift index 19cdcdb05..c638098f7 100644 --- a/Tests/FixtureTests/FixtureTests.swift +++ b/Tests/FixtureTests/FixtureTests.swift @@ -8,7 +8,8 @@ import TestSupport class FixtureTests: XCTestCase { - func testProjectFixture() { + func testProjectFixture() throws { + try skipIfNecessary() describe { $0.it("generates Test Project") { try generateXcodeProject(specPath: fixturePath + "TestProject/AnotherProject/project.yml") diff --git a/Tests/PerformanceTests/PerformanceTests.swift b/Tests/PerformanceTests/PerformanceTests.swift index 48f604c04..c1a3d2b03 100644 --- a/Tests/PerformanceTests/PerformanceTests.swift +++ b/Tests/PerformanceTests/PerformanceTests.swift @@ -1,6 +1,7 @@ import Foundation import PathKit import ProjectSpec +import TestSupport import XcodeGenKit import XcodeProj import XCTest @@ -62,6 +63,7 @@ class FixturePerformanceTests: XCTestCase { } func testFixtureGeneration() throws { + try skipIfNecessary() let project = try Project(path: specPath) measure { let generator = ProjectGenerator(project: project) @@ -70,6 +72,7 @@ class FixturePerformanceTests: XCTestCase { } func testFixtureWriting() throws { + try skipIfNecessary() let project = try Project(path: specPath) let generator = ProjectGenerator(project: project) let xcodeProject = try generator.generateXcodeProject(userName: "someUser") diff --git a/Tests/XcodeGenKitTests/ProjectGeneratorTests.swift b/Tests/XcodeGenKitTests/ProjectGeneratorTests.swift index 5db44698a..194dc0823 100644 --- a/Tests/XcodeGenKitTests/ProjectGeneratorTests.swift +++ b/Tests/XcodeGenKitTests/ProjectGeneratorTests.swift @@ -275,7 +275,8 @@ class ProjectGeneratorTests: XCTestCase { } } - func testTargets() { + func testTargets() throws { + try skipIfNecessary() describe { let project = Project(name: "test", targets: targets) diff --git a/Tests/XcodeGenKitTests/SchemeGeneratorTests.swift b/Tests/XcodeGenKitTests/SchemeGeneratorTests.swift index 07f63a925..3aad22c5e 100644 --- a/Tests/XcodeGenKitTests/SchemeGeneratorTests.swift +++ b/Tests/XcodeGenKitTests/SchemeGeneratorTests.swift @@ -41,7 +41,8 @@ private let uiTest = Target( class SchemeGeneratorTests: XCTestCase { - func testSchemes() { + func testSchemes() throws { + try skipIfNecessary() describe { let buildTarget = Scheme.BuildTarget(target: .local(app.name)) diff --git a/Tests/XcodeGenKitTests/SourceGeneratorTests.swift b/Tests/XcodeGenKitTests/SourceGeneratorTests.swift index 89405629c..bdf955cef 100644 --- a/Tests/XcodeGenKitTests/SourceGeneratorTests.swift +++ b/Tests/XcodeGenKitTests/SourceGeneratorTests.swift @@ -9,7 +9,8 @@ import TestSupport class SourceGeneratorTests: XCTestCase { - func testSourceGenerator() { + func testSourceGenerator() throws { + try skipIfNecessary() describe { let directoryPath = Path("TestDirectory")