Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion build-tools/automation/yaml-templates/stage-package-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,20 @@ stages:
testName: Mono.Android.NET_Tests-CoreCLR
project: tests/Mono.Android-Tests/Mono.Android-Tests/Mono.Android.NET-Tests.csproj
testResultsFiles: TestResult-Mono.Android.NET_Tests-$(XA.Build.Configuration)CoreCLR.xml
extraBuildArgs: -p:TestsFlavor=CoreCLR -p:UseMonoRuntime=false
extraBuildArgs: -p:TestsFlavor=CoreCLR -p:_AndroidTypeMapImplementation=llvm-ir -p:UseMonoRuntime=false
artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.aab
artifactFolder: $(DotNetTargetFramework)-CoreCLR

- template: /build-tools/automation/yaml-templates/apk-instrumentation.yaml
parameters:
configuration: $(XA.Build.Configuration)
testName: Mono.Android.NET_Tests-CoreCLRTrimmable
project: tests/Mono.Android-Tests/Mono.Android-Tests/Mono.Android.NET-Tests.csproj
testResultsFiles: TestResult-Mono.Android.NET_Tests-$(XA.Build.Configuration)CoreCLRTrimmable.xml
extraBuildArgs: -p:TestsFlavor=CoreCLRTrimmable -p:_AndroidTypeMapImplementation=trimmable -p:UseMonoRuntime=false
artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.aab
artifactFolder: $(DotNetTargetFramework)-CoreCLRTrimmable

- template: /build-tools/automation/yaml-templates/apk-instrumentation.yaml
parameters:
configuration: $(XA.Build.Configuration)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace Java.InteropTests {
[TestFixture]
public class JavaObjectExtensionsTests {

[Test]
[Test, Category ("TrimmableIgnore")]
public void JavaCast_BaseToGenericWrapper ()
{
using (var list = new JavaList (new[]{ 1, 2, 3 }))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public void InvokingNullInstanceDoesNotCrashDalvik ()
}
}

[Test]
[Test, Category ("TrimmableIgnore")]
public void NewOpenGenericTypeThrows ()
{
try {
Expand Down Expand Up @@ -301,7 +301,7 @@ public void ActivatedDirectObjectSubclassesShouldBeRegistered ()
}
}

[Test]
[Test, Category ("TrimmableIgnore")]
public void ActivatedDirectThrowableSubclassesShouldBeRegistered ()
{
if (Build.VERSION.SdkInt <= BuildVersionCodes.GingerbreadMr1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@
<ExcludeCategories Condition=" '$(EnableLLVM)' == 'true' ">$(ExcludeCategories):InetAccess:NetworkInterfaces</ExcludeCategories>
</PropertyGroup>

<PropertyGroup>
<UseMonoRuntime Condition=" '$(_AndroidTypeMapImplementation)' == 'trimmable' and '$(UseMonoRuntime)' == '' and '$(PublishAot)' != 'true' ">false</UseMonoRuntime>
<TestsFlavor Condition=" '$(TestsFlavor)' == '' and '$(_AndroidTypeMapImplementation)' == 'trimmable' ">CoreCLRTrimmable</TestsFlavor>
<ExcludeCategories Condition=" '$(_AndroidTypeMapImplementation)' == 'trimmable' ">$(ExcludeCategories):NativeTypeMap:TrimmableIgnore:SSL</ExcludeCategories>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Mono.Linq.Expressions" Version="2.0.0" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,20 @@ protected override string LogTag
protected NUnitInstrumentation(IntPtr handle, JniHandleOwnership transfer)
: base(handle, transfer)
{
if (Microsoft.Android.Runtime.RuntimeFeature.TrimmableTypeMap) {
// Java.Interop-Tests fixtures that use JavaObject types (not Java.Lang.Object)
// don't have JCW Java classes in the trimmable APK, and method remapping
// tests require Java-side support not present in the trimmable path.
// Exclude these entire fixtures to prevent ClassNotFoundException crashes.
ExcludedTestNames = new [] {
"Java.InteropTests.JavaObjectTest",
"Java.InteropTests.InvokeVirtualFromConstructorTests",
"Java.InteropTests.JniPeerMembersTests",
"Java.InteropTests.JniTypeManagerTests",
"Java.InteropTests.JniValueMarshaler_object_ContractTests",
"Java.InteropTests.JavaExceptionTests.InnerExceptionIsNotAProxy",
};
}
}

protected override IList<TestAssemblyInfo> GetTestAssemblies()
Expand Down