Skip to content

Commit ff3143f

Browse files
committed
Add spcial-case measure function for Android to work around large standard deviation on emulator (swiftlang/swift-corelibs-xctest#506)
1 parent e9a78ad commit ff3143f

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

Tests/CBORDecoderTests.swift

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,3 +202,20 @@ class CBORDecoderTests: XCTestCase {
202202
}
203203
}
204204
}
205+
206+
#if os(Android)
207+
208+
extension XCTestCase {
209+
/// XCTestCase.measure on Android is problematic because
210+
/// the emulator on a virtualized runner can be quite slow
211+
/// but there is no way to set the standard deviation threshold
212+
/// for failure, so we override it to simply run the block
213+
/// and not perform any measurement.
214+
///
215+
/// See: https://github.com/swiftlang/swift-corelibs-xctest/pull/506
216+
func measure(_ count: Int = 0, _ block: () -> ()) {
217+
block()
218+
}
219+
}
220+
#endif
221+

0 commit comments

Comments
 (0)