Skip to content

Fix simulator tests on Xcode 26#101

Merged
mattt merged 6 commits intomattt:mainfrom
shareup:fix-simulator-tests-on-xcode-26
Feb 4, 2026
Merged

Fix simulator tests on Xcode 26#101
mattt merged 6 commits intomattt:mainfrom
shareup:fix-simulator-tests-on-xcode-26

Conversation

@atdrendel
Copy link
Contributor

This pull request builds on my changes in mattt/AnyLanguageModel#100.

  • Fix issues building on macOS 15 (Xcode 26.2) targeting the iOS 26.2 Simulator
  • Fix issues building for watchOS

Before making these changes, running the tests on my iOS 26.2 Simulator running on macOS 15 (Xcode 26.2) resulted in a bunch of failed tests.

AnyLanguageModel - macOS Sequoia - iOS 26 2 Simulator - Xcode 26 2 - Before Changes

After fixing the availability guards, tests were skipped correctly and the entire test suite passed.

AnyLanguageModel - macOS Sequoia - iOS 26 2 Simulator - Xcode 26 2 - After Changes

Copilot AI review requested due to automatic review settings February 3, 2026 22:11
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Core Image is not available on watchOS.

Image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These products are all explicitly imported in GenerableMacro.swift.

Image

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes simulator test failures on iOS 26.2 Simulator when building with Xcode 26.2 on macOS 15 by adding comprehensive platform availability guards. Building on the related PR #100 which fixed macOS 15 tests, this change ensures tests are properly skipped on platforms where SystemLanguageModel features are not available.

Changes:

  • Extended availability guards in test files to include iOS, watchOS, tvOS, and visionOS 26.0 alongside existing macOS 26.0 requirements
  • Added CoreImage availability checks to MLXLanguageModel import guards for improved watchOS compatibility
  • Added missing SwiftSyntax and SwiftSyntaxBuilder dependencies to Package.swift that were already being imported in macro code

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
Tests/AnyLanguageModelTests/SystemLanguageModelTests.swift Extended @available annotations and availability checks to include iOS, watchOS, tvOS, and visionOS 26.0 for all SystemLanguageModel test methods
Tests/AnyLanguageModelTests/APICompatibilityFoundationModelsTests.swift Added comprehensive platform availability guards (iOS, watchOS, tvOS, visionOS 26.0) to FoundationModels compatibility test
Tests/AnyLanguageModelTests/APICompatibilityAnyLanguageModelTests.swift Added comprehensive platform availability guards (iOS, watchOS, tvOS, visionOS 26.0) to AnyLanguageModel compatibility test
Sources/AnyLanguageModel/Models/MLXLanguageModel.swift Added CoreImage availability checks to UIKit and AppKit import guards to ensure CoreImage is available before importing (improves watchOS build compatibility)
Package.swift Added missing SwiftSyntax and SwiftSyntaxBuilder dependencies that were already being imported in AnyLanguageModelMacros source code

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mattt
Copy link
Owner

mattt commented Feb 4, 2026

@atdrendel Thank you for your great work on this and #100 — I really appreciate your help!

@mattt mattt merged commit ce883d1 into mattt:main Feb 4, 2026
8 of 9 checks passed
@atdrendel atdrendel deleted the fix-simulator-tests-on-xcode-26 branch February 4, 2026 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants