File tree Expand file tree Collapse file tree 2 files changed +21
-9
lines changed Expand file tree Collapse file tree 2 files changed +21
-9
lines changed Original file line number Diff line number Diff line change @@ -2,13 +2,25 @@ language: objective-c
2
2
osx_image : xcode8
3
3
4
4
env :
5
- - ACTION=test PLATFORM=Mac DESTINATION='platform=OS X'
6
- - ACTION=test PLATFORM=iOS DESTINATION='platform=iOS Simulator,name=iPhone 6S' UUID='7FC06F6D-AF72-4B38-9A96-1F934EA2E27F'
7
- - ACTION=test PLATFORM=tvOS DESTINATION='platform=tvOS Simulator,name=Apple TV 1080p' UUID='0DF1B136-A3A7-4C51-AE6E-CFEFDF52DA24'
8
-
5
+ - PLATFORM=Mac
6
+ - PLATFORM=iOS NAME='iPhone SE'
7
+ - PLATFORM=tvOS NAME='Apple TV 1080p'
8
+
9
+ before_install :
10
+ - if [ -n "$NAME" ]; then
11
+ export UUID=$(instruments -s | ruby -e "ARGF.each_line{ |ln| ln =~ /$NAME .* \[(.*)\]/; if \$1; puts(\$1); exit; end }");
12
+ fi
13
+
9
14
install :
10
15
- carthage bootstrap --platform $PLATFORM
11
16
12
17
script :
13
- - if [ -n "$UUID" ]; then xcrun instruments -w "$UUID" || true; sleep 15; fi
14
- - set -o pipefail && xcodebuild -scheme PMKMapKit -destination "$DESTINATION" $ACTION | xcpretty
18
+ - set -o pipefail;
19
+ case $PLATFORM in
20
+ Mac)
21
+ xcodebuild -scheme PMKMapKit test | xcpretty;;
22
+ iOS|tvOS)
23
+ xcrun instruments -w "$UUID";
24
+ sleep 15;
25
+ xcodebuild -scheme PMKMapKit -destination "id=$UUID" test | xcpretty;;
26
+ esac
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ class Test_MKDirections_Swift: XCTestCase {
8
8
let ex = expectation ( description: " " )
9
9
10
10
class MockDirections : MKDirections {
11
- private override func calculate( completionHandler: MKDirectionsHandler ) {
11
+ private override func calculate( completionHandler: @escaping MKDirectionsHandler ) {
12
12
completionHandler ( MKDirectionsResponse ( ) , nil )
13
13
}
14
14
}
@@ -28,7 +28,7 @@ class Test_MKDirections_Swift: XCTestCase {
28
28
let ex = expectation ( description: " " )
29
29
30
30
class MockDirections : MKDirections {
31
- private override func calculateETA( completionHandler: MKETAHandler ) {
31
+ private override func calculateETA( completionHandler: @escaping MKETAHandler ) {
32
32
completionHandler ( MKETAResponse ( ) , nil )
33
33
}
34
34
}
@@ -48,7 +48,7 @@ class Test_MKSnapshotter_Swift: XCTestCase {
48
48
let ex = expectation ( description: " " )
49
49
50
50
class MockSnapshotter : MKMapSnapshotter {
51
- private override func start( completionHandler: MKMapSnapshotCompletionHandler ) {
51
+ private override func start( completionHandler: @escaping MKMapSnapshotCompletionHandler ) {
52
52
completionHandler ( MKMapSnapshot ( ) , nil )
53
53
}
54
54
}
You can’t perform that action at this time.
0 commit comments