PromiseKit/Tests/CorePromise/Utilities.swift
Max Howell c7dad79d1b
Fix travis (#912)
Actually run the tests for the ones we want them
2018-08-19 14:44:46 -04:00

34 lines
714 B
Swift

import PromiseKit
extension Promise {
func silenceWarning() {}
}
#if os(Linux)
import func CoreFoundation._CFIsMainThread
extension Thread {
// `isMainThread` is not implemented yet in swift-corelibs-foundation.
static var isMainThread: Bool {
return _CFIsMainThread()
}
}
import XCTest
extension XCTestCase {
func wait(for: [XCTestExpectation], timeout: TimeInterval, file: StaticString = #file, line: UInt = #line) {
#if !(swift(>=4.0) && !swift(>=4.1))
let line = Int(line)
#endif
waitForExpectations(timeout: timeout, file: file, line: line)
}
}
extension XCTestExpectation {
func fulfill() {
fulfill(#file, line: #line)
}
}
#endif