Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,17 @@ jobs:
image: swift:latest
steps:
- uses: actions/checkout@v1
- name: Test
- name: Test Linux
run: swift test

android:
name: Android
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Test Android
uses: skiptools/swift-android-action@v2

macos:
name: macOS, iOS, tvOS, Mac Catalyst (Xcode)
runs-on: macos-latest
Expand Down
2 changes: 1 addition & 1 deletion Sources/CBOR.swift
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,6 @@ extension CBOR.Tag {
public static let selfDescribeCBOR = CBOR.Tag(rawValue: 55799)
}

#if os(Linux) || os(Windows)
#if os(Linux) || os(Windows) || os(Android)
let NSEC_PER_SEC: UInt64 = 1_000_000_000
#endif
17 changes: 17 additions & 0 deletions Tests/CBORDecoderTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -202,3 +202,20 @@ class CBORDecoderTests: XCTestCase {
}
}
}

#if os(Android)

extension XCTestCase {
/// XCTestCase.measure on Android is problematic because
/// the emulator on a virtualized runner can be quite slow
/// but there is no way to set the standard deviation threshold
/// for failure, so we override it to simply run the block
/// and not perform any measurement.
///
/// See: https://github.com/swiftlang/swift-corelibs-xctest/pull/506
func measure(_ count: Int = 0, _ block: () -> ()) {
block()
}
}
#endif