@@ -298,8 +298,32 @@ public static void Foo () {
298
298
sb . Dispose ( ) ;
299
299
}
300
300
301
+ static readonly object [ ] HybridAOTSource = new object [ ] {
302
+ new object [ ] {
303
+ /* abis */ "armeabi-v7a;arm64-v8a" ,
304
+ /* validateAbi */ null ,
305
+ /* expectedBuildResult */ false
306
+ } ,
307
+ new object [ ] {
308
+ /* abis */ "armeabi-v7a" ,
309
+ /* validateAbi */ null ,
310
+ /* expectedBuildResult */ false
311
+ } ,
312
+ new object [ ] {
313
+ /* abis */ "arm64-v8a" ,
314
+ /* validateAbi */ null ,
315
+ /* expectedBuildResult */ true
316
+ } ,
317
+ new object [ ] {
318
+ /* abis */ "armeabi-v7a;arm64-v8a" ,
319
+ /* validateAbi */ "false" ,
320
+ /* expectedBuildResult */ true
321
+ }
322
+ } ;
323
+
301
324
[ Test ]
302
- public void HybridAOT ( [ Values ( "armeabi-v7a;arm64-v8a" , "armeabi-v7a" , "arm64-v8a" ) ] string abis )
325
+ [ TestCaseSource ( nameof ( HybridAOTSource ) ) ]
326
+ public void HybridAOT ( string abis , string validateAbi , bool expectedBuildResult )
303
327
{
304
328
var proj = new XamarinAndroidApplicationProject ( ) {
305
329
IsRelease = true ,
@@ -309,10 +333,11 @@ public static void Foo () {
309
333
// So we can use Mono.Cecil to open assemblies directly
310
334
proj . SetProperty ( "AndroidEnableAssemblyCompression" , "False" ) ;
311
335
proj . SetAndroidSupportedAbis ( abis ) ;
336
+ proj . SetProperty ( "AndroidAotModeValidateAbi" , validateAbi ) ;
312
337
313
338
using ( var b = CreateApkBuilder ( ) ) {
314
339
315
- if ( abis . Contains ( "armeabi-v7a" ) ) {
340
+ if ( ! expectedBuildResult ) {
316
341
b . ThrowOnBuildFailure = false ;
317
342
Assert . IsFalse ( b . Build ( proj ) , "Build should have failed." ) ;
318
343
string error = b . LastBuildOutput
0 commit comments