Skip to content

Commit

Permalink
Fix CI issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle-Ye committed Sep 23, 2024
1 parent d016cb6 commit 8afd8dd
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .github/workflows/compatibility_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,14 @@ jobs:
- name: Run compatibility tests on OpenSwiftUI + macOS
run: |
swift test \
--filter OpenSwiftUICompatibilityTests \
--build-path .build-compatibility-test-debug
env:
OPENSWIFTUI_COMPATIBILITY_TEST: 0
- name: Run compatibility tests on SwiftUI + macOS
run: |
swift test \
--filter OpenSwiftUICompatibilityTests \
--build-path .build-compatibility-test-debug
env:
OPENSWIFTUI_COMPATIBILITY_TEST: 1
Expand Down Expand Up @@ -69,6 +71,7 @@ jobs:
run: swift --version
- name: Run compatibility tests on OpenSwiftUI + iOS
run: |
# FIXME: xcodebuild will run all test targets.
xcodebuild test \
-scheme OpenSwiftUI \
-configuration Debug \
Expand Down
8 changes: 8 additions & 0 deletions Sources/OpenSwiftUICore/Log/Signpost.swift
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ package struct Signpost {
guard isEnabled else {
return closure()

Check warning on line 124 in Sources/OpenSwiftUICore/Log/Signpost.swift

View check run for this annotation

Codecov / codecov/patch

Sources/OpenSwiftUICore/Log/Signpost.swift#L122-L124

Added lines #L122 - L124 were not covered by tests
}
#if canImport(Darwin)
let id = OSSignpostID.makeExclusiveID(object)
switch style {
case let .kdebug(code):
Expand All @@ -138,6 +139,9 @@ package struct Signpost {
defer { os_signpost(.end, log: _signpostLog, name: name, signpostID: id) }
return closure()

Check warning on line 140 in Sources/OpenSwiftUICore/Log/Signpost.swift

View check run for this annotation

Codecov / codecov/patch

Sources/OpenSwiftUICore/Log/Signpost.swift#L139-L140

Added lines #L139 - L140 were not covered by tests
}
#else
return closure()
#endif
}

@_transparent
Expand All @@ -150,6 +154,7 @@ package struct Signpost {
guard isEnabled else {
return closure()

Check warning on line 155 in Sources/OpenSwiftUICore/Log/Signpost.swift

View check run for this annotation

Codecov / codecov/patch

Sources/OpenSwiftUICore/Log/Signpost.swift#L153-L155

Added lines #L153 - L155 were not covered by tests
}
#if canImport(Darwin)
let id = OSSignpostID.makeExclusiveID(object)
switch style {
case let .kdebug(code):
Expand All @@ -161,6 +166,9 @@ package struct Signpost {
defer { os_signpost(.end, log: _signpostLog, name: name, signpostID: id) }
return closure()

Check warning on line 167 in Sources/OpenSwiftUICore/Log/Signpost.swift

View check run for this annotation

Codecov / codecov/patch

Sources/OpenSwiftUICore/Log/Signpost.swift#L158-L167

Added lines #L158 - L167 were not covered by tests
}
#else
return closure()
#endif
}

@_transparent
Expand Down
4 changes: 3 additions & 1 deletion Sources/OpenSwiftUICore/Util/ThreadUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Audited for RELEASE_2024
// Status: Complete

@preconcurrency import Foundation
import Foundation

final package class ThreadSpecific<T> {
var key: pthread_key_t
Expand Down Expand Up @@ -68,7 +68,9 @@ package func onMainThread(do body: @escaping () -> Void) {
}

package func mainThreadPrecondition() {

Check warning on line 70 in Sources/OpenSwiftUICore/Util/ThreadUtils.swift

View check run for this annotation

Codecov / codecov/patch

Sources/OpenSwiftUICore/Util/ThreadUtils.swift#L70

Added line #L70 was not covered by tests
#if !os(WASI)
guard Thread.isMainThread else {
fatalError("calling into OpenSwiftUI on a non-main thread is not supported")

Check warning on line 73 in Sources/OpenSwiftUICore/Util/ThreadUtils.swift

View check run for this annotation

Codecov / codecov/patch

Sources/OpenSwiftUICore/Util/ThreadUtils.swift#L72-L73

Added lines #L72 - L73 were not covered by tests
}
#endif
}

0 comments on commit 8afd8dd

Please sign in to comment.