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:UseMonoRuntime=false -p:_AndroidTypeMapImplementation=llvm-ir
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:UseMonoRuntime=false -p:_AndroidTypeMapImplementation=trimmable
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
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;

Expand All @@ -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,11 @@
<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>
</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,7 +25,23 @@ protected override string LogTag
protected NUnitInstrumentation(IntPtr handle, JniHandleOwnership transfer)
: base(handle, transfer)
{
}
if (AppContext.TryGetSwitch ("Microsoft.Android.Runtime.RuntimeFeature.TrimmableTypeMap", out bool trimmableTypeMap) && trimmableTypeMap) {
ExcludedCategories = ["Export", "SSL", "TrimmableIgnore"];

// Keep the temporary Java.Interop exclusions centralized here so
// we don't need a PR against the Java.Interop submodule.
ExcludedTestNames = new [] {
"Java.InteropTests.JavaObjectTest",
"Java.InteropTests.JavaObjectExtensionsTests",
"Java.InteropTests.InvokeVirtualFromConstructorTests",
"Java.InteropTests.JniPeerMembersTests",
"Java.InteropTests.JniTypeManagerTests",
"Java.InteropTests.JniValueMarshaler_object_ContractTests",
"Java.InteropTests.JavaExceptionTests.InnerExceptionIsNotAProxy",
"Java.InteropTests.JavaPeerableExtensionsTests",
};
}
}

protected override IList<TestAssemblyInfo> GetTestAssemblies()
{
Expand All @@ -39,4 +55,4 @@ protected override IList<TestAssemblyInfo> GetTestAssemblies()
};
}
}
}
}