Skip to content

[tests] Add MaxSupportedOSPlatformVersion regression test project - #26567

Merged
rolfbjarne merged 3 commits into
mainfrom
dev/rolf/max-supported-os-platform-version
Sep 7, 2026
Merged

[tests] Add MaxSupportedOSPlatformVersion regression test project#26567
rolfbjarne merged 3 commits into
mainfrom
dev/rolf/max-supported-os-platform-version

Conversation

@rolfbjarne

Copy link
Copy Markdown
Member

This adds a new .NET test app project (tests/dotnet/MaxSupportedOSPlatformVersion) that deliberately does not import tests/common/shared-dotnet.csproj, so its SupportedOSPlatformVersion isn't pinned to each platform's minimum. Instead, it falls back to the .NET SDK's own default, which is the highest installed TargetPlatformVersion (i.e. the newest Xcode SDK version) - the same situation that caused the MetalShadersNotRecompiled test (in IncrementalBuildTest.cs) to be the only test failing when building with Xcode 27.

A corresponding unit test (MaxSupportedOSPlatformVersionTest.Build) was added with one test case per platform (iOS, tvOS, MacCatalyst, macOS).

Verified against Xcode 27 (without the registrar fix applied):

  • iOS and MacCatalyst fail, because the static registrar emits a native declaration for UIAccelerometerDelegate, which the 27.0 SDK headers mark unavailable/obsoleted at that exact deployment target, and a Debug dotnet build for these platforms doesn't trim it away (TrimMode=copy is set explicitly in this test project to make Mac Catalyst behave the same as the other platforms, since it otherwise defaults to trimming even for a plain 'dotnet build').
  • tvOS and macOS pass, because UIAccelerometer isn't available on those platforms ([NoTV], and UIKit types aren't used on the AppKit-based macOS).

No fix for the underlying registrar issue is included here; this is purely a regression test that documents a gap in the test matrix (deployment targets that float to the newest/highest SDK version, rather than being explicitly pinned).

rolfbjarne and others added 2 commits September 4, 2026 19:32
This adds a new test app (tests/dotnet/MaxSupportedOSPlatformVersion)
that deliberately does NOT import tests/common/shared-dotnet.csproj, so
its SupportedOSPlatformVersion isn't pinned to each platform's minimum.
Instead, it falls back to the .NET SDK's own default, which is the
highest installed TargetPlatformVersion (i.e. the newest Xcode SDK
version) - the same situation that made MetalShadersNotRecompiled the
only test in IncrementalBuildTest.cs to fail when building with
Xcode 27.

A corresponding unit test (MaxSupportedOSPlatformVersionTest.Build) was
added with one test case per platform (iOS, tvOS, MacCatalyst, macOS).

Verified against Xcode 27 (without the registrar fix applied): the iOS
build fails as expected, because the static registrar emits a native
declaration for UIAccelerometerDelegate, which the iOS 27.0 SDK headers
mark unavailable/obsoleted, and Debug dotnet builds for iOS don't trim
(TrimMode=copy), so the type is never removed before the registrar
processes it.

tvOS and macOS pass, because UIAccelerometer/UIAccelerometerDelegate
are not available on those platforms ([NoTV], and UIKit types aren't
used on the AppKit-based macOS).

MacCatalyst also passes, but for a different reason: its Debug dotnet
build defaults to PublishTrimmed=true/TrimMode=partial (unlike iOS's
TrimMode=copy), so ILLink trims away the unreferenced UIAccelerometer
types before the registrar ever sees them.

