Skip to content

Commit

Permalink
restrict runtime QoS introspection tests to Darwin
Browse files Browse the repository at this point in the history
  • Loading branch information
jamieQ committed Mar 19, 2024
1 parent fbb7207 commit 20a9cce
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Tests/ReactiveSwiftTests/SchedulerSpec.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
// Copyright (c) 2014 GitHub. All rights reserved.
//

#if canImport(Darwin)
import Darwin.sys.qos
#endif
import Dispatch
import Foundation

Expand Down Expand Up @@ -265,6 +268,11 @@ class SchedulerSpec: QuickSpec {
it("should propagate QoS values by default") {
expect(scheduler.queue.qos).to(equal(.unspecified))

// qos_class_self() may not be available on non-Darwin
// platforms, and it's unclear if QoS propagation is
// implemented in an equivalent manner in such contexts,
// so we restrict runtime validation tests to Darwin.
#if canImport(Darwin)
let userInitiatedQueue = DispatchQueue(
label: "reactiveswift.tests.user-initiated",
qos: .userInitiated
Expand Down Expand Up @@ -293,6 +301,7 @@ class SchedulerSpec: QuickSpec {
expect(endQoS?.rawValue).to(beGreaterThanOrEqualTo(
initialQoS?.rawValue
))
#endif // canImport(Darwin)
}
}
}
Expand Down

0 comments on commit 20a9cce

Please sign in to comment.