Skip to content

[coreclr] run Mono.Android-Tests #9916

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
10 changes: 10 additions & 0 deletions build-tools/automation/yaml-templates/stage-package-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,16 @@ stages:
artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.aab
artifactFolder: $(DotNetTargetFramework)-AotLlvm

- template: /build-tools/automation/yaml-templates/apk-instrumentation.yaml
parameters:
configuration: $(XA.Build.Configuration)
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 -p:AndroidEnableMarshalMethods=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)
Expand Down
8 changes: 8 additions & 0 deletions build-tools/scripts/TestApkFeeds.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<!-- Needed for projects using CoreCLR/NativeAOT runtime packs that are not in the workload -->
<Project>
<PropertyGroup Condition=" '$(RunningOnCI)' == 'true' ">
<_NuGetFolderOnCI>$(MSBuildThisFileDirectory)..\..\bin\Build$(Configuration)\nuget-unsigned</_NuGetFolderOnCI>
<RestoreAdditionalProjectSources Condition="Exists('$(_NuGetFolderOnCI)')">$(_NuGetFolderOnCI)</RestoreAdditionalProjectSources>
<_FastDeploymentDiagnosticLogging>true</_FastDeploymentDiagnosticLogging>
</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion build-tools/scripts/TestApks.targets
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

<PropertyGroup>
<!-- APK tests might run on 32-bit emulators -->
<RuntimeIdentifiers Condition=" '$(RuntimeIdentifier)' == '' ">android-arm64;android-x86;android-x64;</RuntimeIdentifiers>
<RuntimeIdentifiers Condition=" '$(RuntimeIdentifier)' == '' and '$(PublishAot)' != 'true' and '$(UseMonoRuntime)' != 'false' ">android-arm64;android-x86;android-x64;</RuntimeIdentifiers>
<TestAvdApiLevel Condition=" '$(TestAvdApiLevel)' == '' ">29</TestAvdApiLevel>
<TestAvdAbi Condition=" '$(TestAvdAbi)' == '' and '$(HostOS)' == 'Darwin' and '$(HostOSArchitecture)' == 'Arm64' ">arm64-v8a</TestAvdAbi>
<TestAvdAbi Condition=" '$(TestAvdAbi)' == '' ">x86_64</TestAvdAbi>
Expand Down
7 changes: 1 addition & 6 deletions samples/NativeAOT/NativeAOT.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@
<PublishAot>true</PublishAot>
</PropertyGroup>

<!-- Settings for CI -->
<PropertyGroup Condition=" '$(RunningOnCI)' == 'true' ">
<_NuGetFolderOnCI>..\..\bin\Build$(Configuration)\nuget-unsigned</_NuGetFolderOnCI>
<RestoreAdditionalProjectSources Condition="Exists('$(_NuGetFolderOnCI)')">$(_NuGetFolderOnCI)</RestoreAdditionalProjectSources>
<_FastDeploymentDiagnosticLogging>true</_FastDeploymentDiagnosticLogging>
</PropertyGroup>
<Import Project="..\..\build-tools\scripts\TestApkFeeds.props" />

</Project>
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk" >

<Import Project="..\..\..\Configuration.props" />
<Import Project="..\..\..\build-tools\scripts\TestApkFeeds.props" />

<PropertyGroup>
<TargetFramework>$(DotNetAndroidTargetFramework)</TargetFramework>
Expand All @@ -22,6 +23,8 @@
<WarningsAsErrors>IL2037</WarningsAsErrors>
<AndroidUseNegotiateAuthentication>true</AndroidUseNegotiateAuthentication>
<AndroidNdkDirectory></AndroidNdkDirectory>
<DefineConstants Condition=" '$(UseMonoRuntime)' == 'false' ">$(DefineConstants);CORECLR</DefineConstants>
<DefineConstants Condition=" '$(PublishAot)' == 'true' ">$(DefineConstants);NATIVEAOT</DefineConstants>
<!--
TODO: Fix excluded tests
For $(EnableLLVM)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,17 @@ protected NUnitInstrumentation(IntPtr handle, JniHandleOwnership transfer)
protected override IList<TestAssemblyInfo> GetTestAssemblies()
{
Assembly asm = Assembly.GetExecutingAssembly();
#if !NATIVEAOT && !CORECLR // TODO: Java.Interop-Tests not passing yet
Assembly ji = typeof (Java.InteropTests.JavaInterop_Tests_Reference).Assembly;
#endif


return new List<TestAssemblyInfo>()
{
new TestAssemblyInfo (asm, asm.Location ?? String.Empty),
#if !NATIVEAOT && !CORECLR
new TestAssemblyInfo (ji, ji.Location ?? String.Empty),
#endif
};
}
}
Expand Down
Loading