From 20a9cce041c1dac2667d65def3c2a156ed9a6339 Mon Sep 17 00:00:00 2001 From: jamieQ Date: Tue, 19 Mar 2024 07:29:05 -0500 Subject: [PATCH] restrict runtime QoS introspection tests to Darwin --- Tests/ReactiveSwiftTests/SchedulerSpec.swift | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Tests/ReactiveSwiftTests/SchedulerSpec.swift b/Tests/ReactiveSwiftTests/SchedulerSpec.swift index 6171d49ef..8f1dbd925 100644 --- a/Tests/ReactiveSwiftTests/SchedulerSpec.swift +++ b/Tests/ReactiveSwiftTests/SchedulerSpec.swift @@ -6,6 +6,9 @@ // Copyright (c) 2014 GitHub. All rights reserved. // +#if canImport(Darwin) +import Darwin.sys.qos +#endif import Dispatch import Foundation @@ -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 @@ -293,6 +301,7 @@ class SchedulerSpec: QuickSpec { expect(endQoS?.rawValue).to(beGreaterThanOrEqualTo( initialQoS?.rawValue )) + #endif // canImport(Darwin) } } }