Skip to content

Commit 15878c7

Browse files
[nativeaot] run Mono.Android-Tests
TODO
1 parent c096099 commit 15878c7

File tree

10 files changed

+25
-14
lines changed

10 files changed

+25
-14
lines changed

build-tools/automation/yaml-templates/stage-package-tests.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,16 @@ stages:
208208
artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.aab
209209
artifactFolder: $(DotNetTargetFramework)-CoreCLR
210210

211+
- template: /build-tools/automation/yaml-templates/apk-instrumentation.yaml
212+
parameters:
213+
configuration: $(XA.Build.Configuration)
214+
testName: Mono.Android.NET_Tests-NativeAOT
215+
project: tests/Mono.Android-Tests/Mono.Android-Tests/Mono.Android.NET-Tests.csproj
216+
testResultsFiles: TestResult-Mono.Android.NET_Tests-$(XA.Build.Configuration)NativeAOT.xml
217+
extraBuildArgs: -p:TestsFlavor=NativeAOT -p:PublishAot=true
218+
artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.aab
219+
artifactFolder: $(DotNetTargetFramework)-NativeAOT
220+
211221
- template: /build-tools/automation/yaml-templates/apk-instrumentation.yaml
212222
parameters:
213223
configuration: $(XA.Build.Configuration)

samples/NativeAOT/NativeAOT.csproj

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,4 @@
1212
<!-- Only property required to opt into NativeAOT -->
1313
<PublishAot>true</PublishAot>
1414
</PropertyGroup>
15-
16-
<!-- Settings for CI -->
17-
<PropertyGroup Condition=" '$(RunningOnCI)' == 'true' ">
18-
<_NuGetFolderOnCI>..\..\bin\Build$(Configuration)\nuget-unsigned</_NuGetFolderOnCI>
19-
<RestoreAdditionalProjectSources Condition="Exists('$(_NuGetFolderOnCI)')">$(_NuGetFolderOnCI)</RestoreAdditionalProjectSources>
20-
<_FastDeploymentDiagnosticLogging>true</_FastDeploymentDiagnosticLogging>
21-
</PropertyGroup>
22-
2315
</Project>

tests/Mono.Android-Tests/Java.Interop-Tests/Java.InteropTests/AndroidValueManagerContractTests.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
using System;
44
using System.Collections.Generic;
5+
using System.Diagnostics.CodeAnalysis;
56
using System.Linq;
67
using System.Reflection;
78
using System.Threading;
@@ -11,9 +12,10 @@
1112
using NUnit.Framework;
1213

1314
namespace Java.InteropTests {
14-
[TestFixture]
15+
[TestFixture, Category ("NativeTypeMap")]
1516
public class AndroidValueManagerContractTests : JniRuntimeJniValueManagerContract {
1617

18+
[DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)]
1719
protected override Type ValueManagerType => typeof (Android.Runtime.AndroidValueManager);
1820
}
1921
}

tests/Mono.Android-Tests/Mono.Android-Tests/Android.Runtime/JnienvArrayMarshaling.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public void CopyArray_JavaLangStringArrayArrayToSystemStringArrayArray ()
9191
}
9292
}
9393

94-
[Test]
94+
[Test, Category ("NativeAOTIgnore")] // TODO:
9595
public void CopyArray_JavaLangObjectArrayToJavaLangStringArray ()
9696
{
9797
using (var stringArray = new Java.Lang.Object (JNIEnv.NewArray (new[]{"a", "b"}), JniHandleOwnership.TransferLocalRef)) {

tests/Mono.Android-Tests/Mono.Android-Tests/Java.Interop/JnienvTest.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ public void SetField_PermitNullValues ()
238238
}
239239
}
240240

241-
[Test]
241+
[Test, Category ("Export")]
242242
[Category ("CoreCLRIgnore")] //TODO: https://github.com/dotnet/android/issues/10069
243243
public void CreateTypeWithExportedMethods ()
244244
{
@@ -251,7 +251,7 @@ public void CreateTypeWithExportedMethods ()
251251
}
252252
}
253253

254-
[Test]
254+
[Test, Category ("Export")]
255255
[Category ("CoreCLRIgnore")] //TODO: https://github.com/dotnet/android/issues/10069
256256
public void ActivatedDirectObjectSubclassesShouldBeRegistered ()
257257
{
@@ -407,7 +407,7 @@ public void MoarThreadingTests ()
407407
Assert.IsNull (ignore_t2, string.Format ("No exception should be thrown [t2]! Got: {0}", ignore_t2));
408408
}
409409

