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
12 changes: 10 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,28 @@ 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
- name: Install Swift & Run tests
uses: MaxDesiatov/swift-windows-action@v1
with:
shell-action: swift test && swift build -c release
shell-action: swift test && swift build --configuration release
swift-version: ${{ matrix.swift }}
34 changes: 15 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,25 @@ 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
ifeq ($(SWIFT_VERSION),5.3)
SWIFT_BUILD_ARGS = --enable-test-discovery
endif
SWIFT_TEST_ARGS = --parallel

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 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 \
Expand Down
4 changes: 2 additions & 2 deletions Sources/CustomDump/Conformances/Foundation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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) && !targetEnvironment(macCatalyst) && (os(iOS) || os(tvOS) || os(watchOS))
@available(iOS 15, macOS 12, tvOS 15, watchOS 8, *)
extension AttributedString: CustomDumpRepresentable {
public var customDumpValue: Any {
Expand Down
4 changes: 2 additions & 2 deletions Tests/CustomDumpTests/DumpTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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) && !targetEnvironment(macCatalyst) && (os(iOS) || os(tvOS) || os(watchOS))
if #available(iOS 15, macOS 12, tvOS 15, watchOS 8, *) {
dump = ""
customDump(
Expand Down Expand Up @@ -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(
Expand Down