Commit 847c5fe
authored
[tests] Enable more tests to run on all 3 runtimes, part 13 (#10635)
This primarily refactors and improves test utility methods and logging for better maintainability and clarity. The most important changes include refactoring how MSBuild warnings are asserted in tests, improving debug logging in marshal method generation, and making test timeouts more maintainable by using a constant.
**Test utilities and assertion improvements:**
* Refactored `AssertHasNoWarnings` and `AssertHasSomeWarnings` methods in `AssertionExtensions.cs` to reduce duplication and centralize the logic for asserting the number of MSBuild warnings. Now, both methods delegate to a shared implementation, improving maintainability.
* Added a missing `using System.Collections.Generic;` directive in `AssertionExtensions.cs` to support the refactored methods.
**Logging improvements:**
* Enhanced debug logging in `MarshalMethodsNativeAssemblyGenerator.cs` to include the native symbol name when generating marshal methods, providing more context for debugging.
**Test timeout maintainability:**
* Updated hardcoded activity start timeouts in `MonoAndroidExportTest.cs` to use the shared constant `InstallAndRunTests.ActivityStartTimeoutInSeconds`, improving consistency and ease of configuration.1 parent 0a5601a commit 847c5fe
File tree
4 files changed
+452
-119
lines changed- src/Xamarin.Android.Build.Tasks
- Tests/Xamarin.Android.Build.Tests/Utilities
- Utilities
- tests/MSBuildDeviceIntegration/Tests
4 files changed
+452
-119
lines changedsrc/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Utilities/AssertionExtensions.cs
Lines changed: 15 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
| |||
130 | 131 | | |
131 | 132 | | |
132 | 133 | | |
133 | | - | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
134 | 141 | | |
135 | 142 | | |
136 | 143 | | |
137 | 144 | | |
138 | 145 | | |
139 | | - | |
| 146 | + | |
140 | 147 | | |
141 | 148 | | |
142 | 149 | | |
143 | 150 | | |
144 | 151 | | |
145 | | - | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
146 | 158 | | |
147 | 159 | | |
148 | 160 | | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
643 | 643 | | |
644 | 644 | | |
645 | 645 | | |
646 | | - | |
| 646 | + | |
647 | 647 | | |
648 | 648 | | |
649 | 649 | | |
| |||
0 commit comments