File tree 6 files changed +78
-9
lines changed
6 files changed +78
-9
lines changed Original file line number Diff line number Diff line change @@ -26,11 +26,17 @@ matrix:
26
26
- os : osx
27
27
env : TYPE=macos
28
28
osx_image : xcode9.4
29
+ - os : osx
30
+ env : TYPE=macos
31
+ osx_image : xcode10.1
29
32
- os : osx
30
33
env : TYPE=swiftpm
31
34
- os : osx
32
35
env : TYPE=swiftpm
33
36
osx_image : xcode9
37
+ - os : osx
38
+ env : TYPE=swiftpm
39
+ osx_image : xcode10.1
34
40
- os : linux
35
41
dist : trusty
36
42
sudo : required
@@ -42,9 +48,33 @@ matrix:
42
48
sudo : required
43
49
env :
44
50
- TYPE=swiftpm
45
- - SWIFT_VERSION=4.0.2
51
+ - SWIFT_VERSION=4.0.3
52
+ install :
53
+ - eval "$(curl -sL https://gist.githubusercontent.com/kylef/5c0475ff02b7c7671d2a/raw/9f442512a46d7a2af7b850d65a7e9bd31edfb09b/swiftenv-install.sh)"
54
+ - os : linux
55
+ dist : trusty
56
+ sudo : required
57
+ env :
58
+ - TYPE=swiftpm
59
+ - SWIFT_VERSION=4.1.3
60
+ install :
61
+ - eval "$(curl -sL https://gist.githubusercontent.com/kylef/5c0475ff02b7c7671d2a/raw/9f442512a46d7a2af7b850d65a7e9bd31edfb09b/swiftenv-install.sh)"
62
+ - os : linux
63
+ dist : trusty
64
+ sudo : required
65
+ env :
66
+ - TYPE=swiftpm
67
+ - SWIFT_VERSION=4.2.1
46
68
install :
47
69
- eval "$(curl -sL https://gist.githubusercontent.com/kylef/5c0475ff02b7c7671d2a/raw/9f442512a46d7a2af7b850d65a7e9bd31edfb09b/swiftenv-install.sh)"
70
+ # - os: linux
71
+ # dist: trusty
72
+ # sudo: required
73
+ # env:
74
+ # - TYPE=swiftpm
75
+ # - SWIFT_VERSION=5.0-DEVELOPMENT-SNAPSHOT-2019-01-13-a
76
+ # install:
77
+ # - eval "$(curl -sL https://gist.githubusercontent.com/kylef/5c0475ff02b7c7671d2a/raw/9f442512a46d7a2af7b850d65a7e9bd31edfb09b/swiftenv-install.sh)"
48
78
install :
49
79
- if [[ "$TYPE" == "podspec" ]]; then sudo gem install bundler; bundle install; fi
50
80
script :
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import Foundation
3
3
4
4
/// "Global" state of Nimble is stored here. Only DSL functions should access / be aware of this
5
5
/// class' existence
6
- internal class NimbleEnvironment {
6
+ internal class NimbleEnvironment : NSObject {
7
7
static var activeInstance : NimbleEnvironment {
8
8
get {
9
9
let env = Thread . current. threadDictionary [ " NimbleEnvironment " ]
@@ -29,7 +29,7 @@ internal class NimbleEnvironment {
29
29
var suppressTVOSAssertionWarning : Bool = false
30
30
var awaiter : Awaiter
31
31
32
- init ( ) {
32
+ override init ( ) {
33
33
let timeoutQueue : DispatchQueue
34
34
if #available( OSX 10 . 10 , * ) {
35
35
timeoutQueue = DispatchQueue . global ( qos: . userInitiated)
@@ -40,6 +40,9 @@ internal class NimbleEnvironment {
40
40
awaiter = Awaiter (
41
41
waitLock: AssertionWaitLock ( ) ,
42
42
asyncQueue: . main,
43
- timeoutQueue: timeoutQueue)
43
+ timeoutQueue: timeoutQueue
44
+ )
45
+
46
+ super. init ( )
44
47
}
45
48
}
Original file line number Diff line number Diff line change @@ -5,14 +5,38 @@ import Foundation
5
5
public func beIdenticalTo( _ expected: Any ? ) -> Predicate < Any > {
6
6
return Predicate . define { actualExpression in
7
7
#if os(Linux)
8
- let actual = try actualExpression. evaluate ( ) as? AnyObject
8
+ #if swift(>=4.0)
9
+ #if !swift(>=4.1.50)
10
+ let actual = try actualExpression. evaluate ( ) as? AnyObject
11
+ #else
12
+ let actual = try actualExpression. evaluate ( ) as AnyObject ?
13
+ #endif
14
+ #else
15
+ #if !swift(>=3.4)
16
+ let actual = try actualExpression. evaluate ( ) as? AnyObject
17
+ #else
18
+ let actual = try actualExpression. evaluate ( ) as AnyObject ?
19
+ #endif
20
+ #endif
9
21
#else
10
22
let actual = try actualExpression. evaluate ( ) as AnyObject ?
11
23
#endif
12
24
13
25
let bool : Bool
14
26
#if os(Linux)
15
- bool = actual === ( expected as? AnyObject ) && actual !== nil
27
+ #if swift(>=4.0)
28
+ #if !swift(>=4.1.50)
29
+ bool = actual === ( expected as? AnyObject ) && actual !== nil
30
+ #else
31
+ bool = actual === ( expected as AnyObject ? ) && actual !== nil
32
+ #endif
33
+ #else
34
+ #if !swift(>=3.4)
35
+ bool = actual === ( expected as? AnyObject ) && actual !== nil
36
+ #else
37
+ bool = actual === ( expected as AnyObject ? ) && actual !== nil
38
+ #endif
39
+ #endif
16
40
#else
17
41
bool = actual === ( expected as AnyObject ? ) && actual !== nil
18
42
#endif
Original file line number Diff line number Diff line change @@ -263,7 +263,7 @@ internal class AwaitPromiseBuilder<T> {
263
263
self . trigger. timeoutSource. resume ( )
264
264
while self . promise. asyncResult. isIncomplete ( ) {
265
265
// Stopping the run loop does not work unless we run only 1 mode
266
- #if swift(>=4.2)
266
+ #if swift(>=4.2) && (os(macOS) || os(iOS) || os(tvOS))
267
267
_ = RunLoop . current. run ( mode: . default, before: . distantFuture)
268
268
#else
269
269
_ = RunLoop . current. run ( mode: . defaultRunLoopMode, before: . distantFuture)
Original file line number Diff line number Diff line change @@ -3,7 +3,19 @@ import Foundation
3
3
internal func identityAsString( _ value: Any ? ) -> String {
4
4
let anyObject : AnyObject ?
5
5
#if os(Linux)
6
- anyObject = value as? AnyObject
6
+ #if swift(>=4.0)
7
+ #if !swift(>=4.1.50)
8
+ anyObject = value as? AnyObject
9
+ #else
10
+ anyObject = value as AnyObject ?
11
+ #endif
12
+ #else
13
+ #if !swift(>=3.4)
14
+ anyObject = value as? AnyObject
15
+ #else
16
+ anyObject = value as AnyObject ?
17
+ #endif
18
+ #endif
7
19
#else
8
20
anyObject = value as AnyObject ?
9
21
#endif
Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ function test_podspec {
80
80
81
81
function test_swiftpm {
82
82
if [ -d .build ]; then
83
- run swift build --clean
83
+ run swift build --clean || swift package clean
84
84
fi
85
85
run swift build && swift test
86
86
}
You can’t perform that action at this time.
0 commit comments