410-
[Test]
410+
[Test, Category ("NativeTypeMap")]
411411
public void JavaToManagedTypeMapping ()
412412
{
413413
Type m = Java.Interop.TypeManager.GetJavaToManagedType ("android/content/res/Resources");
@@ -416,7 +416,7 @@ public void JavaToManagedTypeMapping ()
416416
Assert.AreEqual (null, m);
417417
}
418418

419-
[Test]
419+
[Test, Category ("NativeTypeMap")]
420420
public void ManagedToJavaTypeMapping ()
421421
{
422422
Type type = typeof(Activity);

tests/Mono.Android-Tests/Mono.Android-Tests/Mono.Android.NET-Tests.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
<ExcludeCategories>DotNetIgnore</ExcludeCategories>
3434
<!-- TODO: https://github.com/dotnet/android/issues/10069 -->
3535
<ExcludeCategories Condition=" '$(UseMonoRuntime)' == 'false' ">$(ExcludeCategories):CoreCLRIgnore:SSL:NTLM:GCBridge:RuntimeConfig</ExcludeCategories>
36+
<!-- Features that do not work on NativeAOT -->
37+
<ExcludeCategories Condition=" '$(PublishAot)' == 'true' ">$(ExcludeCategories):NativeAOTIgnore:SSL:NTLM:GCBridge:Export:NativeTypeMap</ExcludeCategories>
3638
<!-- FIXME: LLVMIgnore https://github.com/dotnet/runtime/issues/89190 -->
3739
<ExcludeCategories Condition=" '$(EnableLLVM)' == 'true' ">$(ExcludeCategories):LLVMIgnore</ExcludeCategories>
3840
<ExcludeCategories Condition=" '$(EnableLLVM)' == 'true' ">$(ExcludeCategories):InetAccess:NetworkInterfaces</ExcludeCategories>

tests/Mono.Android-Tests/Mono.Android-Tests/System/AppContextTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ public void GetData (string name, string expected)
4949
};
5050

5151
[Test]
52+
[Category ("NativeAOTIgnore")] // These switches only exist in Mono & CoreCLR BCL assemblies
5253
[TestCaseSource (nameof (TestPrivateSwitchesSource))]
5354
public void TestPrivateSwitches (
5455
[DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.All)]

tests/Mono.Android-Tests/Mono.Android-Tests/System/ExceptionTest.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ static Java.Lang.Throwable CreateJavaProxyThrowable (Exception e)
3030

3131
[Test]
3232
[Category ("CoreCLRIgnore")] //TODO: https://github.com/dotnet/android/issues/10069
33+
[Category ("NativeAOTIgnore")] // NativeAOT has very limited stack traces
3334
[RequiresUnreferencedCode ("Tests trimming unsafe features")]
3435
public void InnerExceptionIsSet ()
3536
{

tests/Mono.Android-Tests/Mono.Android-Tests/Xamarin.Android.Net/AndroidClientHandlerTests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ bool IgnoreIfConnectionFailed (WebException wex, out bool connectionFailed)
147147
}
148148
}
149149

150+
[Category ("NativeAOTIgnore")] // TODO:
150151
public abstract class AndroidHandlerTestBase : HttpClientHandlerTestBase
151152
{
152153
static IEnumerable<Exception> Exceptions (Exception e)
@@ -316,6 +317,7 @@ public bool ShouldIgnoreSuccessStatusCode (HttpStatusCode code)
316317
}
317318

318319
[TestFixture]
320+
[Category ("NativeAOTIgnore")] // TODO:
319321
public class AndroidClientHandlerTests : AndroidHandlerTestBase
320322
{
321323
protected override HttpMessageHandler CreateHandler ()

tests/Mono.Android-Tests/Mono.Android-Tests/Xamarin.Android.Net/HttpClientIntegrationTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1062,6 +1062,7 @@ public static implicit operator HttpMessageHandler (AndroidHandlerSettingsAdapte
10621062
}
10631063

10641064
[TestFixture]
1065+
[Category ("NativeAOTIgnore")] // TODO:
10651066
public class AndroidClientHandlerIntegrationTests : HttpClientIntegrationTestBase
10661067
{
10671068
protected override AndroidHandlerSettingsAdapter CreateHandler ()

0 commit comments

Comments
 (0)