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
2 changes: 2 additions & 0 deletions .github/workflows/compatibility_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
OPENRENDERBOX_USE_LOCAL_DEPS: 1
OPENRENDERBOX_TARGET_RELEASE: ${{ matrix.release }}
DARWIN_PRIVATE_FRAMEWORKS_TARGET_RELEASE: ${{ matrix.release }}
OPENSWIFTUI_LINK_TESTING: 1
GH_TOKEN: ${{ github.token }}
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -78,6 +79,7 @@ jobs:
OPENRENDERBOX_USE_LOCAL_DEPS: 1
OPENRENDERBOX_TARGET_RELEASE: ${{ matrix.release }}
DARWIN_PRIVATE_FRAMEWORKS_TARGET_RELEASE: ${{ matrix.release }}
OPENSWIFTUI_LINK_TESTING: 1
GH_TOKEN: ${{ github.token }}
steps:
- uses: actions/checkout@v4
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ jobs:
OPENRENDERBOX_USE_LOCAL_DEPS: 1
OPENRENDERBOX_TARGET_RELEASE: ${{ matrix.release }}
DARWIN_PRIVATE_FRAMEWORKS_TARGET_RELEASE: ${{ matrix.release }}
OPENSWIFTUI_LINK_TESTING: 1
GH_TOKEN: ${{ github.token }}
steps:
- uses: actions/checkout@v4
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
OPENRENDERBOX_USE_LOCAL_DEPS: 1
OPENRENDERBOX_TARGET_RELEASE: ${{ matrix.release }}
DARWIN_PRIVATE_FRAMEWORKS_TARGET_RELEASE: ${{ matrix.release }}
OPENSWIFTUI_LINK_TESTING: 1
GH_TOKEN: ${{ github.token }}
steps:
- uses: actions/checkout@v4
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
OPENSWIFTUI_COMPATIBILITY_TEST: 0
OPENSWIFTUI_SWIFT_LOG: 1
OPENSWIFTUI_SWIFT_CRYPTO: 1
OPENSWIFTUI_LINK_TESTING: 1
container: swift:${{ matrix.swift_version }}-jammy
steps:
- uses: actions/checkout@v4
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/uitests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ jobs:
OPENRENDERBOX_USE_LOCAL_DEPS: 1
OPENRENDERBOX_TARGET_RELEASE: ${{ matrix.release }}
DARWIN_PRIVATE_FRAMEWORKS_TARGET_RELEASE: ${{ matrix.release }}
OPENSWIFTUI_LINK_TESTING: 0
GH_TOKEN: ${{ github.token }}
steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 0 additions & 2 deletions Example/Example.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
27186AE32D538A76009E05F9 /* AttributeGraph.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 27E6C4D12D2842740010502F /* AttributeGraph.xcframework */; };
278EF52D2E2272F2009C32EB /* Equatable in Frameworks */ = {isa = PBXBuildFile; productRef = 278EF52C2E2272F2009C32EB /* Equatable */; };
278EF52F2E227304009C32EB /* Equatable in Frameworks */ = {isa = PBXBuildFile; productRef = 278EF52E2E227304009C32EB /* Equatable */; };
279080A52E8E601B0082B5B6 /* Testing.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 279080912E8E5E7B0082B5B6 /* Testing.framework */; };
279284972DFF136E00234D64 /* AttributeGraph.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 27E6C4D12D2842740010502F /* AttributeGraph.xcframework */; };
2792849F2DFF137400234D64 /* SnapshotTesting in Frameworks */ = {isa = PBXBuildFile; productRef = 2792849E2DFF137400234D64 /* SnapshotTesting */; };
279FED052DF4566D00320390 /* AttributeGraph.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 27E6C4D12D2842740010502F /* AttributeGraph.xcframework */; };
Expand Down Expand Up @@ -98,7 +97,6 @@
buildActionMask = 2147483647;
files = (
279FED0D2DF4567B00320390 /* OpenSwiftUI in Frameworks */,
279080A52E8E601B0082B5B6 /* Testing.framework in Frameworks */,
27AF22B82E758F2E00D534AB /* BacklightServices.xcframework in Frameworks */,
27AF22B42E758F2900D534AB /* CoreUI.xcframework in Frameworks */,
27AF22BC2E758F3700D534AB /* RenderBox.xcframework in Frameworks */,
Expand Down
2 changes: 1 addition & 1 deletion Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,15 @@ if swiftUIRenderCondition {
sharedSwiftSettings.append(.define("_OPENSWIFTUI_SWIFTUI_RENDER"))
}

// MARK: - [env] OPENSWIFTUI_LINK_TESTING

// This should be disabled for UI test target due to link issue of Testing.
// Only enable for non-UI test targets.
let linkTesting = envEnable("OPENSWIFTUI_LINK_TESTING")
if linkTesting {
sharedSwiftSettings.append(.define("OPENSWIFTUI_LINK_TESTING"))
}

// MARK: - [env] OPENSWIFTUI_WERROR

let warningsAsErrorsCondition = envEnable("OPENSWIFTUI_WERROR", default: isXcodeEnv && development)
Expand Down
4 changes: 2 additions & 2 deletions Sources/OpenSwiftUICore/Log/Logging.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Status: Complete

import Foundation
#if canImport(Testing)
#if OPENSWIFTUI_LINK_TESTING
public import Testing
#endif

Expand Down Expand Up @@ -161,7 +161,7 @@ package enum Log {
_ message: @autoclosure () -> StaticString,
_ args: @autoclosure () -> [CVarArg] = []
) {
#if canImport(Testing)
#if OPENSWIFTUI_LINK_TESTING
if Test.current != nil {
let comment: Comment = #"[Runtime Issue]: message - "\#(message().description)" args: \#(args())"#
#if swift(>=6.3)
Expand Down