Skip to content
Closed
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
14 changes: 0 additions & 14 deletions Xamarin.Android-Tests.sln
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.Android.Locale-Test
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CodeGen-Binding", "CodeGen-Binding", "{2EFFECF5-1CCA-4005-AE62-1D6F01C88DF4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.Android.McwGen-Tests", "tests\CodeGen-Binding\Xamarin.Android.McwGen-Tests\Xamarin.Android.McwGen-Tests.csproj", "{EF798EB3-D639-4E09-9DB0-233E67F727B0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.Android.LibraryProjectZip-LibBinding", "tests\CodeGen-Binding\Xamarin.Android.LibraryProjectZip-LibBinding\Xamarin.Android.LibraryProjectZip-LibBinding.csproj", "{9553ED9D-92EA-411B-ADFF-21C5608CCD16}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.Android.FixJavaAbstractMethod-APIv1Binding", "tests\CodeGen-Binding\Xamarin.Android.FixJavaAbstractMethod-APIv1Binding\Xamarin.Android.FixJavaAbstractMethod-APIv1Binding.csproj", "{91105023-9421-4E56-A87B-64BC62525D55}"
Expand All @@ -32,8 +30,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.Android.FixJavaAbst
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.Android.FixJavaAbstractMethod-Library", "tests\CodeGen-Binding\Xamarin.Android.FixJavaAbstractMethod-Library\Xamarin.Android.FixJavaAbstractMethod-Library.csproj", "{B7476528-C166-40BF-931F-EAEB02247879}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.Android.JcwGen-Tests", "tests\CodeGen-Binding\Xamarin.Android.JcwGen-Tests\Xamarin.Android.JcwGen-Tests.csproj", "{9479B71F-19FE-48F9-AB3F-AE764D76038A}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ResolveImports", "ResolveImports", "{E49089E4-4CE0-475E-BE9C-0AB4E4D56EE9}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.Android.BindingResolveImportLib1", "tests\ResolveImports\Xamarin.Android.BindingResolveImportLib1\Xamarin.Android.BindingResolveImportLib1.csproj", "{2A0519DF-0DDA-45F7-AC3C-E2992748D364}"
Expand Down Expand Up @@ -119,10 +115,6 @@ Global
{9D5C83B5-70D5-4CC2-9DB7-78B23DC8F255}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9D5C83B5-70D5-4CC2-9DB7-78B23DC8F255}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9D5C83B5-70D5-4CC2-9DB7-78B23DC8F255}.Release|Any CPU.Build.0 = Release|Any CPU
{EF798EB3-D639-4E09-9DB0-233E67F727B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EF798EB3-D639-4E09-9DB0-233E67F727B0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EF798EB3-D639-4E09-9DB0-233E67F727B0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EF798EB3-D639-4E09-9DB0-233E67F727B0}.Release|Any CPU.Build.0 = Release|Any CPU
{9553ED9D-92EA-411B-ADFF-21C5608CCD16}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9553ED9D-92EA-411B-ADFF-21C5608CCD16}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9553ED9D-92EA-411B-ADFF-21C5608CCD16}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand All @@ -139,10 +131,6 @@ Global
{B7476528-C166-40BF-931F-EAEB02247879}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B7476528-C166-40BF-931F-EAEB02247879}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B7476528-C166-40BF-931F-EAEB02247879}.Release|Any CPU.Build.0 = Release|Any CPU
{9479B71F-19FE-48F9-AB3F-AE764D76038A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9479B71F-19FE-48F9-AB3F-AE764D76038A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9479B71F-19FE-48F9-AB3F-AE764D76038A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9479B71F-19FE-48F9-AB3F-AE764D76038A}.Release|Any CPU.Build.0 = Release|Any CPU
{2A0519DF-0DDA-45F7-AC3C-E2992748D364}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2A0519DF-0DDA-45F7-AC3C-E2992748D364}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2A0519DF-0DDA-45F7-AC3C-E2992748D364}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -243,12 +231,10 @@ Global
{6BE66B30-9346-4DA6-B09A-0CDC1DFE33C2} = {43A4FB09-279A-4138-8027-EC1E1CED2E8A}
{05768F39-7BAF-43E6-971E-712F5771E88E} = {D6BFEDF6-2F48-44B2-9553-F2F6F92531BD}
{9D5C83B5-70D5-4CC2-9DB7-78B23DC8F255} = {D6BFEDF6-2F48-44B2-9553-F2F6F92531BD}
{EF798EB3-D639-4E09-9DB0-233E67F727B0} = {2EFFECF5-1CCA-4005-AE62-1D6F01C88DF4}
{9553ED9D-92EA-411B-ADFF-21C5608CCD16} = {2EFFECF5-1CCA-4005-AE62-1D6F01C88DF4}
{91105023-9421-4E56-A87B-64BC62525D55} = {2EFFECF5-1CCA-4005-AE62-1D6F01C88DF4}
{7B9D9F32-973F-49CF-A8F8-05BDFC75556C} = {2EFFECF5-1CCA-4005-AE62-1D6F01C88DF4}
{B7476528-C166-40BF-931F-EAEB02247879} = {2EFFECF5-1CCA-4005-AE62-1D6F01C88DF4}
{9479B71F-19FE-48F9-AB3F-AE764D76038A} = {2EFFECF5-1CCA-4005-AE62-1D6F01C88DF4}
{2A0519DF-0DDA-45F7-AC3C-E2992748D364} = {E49089E4-4CE0-475E-BE9C-0AB4E4D56EE9}
{DD4E2A49-730C-41FD-B6D4-AFB73F94271F} = {E49089E4-4CE0-475E-BE9C-0AB4E4D56EE9}
{9802CB35-0BC0-4EE1-9A81-BB40BD97945A} = {E49089E4-4CE0-475E-BE9C-0AB4E4D56EE9}
Expand Down
19 changes: 19 additions & 0 deletions build-tools/automation/azure-pipelines.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,25 @@ stages:
artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.aab
artifactFolder: $(DotNetTargetFramework)-AotLlvm

