Skip to content

Conversation

@grendello
Copy link
Contributor

@grendello grendello commented Nov 13, 2025

This pull request significantly expands the test coverage in BuildWithLibraryTests.cs to support the NativeAOT Android runtime, in addition to the existing MonoVM and CoreCLR runtimes. The changes ensure that all relevant tests run against all supported runtimes and adjust test logic to account for the unique behaviors and limitations of NativeAOT. There are also improvements to parameterization, handling of release configurations, and some refactoring for clarity and maintainability.

Key changes include:

Test Coverage Expansion and Parameterization:

  • Updated all relevant test methods to accept an AndroidRuntime runtime parameter (using [Values]), ensuring tests are executed for all supported runtimes, including NativeAOT. Test logic is adjusted to skip or ignore unsupported configurations as needed.

  • The test data source in Get_DotNetBuildLibraryParams now dynamically includes all AndroidRuntime values, not just a hardcoded subset.

NativeAOT-Specific Logic and Adjustments:

  • Added logic to skip or adjust tests that are not supported or behave differently with NativeAOT, including handling of environment variables, assembly packaging, and error/warning expectations.

  • Adjusted test assertions and file checks to account for the fact that NativeAOT links PAL libraries directly into the application .so rather than packaging them separately.

Release Configuration Consistency:

  • Ensured that tests use the correct IsRelease configuration based on the runtime, particularly for NativeAOT, which requires release builds.

Project Setup Improvements:

  • Ensured that all created project instances (XamarinAndroidLibraryProject, XamarinAndroidApplicationProject, etc.) have their runtime set explicitly via SetRuntime(runtime).

Refactoring and Modernization:

  • Refactored some test resource management to use using var statements for better readability and resource handling.

These changes make the test suite more robust and future-proof by ensuring comprehensive coverage across all supported Android runtimes and adjusting for their specific behaviors.

@grendello grendello changed the title Dev/grendel/test runtimes 3 Enable more tests to run on all 3 runtimes, part 3 Nov 13, 2025
@grendello grendello marked this pull request as ready for review November 14, 2025 15:48
@grendello grendello force-pushed the dev/grendel/test-runtimes-3 branch 2 times, most recently from d7d03e3 to d756271 Compare November 18, 2025 08:38
@grendello
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@grendello
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@grendello
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@grendello
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@grendello grendello force-pushed the dev/grendel/test-runtimes-3 branch from d756271 to 2d7a8ff Compare November 19, 2025 10:09
@jonathanpeppers jonathanpeppers merged commit 22e38e1 into main Nov 20, 2025
57 of 59 checks passed
@jonathanpeppers jonathanpeppers deleted the dev/grendel/test-runtimes-3 branch November 20, 2025 14:49
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.

3 participants