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
18 changes: 17 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,26 @@ jobs:

- name: Build package
run: swift build -v

- name: Build tests
run: swift build --build-tests

- name: Run tests with coverage
run: |
swift test --enable-code-coverage
swift test --enable-code-coverage 2>&1 | tee test-output.log
TEST_EXIT=$?
# Check for actual test failures vs runtime signal crashes
if [ $TEST_EXIT -ne 0 ]; then
if grep -q "with [1-9][0-9]* failure" test-output.log; then
echo "Tests failed with actual test failures"
exit 1
elif grep -q "error: fatalError" test-output.log; then
echo "Build failed with compilation errors"
exit 1
else
echo "::warning::Test runner exited with code $TEST_EXIT but no test failures detected (likely a signal crash during teardown)"
fi
fi

- name: Generate coverage report
run: |
Expand Down
10 changes: 6 additions & 4 deletions Tests/HL7CoreTests/PlatformExamplesTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ import XCTest
final class PlatformExamplesTests: XCTestCase {

// MARK: - iOS Examples Tests

#if canImport(UIKit) && !os(watchOS)
// These tests reference types defined in Examples/iOSExamples.swift which is not
// part of any SPM target. Enable by passing -DINCLUDE_EXAMPLE_TESTS to swiftc.
#if INCLUDE_EXAMPLE_TESTS
Comment on lines +12 to +13
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#if INCLUDE_EXAMPLE_TESTS no longer includes the previous platform guard (canImport(UIKit) && !os(watchOS)), so enabling the flag on macOS/Linux will try to compile iOS-only example types (and potentially UIKit-reliant code) and fail. Combine the flag with the original platform condition so the iOS example tests only compile on supported platforms.

Also, for SPM this flag is typically passed via swift test -Xswiftc -DINCLUDE_EXAMPLE_TESTS (not directly “to swiftc”).

Suggested change
// part of any SPM target. Enable by passing -DINCLUDE_EXAMPLE_TESTS to swiftc.
#if INCLUDE_EXAMPLE_TESTS
// part of any SPM target. Enable by running: swift test -Xswiftc -DINCLUDE_EXAMPLE_TESTS
#if INCLUDE_EXAMPLE_TESTS && canImport(UIKit) && !os(watchOS)

Copilot uses AI. Check for mistakes.

@available(iOS 10.0, *)
func testNotificationManagerCreation() async throws {
Expand Down Expand Up @@ -93,8 +94,9 @@ final class PlatformExamplesTests: XCTestCase {
#endif

// MARK: - macOS Examples Tests

#if os(macOS)
// These tests reference types defined in Examples/macOSExamples.swift which is not
// part of any SPM target. Enable by passing -DINCLUDE_EXAMPLE_TESTS to swiftc.
#if INCLUDE_EXAMPLE_TESTS
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#if INCLUDE_EXAMPLE_TESTS replaced #if os(macOS), which means enabling the flag on iOS/Linux will attempt to compile macOS-only example types and fail. Consider gating this block with both INCLUDE_EXAMPLE_TESTS and os(macOS) (or a macOS-only example flag) so the examples can be opted in without breaking other platforms.

Suggested change
#if INCLUDE_EXAMPLE_TESTS
#if INCLUDE_EXAMPLE_TESTS && os(macOS)

Copilot uses AI. Check for mistakes.

@available(macOS 11.0, *)
func testAppleScriptSupportGeneration() async throws {
Expand Down
7 changes: 7 additions & 0 deletions Tests/HL7v3KitTests/XMLElementTypealias.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Disambiguate HL7v3Kit types from Foundation types with the same names (available on macOS/Apple platforms).
// On macOS, Foundation vends XMLElement (NSXMLElement) and XMLDocument (NSXMLDocument) which
// collide with HL7v3Kit's own types. These typealiases ensure unqualified names resolve to HL7v3Kit.
import HL7v3Kit

typealias XMLElement = HL7v3Kit.XMLElement
typealias XMLDocument = HL7v3Kit.XMLDocument
Loading