From f032f64133f826724b359bfb81d24e9e46630563 Mon Sep 17 00:00:00 2001 From: Stephen Celis Date: Wed, 22 Sep 2021 10:54:49 -0400 Subject: [PATCH 1/8] wip --- .github/workflows/ci.yml | 10 +++++++++- Makefile | 24 +++++++++--------------- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d1c4521..7ffcfa7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,16 +35,23 @@ jobs: strategy: matrix: swift: + - 5.3 - 5.4 - 5.5 steps: - uses: actions/checkout@v2 - name: Run tests - run: make test-linux-${{ matrix.swift }} + run: make test-linux SWIFT_VERSION=${{ matrix.swift }} windows: name: Windows runs-on: windows-latest + strategy: + matrix: + swift: + - 5.3 + - 5.4 + - 5.5 timeout-minutes: 30 steps: - uses: actions/checkout@v2 @@ -52,3 +59,4 @@ jobs: uses: MaxDesiatov/swift-windows-action@v1 with: shell-action: swift test && swift build -c release + swift-version: ${{ matrix.swift }} diff --git a/Makefile b/Makefile index 4d9d11c..6af3c7e 100644 --- a/Makefile +++ b/Makefile @@ -3,23 +3,17 @@ PLATFORM_MACOS = macOS PLATFORM_MAC_CATALYST = macOS,variant=Mac Catalyst PLATFORM_TVOS = tvOS Simulator,name=Apple TV 4K (at 1080p) PLATFORM_WATCHOS = watchOS Simulator,name=Apple Watch Series 4 - 44mm +SWIFT_VERSION = 5.5 -test-all: test-linux-all test-swift test-platforms +test-all: test-linux test-swift test-platforms -test-linux-all: test-linux-5.4 test-linux-5.5 - -test-linux-5.4: - $(call test-linux,5.4) - -test-linux-5.5: - $(call test-linux,5.5) - -test-linux = docker run \ - --rm \ - -v "$(PWD):$(PWD)" \ - -w "$(PWD)" \ - swift:$(1) \ - bash -c 'make test-swift' +test-linux: + docker run \ + --rm \ + -v "$(PWD):$(PWD)" \ + -w "$(PWD)" \ + swift:$(SWIFT_VERSION) \ + bash -c 'make test-swift' test-swift: swift test \ From b8dbb3836059ba86aa12956df33a01003777d69d Mon Sep 17 00:00:00 2001 From: Stephen Celis Date: Wed, 22 Sep 2021 11:14:57 -0400 Subject: [PATCH 2/8] wip --- .github/workflows/ci.yml | 4 ++-- Makefile | 12 +++++++----- Tests/CustomDumpTests/DumpTests.swift | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7ffcfa7..bbbe2d8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,7 +41,7 @@ jobs: steps: - uses: actions/checkout@v2 - name: Run tests - run: make test-linux SWIFT_VERSION=${{ matrix.swift }} + run: make test-linux-${{ matrix.swift }} windows: name: Windows @@ -58,5 +58,5 @@ jobs: - name: Install Swift & Run tests uses: MaxDesiatov/swift-windows-action@v1 with: - shell-action: swift test && swift build -c release + shell-action: make test-swift SWIFT_VERSION=${{ matrix.swift }} swift-version: ${{ matrix.swift }} diff --git a/Makefile b/Makefile index 6af3c7e..9e10a23 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,10 @@ PLATFORM_MAC_CATALYST = macOS,variant=Mac Catalyst PLATFORM_TVOS = tvOS Simulator,name=Apple TV 4K (at 1080p) PLATFORM_WATCHOS = watchOS Simulator,name=Apple Watch Series 4 - 44mm SWIFT_VERSION = 5.5 +ifeq ($(SWIFT_VERSION),5.3) +SWIFT_BUILD_ARGS = --enable-test-discovery +endif +SWIFT_TEST_ARGS = --parallel test-all: test-linux test-swift test-platforms @@ -13,13 +17,11 @@ test-linux: -v "$(PWD):$(PWD)" \ -w "$(PWD)" \ swift:$(SWIFT_VERSION) \ - bash -c 'make test-swift' + bash -c 'make test-swift SWIFT_VERSION=$(SWIFT_VERSION)' test-swift: - swift test \ - --parallel - swift build \ - --configuration release + swift test $(SWIFT_BUILD_ARGS) $(SWIFT_TEST_ARGS) + swift build --configuration release $(SWIFT_BUILD_ARGS) test-platforms: xcodebuild test \ diff --git a/Tests/CustomDumpTests/DumpTests.swift b/Tests/CustomDumpTests/DumpTests.swift index 0bc62da..44be013 100644 --- a/Tests/CustomDumpTests/DumpTests.swift +++ b/Tests/CustomDumpTests/DumpTests.swift @@ -967,7 +967,7 @@ final class DumpTests: XCTestCase { DumpTests.(unknown context).(unknown context).BridgedError.thisIsFine(94) """ ) - #else + #elseif compiler(>=5.4) // Can't unwrap bridged Errors on Linux: https://bugs.swift.org/browse/SR-15191 XCTAssertNoDifference( dump.replacingOccurrences( From fe71884af959362f8703cd13adcc195e84e99885 Mon Sep 17 00:00:00 2001 From: Stephen Celis Date: Wed, 22 Sep 2021 11:16:31 -0400 Subject: [PATCH 3/8] wip --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bbbe2d8..82398cb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,7 +41,7 @@ jobs: steps: - uses: actions/checkout@v2 - name: Run tests - run: make test-linux-${{ matrix.swift }} + run: make test-linux SWIFT_VERSION=${{ matrix.swift }} windows: name: Windows From 24e90c1739df7f3ac15d71c75d9ec8b35e2cab57 Mon Sep 17 00:00:00 2001 From: Stephen Celis Date: Wed, 22 Sep 2021 11:32:36 -0400 Subject: [PATCH 4/8] wip --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 82398cb..37d5773 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -58,5 +58,5 @@ jobs: - name: Install Swift & Run tests uses: MaxDesiatov/swift-windows-action@v1 with: - shell-action: make test-swift SWIFT_VERSION=${{ matrix.swift }} + shell-action: swift test && swift build --configuration release swift-version: ${{ matrix.swift }} From c32ccd1509b355523d32578effe04620ddcd3808 Mon Sep 17 00:00:00 2001 From: Stephen Celis Date: Wed, 22 Sep 2021 11:36:36 -0400 Subject: [PATCH 5/8] wip --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 37d5773..b2731da 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,7 +49,7 @@ jobs: strategy: matrix: swift: - - 5.3 + #- 5.3 - 5.4 - 5.5 timeout-minutes: 30 From 9193b99143c473a4016778c187fa8f850aa5f9bc Mon Sep 17 00:00:00 2001 From: Stephen Celis Date: Wed, 22 Sep 2021 11:44:15 -0400 Subject: [PATCH 6/8] wip --- Sources/CustomDump/Conformances/Foundation.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/CustomDump/Conformances/Foundation.swift b/Sources/CustomDump/Conformances/Foundation.swift index 2d0a8b3..cd4759f 100644 --- a/Sources/CustomDump/Conformances/Foundation.swift +++ b/Sources/CustomDump/Conformances/Foundation.swift @@ -5,8 +5,8 @@ import Foundation #endif // NB: Xcode 13 does not include macOS 12 SDK -// NB: Swift 5.5 does not include AttributedString in Linux (yet) -#if compiler(>=5.5) && !os(macOS) && !targetEnvironment(macCatalyst) && !os(Linux) +// NB: Swift 5.5 does not include AttributedString on other platforms (yet) +#if compiler(>=5.5) && (os(iOS) || os(tvOS) || os(watchOS)) @available(iOS 15, macOS 12, tvOS 15, watchOS 8, *) extension AttributedString: CustomDumpRepresentable { public var customDumpValue: Any { From d23b29f11b13cbb14b7d7f1c72b460e521bf7ad1 Mon Sep 17 00:00:00 2001 From: Stephen Celis Date: Wed, 22 Sep 2021 11:44:46 -0400 Subject: [PATCH 7/8] wip --- Tests/CustomDumpTests/DumpTests.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/CustomDumpTests/DumpTests.swift b/Tests/CustomDumpTests/DumpTests.swift index 44be013..005f353 100644 --- a/Tests/CustomDumpTests/DumpTests.swift +++ b/Tests/CustomDumpTests/DumpTests.swift @@ -718,7 +718,7 @@ final class DumpTests: XCTestCase { func testFoundation() { var dump = "" - #if compiler(>=5.5) && !os(macOS) && !targetEnvironment(macCatalyst) && !os(Linux) + #if compiler(>=5.5) && (os(iOS) || os(tvOS) || os(watchOS)) if #available(iOS 15, macOS 12, tvOS 15, watchOS 8, *) { dump = "" customDump( From e6ae74b0c6df6861297ba51a5898fef66a4009ae Mon Sep 17 00:00:00 2001 From: Stephen Celis Date: Wed, 22 Sep 2021 12:52:45 -0400 Subject: [PATCH 8/8] wip --- Sources/CustomDump/Conformances/Foundation.swift | 2 +- Tests/CustomDumpTests/DumpTests.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/CustomDump/Conformances/Foundation.swift b/Sources/CustomDump/Conformances/Foundation.swift index cd4759f..861ba66 100644 --- a/Sources/CustomDump/Conformances/Foundation.swift +++ b/Sources/CustomDump/Conformances/Foundation.swift @@ -6,7 +6,7 @@ import Foundation // NB: Xcode 13 does not include macOS 12 SDK // NB: Swift 5.5 does not include AttributedString on other platforms (yet) -#if compiler(>=5.5) && (os(iOS) || os(tvOS) || os(watchOS)) +#if compiler(>=5.5) && !targetEnvironment(macCatalyst) && (os(iOS) || os(tvOS) || os(watchOS)) @available(iOS 15, macOS 12, tvOS 15, watchOS 8, *) extension AttributedString: CustomDumpRepresentable { public var customDumpValue: Any { diff --git a/Tests/CustomDumpTests/DumpTests.swift b/Tests/CustomDumpTests/DumpTests.swift index 005f353..f7155d2 100644 --- a/Tests/CustomDumpTests/DumpTests.swift +++ b/Tests/CustomDumpTests/DumpTests.swift @@ -718,7 +718,7 @@ final class DumpTests: XCTestCase { func testFoundation() { var dump = "" - #if compiler(>=5.5) && (os(iOS) || os(tvOS) || os(watchOS)) + #if compiler(>=5.5) && !targetEnvironment(macCatalyst) && (os(iOS) || os(tvOS) || os(watchOS)) if #available(iOS 15, macOS 12, tvOS 15, watchOS 8, *) { dump = "" customDump(