Skip to content

Commit 94ce854

Browse files
[coreclr] run Mono.Android-Tests
This is WIP.
1 parent 20cd062 commit 94ce854

File tree

6 files changed

+27
-7
lines changed

6 files changed

+27
-7
lines changed

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

+10
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,16 @@ stages:
198198
artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.aab
199199
artifactFolder: $(DotNetTargetFramework)-AotLlvm
200200

201+
- template: /build-tools/automation/yaml-templates/apk-instrumentation.yaml
202+
parameters:
203+
configuration: $(XA.Build.Configuration)
204+
testName: Mono.Android.NET_Tests-CoreCLR
205+
project: tests/Mono.Android-Tests/Mono.Android-Tests/Mono.Android.NET-Tests.csproj
206+
testResultsFiles: TestResult-Mono.Android.NET_Tests-$(XA.Build.Configuration)CoreCLR.xml
207+
extraBuildArgs: -p:TestsFlavor=CoreCLR -p:UseMonoRuntime=false -p:AndroidEnableMarshalMethods=false
208+
artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.aab
209+
artifactFolder: $(DotNetTargetFramework)-CoreCLR
210+
201211
- template: /build-tools/automation/yaml-templates/apk-instrumentation.yaml
202212
parameters:
203213
configuration: $(XA.Build.Configuration)
+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<!-- Needed for projects using CoreCLR/NativeAOT runtime packs that are not in the workload -->
2+
<Project>
3+
<PropertyGroup Condition=" '$(RunningOnCI)' == 'true' ">
4+
<_NuGetFolderOnCI>$(MSBuildThisFileDirectory)..\..\bin\Build$(Configuration)\nuget-unsigned</_NuGetFolderOnCI>
5+
<RestoreAdditionalProjectSources Condition="Exists('$(_NuGetFolderOnCI)')">$(_NuGetFolderOnCI)</RestoreAdditionalProjectSources>
6+
<_FastDeploymentDiagnosticLogging>true</_FastDeploymentDiagnosticLogging>
7+
</PropertyGroup>
8+
</Project>

build-tools/scripts/TestApks.targets

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
<PropertyGroup>
2020
<!-- APK tests might run on 32-bit emulators -->
21-
<RuntimeIdentifiers Condition=" '$(RuntimeIdentifier)' == '' ">android-arm64;android-x86;android-x64;</RuntimeIdentifiers>
21+
<RuntimeIdentifiers Condition=" '$(RuntimeIdentifier)' == '' and '$(PublishAot)' != 'true' and '$(UseMonoRuntime)' != 'false' ">android-arm64;android-x86;android-x64;</RuntimeIdentifiers>
2222
<TestAvdApiLevel Condition=" '$(TestAvdApiLevel)' == '' ">29</TestAvdApiLevel>
2323
<TestAvdAbi Condition=" '$(TestAvdAbi)' == '' and '$(HostOS)' == 'Darwin' and '$(HostOSArchitecture)' == 'Arm64' ">arm64-v8a</TestAvdAbi>
2424
<TestAvdAbi Condition=" '$(TestAvdAbi)' == '' ">x86_64</TestAvdAbi>

samples/NativeAOT/NativeAOT.csproj

+1-6
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@
1313
<PublishAot>true</PublishAot>
1414
</PropertyGroup>
1515

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>
16+
<Import Project="..\..\build-tools\scripts\TestApkFeeds.props" />
2217

2318
</Project>

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

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk" >
22

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

56
<PropertyGroup>
67
<TargetFramework>$(DotNetAndroidTargetFramework)</TargetFramework>
@@ -22,6 +23,8 @@
2223
<WarningsAsErrors>IL2037</WarningsAsErrors>
2324
<AndroidUseNegotiateAuthentication>true</AndroidUseNegotiateAuthentication>
2425
<AndroidNdkDirectory></AndroidNdkDirectory>
26+
<DefineConstants Condition=" '$(UseMonoRuntime)' == 'false' ">$(DefineConstants);CORECLR</DefineConstants>
27+
<DefineConstants Condition=" '$(PublishAot)' == 'true' ">$(DefineConstants);NATIVEAOT</DefineConstants>
2528
<!--
2629
TODO: Fix excluded tests
2730
For $(EnableLLVM)

tests/Mono.Android-Tests/Mono.Android-Tests/Xamarin.Android.RuntimeTests/NUnitInstrumentation.cs

+4
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,17 @@ protected NUnitInstrumentation(IntPtr handle, JniHandleOwnership transfer)
3030
protected override IList<TestAssemblyInfo> GetTestAssemblies()
3131
{
3232
Assembly asm = Assembly.GetExecutingAssembly();
33+
#if !NATIVEAOT && !CORECLR // TODO: Java.Interop-Tests not passing yet
3334
Assembly ji = typeof (Java.InteropTests.JavaInterop_Tests_Reference).Assembly;
35+
#endif
3436

3537

3638
return new List<TestAssemblyInfo>()
3739
{
3840
new TestAssemblyInfo (asm, asm.Location ?? String.Empty),
41+
#if !NATIVEAOT && !CORECLR
3942
new TestAssemblyInfo (ji, ji.Location ?? String.Empty),
43+
#endif
4044
};
4145
}
4246
}

0 commit comments

Comments
 (0)