feat: enable TestRunner suite and metadata availability checks on visionOS#407
Conversation
…ionOS Three fixes that make the full TestRunner suite build, run, and pass on visionOS for the first time, and make API availability filtering real on that platform: - project.pbxproj: TestFixtures and TestRunnerTests now declare xros/xrsimulator in SUPPORTED_PLATFORMS, and TestRunner's dependency on TestFixtures drops its ios-only platformFilter. Previously Xcode silently skipped building libTestFixtures.a for visionOS and the TestRunner link failed. - TNSVersions.h: the two 'never available' fixtures gain an explicit visionos availability attribute. Clang's ios-to-visionos mapping turned the ios-only MAX_AVAILABILITY attribute into a hard 'unavailable on visionOS' error at their reference sites; declaring visionos explicitly keeps them warning-level (potentially unavailable), matching iOS semantics. Metadata output is unchanged. - Metadata.mm: Meta::isAvailable() no longer short-circuits to true on visionOS. getSystemVersion() now also runs there, mapping pre-unified visionOS majors onto the iOS scale used by metadata introducedIn values (visionOS 1.x ~ iOS 17.x, 2.x ~ 18.x; aligned from 26 on). Before this, every API was reported available on visionOS, so metadata for APIs that do not exist there leaked into JS. Validated on visionOS 26.2 simulator (Apple Vision Pro): full suite 849 tests, 0 failures — including VersionDiffTests, which previously failed because unavailable base classes were not skipped. iOS regression run: 849 tests, 0 failures.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThe runtime now computes and evaluates metadata availability on visionOS, including version remapping. Test fixtures declare visionOS availability, and Xcode configurations enable iOS and xros platforms for relevant targets. ChangesvisionOS metadata support
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant VisionOS
participant getSystemVersion
participant Meta
VisionOS->>getSystemVersion: provide operating-system version
getSystemVersion->>Meta: return encoded systemVersion
Meta->>Meta: evaluate introducedIn <= systemVersion
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
What
Three fixes that make the full TestRunner suite build, run, and pass on visionOS for the first time, and make API availability filtering actually work on that platform.
1. visionOS test infrastructure (
project.pbxproj)TestFixturesandTestRunnerTestsnow declarexros/xrsimulatorinSUPPORTED_PLATFORMS.TestRunner's target dependency onTestFixturesdrops itsios-onlyplatformFilter(nowios, xros, matching the NativeScript/TKLiveSync dependencies).Previously, building the TestRunner scheme for a visionOS destination silently skipped
libTestFixtures.aand the link failed — the suite could never run on visionOS.2. Fixture availability portability (
TNSVersions.h)The two "never available" fixtures (
TNSProtocolNeverAvailable,TNSInterfaceNeverAvailable) gain an explicitvisionosavailability attribute at the sameMAX_AVAILABILITYversion. Clang's iOS→visionOS availability mapping turned the ios-only attribute into a hard 'unavailable on visionOS' error at their reference sites; declaringvisionosexplicitly keeps them warning-level (potentially unavailable), matching the iOS semantics. Metadata output is unchanged.3. Real availability checking on visionOS (
Metadata.mm)Meta::isAvailable()no longer short-circuits totrueon visionOS.getSystemVersion()now runs there too, mapping pre-unified visionOS majors onto the iOS scale used by metadataintroducedInvalues (visionOS 1.x ≈ iOS 17.x, 2.x ≈ 18.x; aligned from 26 onward).Behavior change: previously every API was reported as available on visionOS, so metadata for APIs marked unavailable leaked into JS (and
VersionDiffTestsfails on visionOS because unavailable base classes are not skipped). Apps that accidentally relied on such leaked metadata will now see those APIs correctly hidden.Validation
VersionDiffTests9/9.Summary by CodeRabbit
Bug Fixes
Tests