- template: yaml-templates/apk-instrumentation.yaml
parameters:
configuration: $(XA.Build.Configuration)
testName: Xamarin.Android.BindingRuntime_Tests
project: tests/BindingTests/Xamarin.Android.BindingRuntime-Tests/Xamarin.Android.BindingRuntime-Tests.csproj
testResultsFiles: TestResult-Xamarin.Android.BindingRuntime_Tests-$(XA.Build.Configuration).xml
artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Xamarin.Android.BindingRuntime_Tests-Signed.apk
artifactFolder: $(DotNetTargetFramework)-Default

- template: yaml-templates/apk-instrumentation.yaml
parameters:
configuration: $(XA.Build.Configuration)
testName: Xamarin.Android.BindingRuntime_Tests_FastDev
project: tests/BindingTests/Xamarin.Android.BindingRuntime-Tests/Xamarin.Android.BindingRuntime-Tests.csproj
testResultsFiles: TestResult-Xamarin.Android.BindingRuntime_Tests-$(XA.Build.Configuration).xml
artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Xamarin.Android.BindingRuntime_Tests-Signed.apk
artifactFolder: $(DotNetTargetFramework)-FastDev_Assemblies_Dexes
extraBuildArgs: /p:AndroidFastDeploymentType=Assemblies:Dexes

- template: yaml-templates/run-nunit-tests.yaml
parameters:
testRunTitle: Xamarin.Android.Tools.Aidl-Tests - macOS
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application android:allowBackup="true" android:icon="@mipmap/appicon" android:label="@string/app_name" android:roundIcon="@mipmap/appicon_round" android:supportsRtl="true">
</application>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using System.Reflection;
using Xamarin.Android.NUnitLite;

namespace Xamarin.Android.BindingRuntime_Tests;