No fix for the underlying registrar issue is included here; this is
purely a regression test that documents the gap in the test matrix.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: c1b6973c-0330-4e26-a8b5-153fef490a30
Set TrimMode=copy so all platforms behave consistently. Without this,
Mac Catalyst's Debug 'dotnet build' defaulted to TrimMode=partial
(unlike iOS's TrimMode=copy), which trimmed away the unreferenced
UIAccelerometer types before the registrar processed them, masking the
same bug that affects iOS.

With trimming disabled, both iOS and MacCatalyst now fail with the
expected clang error (UIAccelerometerDelegate obsoleted in the
platform's 27.0 SDK), while tvOS and macOS still pass since
UIAccelerometer isn't available on those platforms.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: c1b6973c-0330-4e26-a8b5-153fef490a30
Copilot AI lite review requested due to automatic review settings September 4, 2026 17:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The changes are additive and align with existing test-project patterns, with only minor consistency/cleanup nits noted inline.

Pull request overview

Adds a new regression-test app and corresponding unit test to ensure the build/test matrix covers the scenario where SupportedOSPlatformVersion is not pinned (so it floats to the newest installed SDK’s TargetPlatformVersion), which can surface static-registrar failures with newly-obsoleted SDK types.

Changes:

  • Added MaxSupportedOSPlatformVersionTest.Build unit test with one build case per Apple platform.
  • Added a new tests/dotnet/MaxSupportedOSPlatformVersion multi-platform dotnet app that intentionally does not import tests/common/shared-dotnet.csproj, and explicitly disables trimming via TrimMode=copy.
  • Added Makefile plumbing to build the new test app in the existing dotnet test infrastructure.
File summaries
File Description
tests/dotnet/UnitTests/MaxSupportedOSPlatformVersionTest.cs New NUnit build test that exercises the “floating SupportedOSPlatformVersion” scenario across iOS/tvOS/Mac Catalyst/macOS.
tests/dotnet/MaxSupportedOSPlatformVersion/Makefile Hooks the new test project into the shared dotnet test make targets.
tests/dotnet/MaxSupportedOSPlatformVersion/AppDelegate.cs Minimal entry point that keeps the platform assembly referenced to preserve registrar-relevant types.
tests/dotnet/MaxSupportedOSPlatformVersion/shared.csproj Shared project settings; intentionally avoids shared-dotnet.csproj and sets TrimMode=copy.
tests/dotnet/MaxSupportedOSPlatformVersion/shared.mk Shared per-platform make include for building via shared-dotnet.mk.
tests/dotnet/MaxSupportedOSPlatformVersion/iOS/MaxSupportedOSPlatformVersion.csproj iOS TFM project that imports the shared settings.
tests/dotnet/MaxSupportedOSPlatformVersion/iOS/Makefile iOS make target that includes the shared make logic.
tests/dotnet/MaxSupportedOSPlatformVersion/tvOS/MaxSupportedOSPlatformVersion.csproj tvOS TFM project that imports the shared settings.
tests/dotnet/MaxSupportedOSPlatformVersion/tvOS/Makefile tvOS make target that includes the shared make logic.
tests/dotnet/MaxSupportedOSPlatformVersion/MacCatalyst/MaxSupportedOSPlatformVersion.csproj Mac Catalyst TFM project that imports the shared settings.
tests/dotnet/MaxSupportedOSPlatformVersion/MacCatalyst/Makefile Mac Catalyst make target that includes the shared make logic.
tests/dotnet/MaxSupportedOSPlatformVersion/macOS/MaxSupportedOSPlatformVersion.csproj macOS TFM project that imports the shared settings.
tests/dotnet/MaxSupportedOSPlatformVersion/macOS/Makefile macOS make target that includes the shared make logic.
Review details
  • Files reviewed: 13/13 changed files
  • Comments generated: 2
  • Review effort level: Lite

Comment thread tests/dotnet/UnitTests/MaxSupportedOSPlatformVersionTest.cs
Comment thread tests/dotnet/UnitTests/MaxSupportedOSPlatformVersionTest.cs
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@rolfbjarne
rolfbjarne enabled auto-merge (squash) September 7, 2026 15:29
@rolfbjarne rolfbjarne added the ready-to-review This PR is ready to review/merge. label Sep 7, 2026
@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ API diff for current PR / commit

NET (empty diffs)

✅ API diff vs stable

NET (empty diffs)

ℹ️ Generator diff

Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)

Pipeline on Agent
Hash: 6f696401c981ac8adefd64c3cc4125c43e6b72fe [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

🚀 [CI Build #6f69640] Test results 🚀

Test results

✅ All tests passed on VSTS: test results.

🎉 All 264 tests passed 🎉

Tests counts

✅ assembly-processing: All 1 tests passed. Html Report (VSDrops) Download
✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (iOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (MacCatalyst): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (macOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (Multiple platforms): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (tvOS): All 1 tests passed. Html Report (VSDrops) Download
✅ framework: All 2 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 4 tests passed. Html Report (VSDrops) Download
✅ generator: All 5 tests passed. Html Report (VSDrops) Download
✅ interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download
✅ introspection: All 7 tests passed. Html Report (VSDrops) Download
✅ linker (iOS): All 31 tests passed. Html Report (VSDrops) Download
✅ linker (MacCatalyst): All 31 tests passed. Html Report (VSDrops) Download
✅ linker (macOS): All 21 tests passed. Html Report (VSDrops) Download
✅ linker (tvOS): All 31 tests passed. Html Report (VSDrops) Download
✅ monotouch (iOS): All 25 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 25 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 20 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): All 25 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ sharpie: All 1 tests passed. Html Report (VSDrops) Download
✅ windows: All 3 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 4 tests passed. Html Report (VSDrops) Download
✅ xtro: All 1 tests passed. Html Report (VSDrops) Download

macOS tests

✅ Tests on macOS Sonoma (14): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Sequoia (15): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Tahoe (26): All 5 tests passed. Html Report (VSDrops) Download

Linux Build Verification

Linux build succeeded

Pipeline on Agent
Hash: 6f696401c981ac8adefd64c3cc4125c43e6b72fe [PR build]

@rolfbjarne
rolfbjarne merged commit 3e39085 into main Sep 7, 2026
54 checks passed
@rolfbjarne
rolfbjarne deleted the dev/rolf/max-supported-os-platform-version branch September 7, 2026 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

copilot ready-to-review This PR is ready to review/merge.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants