Skip to content

Commit 72d0d0f

Browse files
committed
MonoVM vs CoreCLR ApplicationConfig
1 parent b4e5966 commit 72d0d0f

File tree

1 file changed

+13
-3
lines changed
  • src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests

1 file changed

+13
-3
lines changed

src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest2.cs

+13-3
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,20 @@ public void MarshalMethodsDefaultEnabledStatus (bool isRelease, bool marshalMeth
6868
String.Join (";", supportedArches.Select (arch => MonoAndroidHelper.ArchToAbi (arch))),
6969
true
7070
);
71-
EnvironmentHelper.ApplicationConfig app_config = EnvironmentHelper.ReadApplicationConfig (envFiles);
7271

73-
Assert.That (app_config, Is.Not.Null, "application_config must be present in the environment files");
74-
Assert.AreEqual (app_config.marshal_methods_enabled, shouldMarshalMethodsBeEnabled, $"Marshal methods enabled status should be '{shouldMarshalMethodsBeEnabled}', but it was '{app_config.marshal_methods_enabled}'");
72+
bool marshal_methods_enabled;
73+
if (TargetRuntimeHelper.UseMonoRuntime) {
74+
EnvironmentHelper.ApplicationConfig app_config = EnvironmentHelper.ReadApplicationConfig (envFiles);
75+
76+
Assert.That (app_config, Is.Not.Null, "application_config must be present in the environment files");
77+
marshal_methods_enabled = app_config.marshal_methods_enabled;
78+
} else {
79+
EnvironmentHelper.ApplicationConfigCLR app_config = EnvironmentHelper.ReadApplicationConfigCLR (envFiles);
80+
81+
Assert.That (app_config, Is.Not.Null, "application_config must be present in the environment files");
82+
marshal_methods_enabled = app_config.marshal_methods_enabled;
83+
}
84+
Assert.AreEqual (marshal_methods_enabled, shouldMarshalMethodsBeEnabled, $"Marshal methods enabled status should be '{shouldMarshalMethodsBeEnabled}', but it was '{marshal_methods_enabled}'");
7585
}
7686
}
7787

0 commit comments

Comments
 (0)