[Activity (Label = "@string/app_name", MainLauncher = true)]
public class MainActivity : TestSuiteActivity
{
protected override void OnCreate (Bundle? savedInstanceState)
{
// tests can be inside the main assembly
AddTest (Assembly.GetExecutingAssembly ());

// or in any reference assemblies
// AddTest (typeof (Your.Library.TestClass).Assembly);

// Once you called base.OnCreate(), you cannot add more assemblies.
base.OnCreate (savedInstanceState);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="@string/app_text"
/>
</RelativeLayout>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@mipmap/appicon_background" />
<foreground android:drawable="@mipmap/appicon_foreground" />
</adaptive-icon>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@mipmap/appicon_background" />
<foreground android:drawable="@mipmap/appicon_foreground" />
</adaptive-icon>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_launcher_background">#2C3E50</color>
</resources>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<resources>
<string name="app_name">BindingRuntime</string>
<string name="app_text">Hello, Android!</string>
</resources>
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
using System;
using System.Reflection;

using Android.App;
using Android.Content;
using Android.Runtime;

using Xamarin.Android.NUnitLite;

namespace Xamarin.Android.JcwGenTests {
namespace Xamarin.Android.BindingRuntime_Tests
{

[Instrumentation (Name="xamarin.android.jcwgentests.TestInstrumentation")]
public class TestInstrumentation : TestSuiteInstrumentation {
[Instrumentation (Name = "xamarin.android.bindingruntime.TestInstrumentation")]
public class TestInstrumentation : TestSuiteInstrumentation
{

public TestInstrumentation (IntPtr handle, JniHandleOwnership transfer)
: base (handle, transfer)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

using Com.Xamarin.Android;

namespace Xamarin.Android.JcwGenTests {
namespace Xamarin.Android.BindingRuntime_Tests {

[TestFixture]
public class BindingTests {
Expand All @@ -20,6 +20,7 @@ public void TestTimingCreateTimingIsCorrectType ()
Assert.IsTrue (t is Com.Xamarin.Android.Timing);
}

#if TODO_7794
[Test]
public void TestResourceId ()
{
Expand All @@ -37,7 +38,8 @@ public void TestNativeLibDllImportInEmbeddedArchive ()
{
Assert.AreEqual (TestNativeLib.Binding.SampleFunction2 (), 0xf200);
}

#endif // TODO_7794

[Test]
public void NamespaceTransforms ()
{
Expand Down Expand Up @@ -80,9 +82,9 @@ public void Arrays ()
Assert.AreEqual ("payloadType", e.PayloadType);
for (int i = 0; i < e.Payload.Length; ++i) {
for (int j = 0; j < e.Payload [i].Length; ++j) {
byte expected = (byte) (((i+1)*10) + (j+1));
Assert.AreEqual ((byte)(expected + 'J'), e.Payload [i][j]);
e.Payload [i][j] = expected;
byte expected = (byte) (((i + 1) * 10) + (j + 1));
Assert.AreEqual ((byte) (expected + 'J'), e.Payload [i] [j]);
e.Payload [i] [j] = expected;
}
}
};
Expand Down Expand Up @@ -178,6 +180,10 @@ public void VirtualMethodBinding ()
}
}

#if TODO_7794
// This test requires that https://github.com/xamarin/xamarin-android/issues/7794
// be completed first, as it depends on Xamarin.Android.FixJavaAbstractMethod* projects.

[Test]
public void JavaAbstractMethodTest ()
{
Expand All @@ -202,7 +208,8 @@ public void JavaAbstractMethodTest ()
if (mi != null && mi.GetMethodBody ().LocalVariables.Count == 0)
throw new Exception ("FixAbstractMethodStep broken, MethodWithRT added, while it should not be");
}

#endif // TODO_7794

// Context https://bugzilla.xamarin.com/show_bug.cgi?id=36036
[Test]
public void NestedClassTest ()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using Java.Lang;
using NUnit.Framework;

namespace Xamarin.Android.JcwGenTests
namespace Xamarin.Android.BindingRuntime_Tests
{
[TestFixture]
public class DimTest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

using Com.Xamarin.Android;

namespace Xamarin.Android.JcwGenTests {
namespace Xamarin.Android.BindingRuntime_Tests {

[TestFixture]
public class ExceptionTests {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using Java.Lang;
using NUnit.Framework;

namespace Xamarin.Android.JcwGenTests
namespace Xamarin.Android.BindingRuntime_Tests
{
[TestFixture]
public class KotlinUnsignedTypesTests
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using System;

namespace Xamarin.Android.BindingRuntime_Tests
{
public class HélloÊncodingIssues : Java.Lang.Object
{
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<metadata>
<!-- Change Bxc4288.useColors() method to take and return Android.Graphics.Color -->
<attr
path="/api/package[@name='com.xamarin.android']/class[@name='Bxc4288']/method[@name='useColors']"
name="return"
>Android.Graphics.Color</attr>
<attr
path="/api/package[@name='com.xamarin.android']/class[@name='Bxc4288']/method[@name='useColors']/parameter[1]"
name="type"
>Android.Graphics.Color</attr>

<!-- Interface method parameters names are lost -->
<attr path="/api/package[@name='com.xamarin.android']/interface[@name='DataListener']/method[@name='onDataReceived']/parameter[1]" name="managedName">fromNode</attr>
<attr path="/api/package[@name='com.xamarin.android']/interface[@name='DataListener']/method[@name='onDataReceived']/parameter[2]" name="managedName">fromChannel</attr>
<attr path="/api/package[@name='com.xamarin.android']/interface[@name='DataListener']/method[@name='onDataReceived']/parameter[3]" name="managedName">payloadType</attr>
<attr path="/api/package[@name='com.xamarin.android']/interface[@name='DataListener']/method[@name='onDataReceived']/parameter[4]" name="managedName">payload</attr>
</metadata>
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>$(DotNetAndroidTargetFramework)</TargetFramework>
<SupportedOSPlatformVersion>24</SupportedOSPlatformVersion>
<OutputType>Exe</OutputType>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<ApplicationId>Xamarin.Android.BindingRuntime_Tests</ApplicationId>
<ApplicationVersion>1</ApplicationVersion>
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
<RootNamespace>Xamarin.Android.BindingRuntime_Tests</RootNamespace>
</PropertyGroup>

<Import Project="..\..\..\Configuration.props" />

<PropertyGroup>
<OutputPath>..\..\..\bin\Test$(Configuration)</OutputPath>
</PropertyGroup>

<ItemGroup>
<None Remove="Java\DefaultMethodsInterface.java" />
<None Remove="Java\StaticMethodsInterface.java" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Xamarin.Kotlin.StdLib" Version="1.8.0.1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\src\Xamarin.Android.NUnitLite\Xamarin.Android.NUnitLite.NET.csproj" />
</ItemGroup>

<ItemGroup>
<AndroidNamespaceReplacement Include="xamarin.example" Replacement="Example" />
<AndroidNamespaceReplacement Include="com.example" Replacement="Transformed.Namespace" />
</ItemGroup>

<PropertyGroup>
<_PackageName>$(ApplicationId)</_PackageName>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<EmbedAssembliesIntoApk>True</EmbedAssembliesIntoApk>
</PropertyGroup>

<ItemGroup>
<TestApk Include="$(OutputPath)$(ApplicationId)-Signed.apk">
<Package>$(ApplicationId)</Package>
<TimingDefinitionsFilename>$(MSBuildThisFileDirectory)..\..\..\build-tools\scripts\TimingDefinitions.txt</TimingDefinitionsFilename>
<TimingResultsFilename>$(MSBuildThisFileDirectory)..\..\..\TestResult-Xamarin.Android.BindingRuntime_Tests-times.csv</TimingResultsFilename>
</TestApk>
</ItemGroup>

<ItemGroup>
<TestApkInstrumentation Include="xamarin.android.bindingruntime.TestInstrumentation">
<Package>$(ApplicationId)</Package>
<ResultsPath>$(OutputPath)TestResult-Xamarin.Android.BindingRuntime_Tests.xml</ResultsPath>
</TestApkInstrumentation>

<TestApkPermission Include="READ_EXTERNAL_STORAGE">
<Package>$(ApplicationId)</Package>
</TestApkPermission>

<TestApkPermission Include="WRITE_EXTERNAL_STORAGE">
<Package>$(ApplicationId)</Package>
</TestApkPermission>
</ItemGroup>

<Import Project="..\..\..\build-tools\scripts\TestApks.targets" />

</Project>

This file was deleted.

This file was deleted.

Empty file.
Loading