Skip to content

Commit 28e6849

Browse files
authored
Merge pull request #98 from SDWebImage/travis_catalina
Update the Travis-CI to use Catalina and enable macOS test case
2 parents 1ed96d9 + fdd36a0 commit 28e6849

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

.travis.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
language: swift
2-
osx_image: xcode11.3
2+
osx_image: xcode11.4
33

44
env:
55
global:
@@ -43,13 +43,12 @@ script:
4343
- echo Run the tests
4444
- xcodebuild clean test -project SDWebImageSwiftUI.xcodeproj -scheme 'SDWebImageSwiftUITests' -destination 'name=iPhone 11 Pro Max' -configuration Debug | xcpretty -c
4545
- mv ~/Library/Developer/Xcode/DerivedData/ ./DerivedData/iOS
46-
# Catalina
47-
# - xcodebuild clean test -project SDWebImageSwiftUI.xcodeproj -scheme 'SDWebImageSwiftUITests macOS' -destination 'platform=macOS,arch=x86_64' -configuration Debug | xcpretty -c
48-
# - mv ~/Library/Developer/Xcode/DerivedData/ ./DerivedData/macOS
46+
- xcodebuild clean test -project SDWebImageSwiftUI.xcodeproj -scheme 'SDWebImageSwiftUITests macOS' -destination 'platform=macOS,arch=x86_64' -configuration Debug | xcpretty -c
47+
- mv ~/Library/Developer/Xcode/DerivedData/ ./DerivedData/macOS
4948
- xcodebuild clean test -project SDWebImageSwiftUI.xcodeproj -scheme 'SDWebImageSwiftUITests tvOS' -destination 'platform=tvOS Simulator,name=Apple TV' -configuration Debug | xcpretty -c
5049
- mv ~/Library/Developer/Xcode/DerivedData/ ./DerivedData/tvOS
5150

5251
after_success:
53-
# - bash <(curl -s https://codecov.io/bash) -D './DerivedData/macOS' -J '^SDWebImageSwiftUI$' -F macos
5452
- bash <(curl -s https://codecov.io/bash) -D './DerivedData/iOS' -J '^SDWebImageSwiftUI$' -F ios
53+
- bash <(curl -s https://codecov.io/bash) -D './DerivedData/macOS' -J '^SDWebImageSwiftUI$' -F macos
5554
- bash <(curl -s https://codecov.io/bash) -D './DerivedData/tvOS' -J '^SDWebImageSwiftUI$'-F tvos

Tests/WebImageTests.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,15 @@ class WebImageTests: XCTestCase {
158158
let imageUrl = URL(string: "https://raw.githubusercontent.com/recurser/exif-orientation-examples/master/Landscape_5.jpg")
159159
let imageView = WebImage(url: imageUrl)
160160
let introspectView = imageView.onSuccess { image, data, cacheType in
161+
#if os(macOS)
162+
let displayImage = try? imageView.inspect().group().image(0).nsImage()
163+
XCTAssertNotNil(displayImage)
164+
#else
161165
let displayImage = try? imageView.inspect().group().image(0).cgImage()
162166
let orientation = try! imageView.inspect().group().image(0).orientation()
163167
XCTAssertNotNil(displayImage)
164168
XCTAssertEqual(orientation, .leftMirrored)
169+
#endif
165170
expectation.fulfill()
166171
}.onFailure { error in
167172
XCTFail(error.localizedDescription)

0 commit comments

Comments
 (0)