Skip to content
Merged
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
20 changes: 10 additions & 10 deletions build-tools/automation/templates/core-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,56 +7,56 @@ steps:
displayName: 'Tests: generator'
inputs:
command: test
arguments: bin/Test$(Build.Configuration)/generator-Tests.dll
arguments: bin/Test$(Build.Configuration)$(NetCoreTargetFrameworkPathSuffix)/generator-Tests.dll
continueOnError: true

- task: DotNetCoreCLI@2
displayName: 'Tests: JavaCallableWrappers'
inputs:
command: test
arguments: bin/Test$(Build.Configuration)/Java.Interop.Tools.JavaCallableWrappers-Tests.dll
arguments: bin/Test$(Build.Configuration)$(NetCoreTargetFrameworkPathSuffix)/Java.Interop.Tools.JavaCallableWrappers-Tests.dll
continueOnError: true

- task: DotNetCoreCLI@2
displayName: 'Tests: logcat-parse'
inputs:
command: test
arguments: bin/Test$(Build.Configuration)/logcat-parse-Tests.dll
arguments: bin/Test$(Build.Configuration)$(NetCoreTargetFrameworkPathSuffix)/logcat-parse-Tests.dll
continueOnError: true

- task: DotNetCoreCLI@2
displayName: 'Tests: ApiXmlAdjuster'
inputs:
command: test
arguments: bin/Test$(Build.Configuration)/Xamarin.Android.Tools.ApiXmlAdjuster-Tests.dll
arguments: bin/Test$(Build.Configuration)$(NetCoreTargetFrameworkPathSuffix)/Xamarin.Android.Tools.ApiXmlAdjuster-Tests.dll
continueOnError: true

- task: DotNetCoreCLI@2
displayName: 'Tests: Bytecode'
inputs:
command: test
arguments: bin/Test$(Build.Configuration)/Xamarin.Android.Tools.Bytecode-Tests.dll
arguments: bin/Test$(Build.Configuration)$(NetCoreTargetFrameworkPathSuffix)/Xamarin.Android.Tools.Bytecode-Tests.dll
continueOnError: true

- task: DotNetCoreCLI@2
displayName: 'Tests: Java.Interop.Tools.Generator'
inputs:
command: test
arguments: bin/Test$(Build.Configuration)/Java.Interop.Tools.Generator-Tests.dll
arguments: bin/Test$(Build.Configuration)$(NetCoreTargetFrameworkPathSuffix)/Java.Interop.Tools.Generator-Tests.dll
continueOnError: true

- task: DotNetCoreCLI@2
displayName: 'Tests: Java.Interop.Tools.JavaSource'
inputs:
command: test
arguments: bin/Test$(Build.Configuration)/Java.Interop.Tools.JavaSource-Tests.dll
arguments: bin/Test$(Build.Configuration)$(NetCoreTargetFrameworkPathSuffix)/Java.Interop.Tools.JavaSource-Tests.dll
continueOnError: true

- task: DotNetCoreCLI@2
displayName: 'Tests: Xamarin.SourceWriter'
inputs:
command: test
arguments: bin/Test$(Build.Configuration)/Xamarin.SourceWriter-Tests.dll
arguments: bin/Test$(Build.Configuration)$(NetCoreTargetFrameworkPathSuffix)/Xamarin.SourceWriter-Tests.dll
continueOnError: true

- task: DotNetCoreCLI@2
Expand All @@ -80,15 +80,15 @@ steps:
condition: eq('${{ parameters.runNativeTests }}', 'true')
inputs:
command: test
arguments: bin/Test$(Build.Configuration)/Java.Interop.Dynamic-Tests.dll
arguments: bin/Test$(Build.Configuration)$(NetCoreTargetFrameworkPathSuffix)/Java.Interop.Dynamic-Tests.dll
continueOnError: true

- task: DotNetCoreCLI@2
displayName: 'Tests: Java.Interop.Export'
condition: eq('${{ parameters.runNativeTests }}', 'true')
inputs:
command: test
arguments: bin/Test$(Build.Configuration)/Java.Interop.Export-Tests.dll
arguments: bin/Test$(Build.Configuration)$(NetCoreTargetFrameworkPathSuffix)/Java.Interop.Export-Tests.dll
continueOnError: true

- task: DotNetCoreCLI@2
Expand Down
4 changes: 2 additions & 2 deletions src/Xamarin.Android.Tools.Bytecode/ConstantPool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ public float Value {

public override string ToString ()
{
return string.Format (CultureInfo.InvariantCulture, "Float({0})", Value);
return string.Format (CultureInfo.InvariantCulture, "Float({0:G9})", Value);
}
}

Expand Down Expand Up @@ -329,7 +329,7 @@ public double Value {

public override string ToString ()
{
return string.Format (CultureInfo.InvariantCulture, "Double({0})", Value);
return string.Format (CultureInfo.InvariantCulture, "Double({0:G17})", Value);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ static XAttribute GetValue (FieldInfo field)
else if (Double.IsPositiveInfinity (doubleItem.Value))
value = "(1.0 / 0.0)";
else
value = doubleItem.Value.ToString ("R", CultureInfo.InvariantCulture);
value = doubleItem.Value.ToString ("G17", CultureInfo.InvariantCulture);
break;
case ConstantPoolItemType.Float:
var floatItem = (ConstantPoolFloatItem) constant;
Expand All @@ -540,7 +540,7 @@ static XAttribute GetValue (FieldInfo field)
else if (Double.IsPositiveInfinity (floatItem.Value))
value = "(1.0f / 0.0f)";
else
value = floatItem.Value.ToString ("R", CultureInfo.InvariantCulture);
value = floatItem.Value.ToString ("G9", CultureInfo.InvariantCulture);
break;
case ConstantPoolItemType.Long: value = ((ConstantPoolLongItem) constant).Value.ToString (); break;
case ConstantPoolItemType.Integer:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<TargetFrameworks>net472;net6.0</TargetFrameworks>
<IsPackable>false</IsPackable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<TargetFrameworks>net472;net6.0</TargetFrameworks>
<IsPackable>false</IsPackable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

namespace Java.InteropTests
{
#if !NET
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What error is being observed that requires disabling this fixture?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Compile errors:

error CS0117: 'AssemblyBuilderAccess' does not contain a definition for 'Save'
error CS1061: 'AppDomain' does not contain a definition for 'DefineDynamicAssembly' and no accessible extension method 'DefineDynamicAssembly' accepting a first argument of type 'AppDomain' could be found (are you missing a using directive or an assembly reference?)
error CS1061: 'LambdaExpression' does not contain a definition for 'CompileToMethod' and no accessible extension method 'CompileToMethod' accepting a first argument of type 'LambdaExpression' could be found (are you missing a using directive or an assembly reference?)

[TestFixture]
class MarshalMemberBuilderTest : JavaVMFixture
{
Expand Down Expand Up @@ -555,4 +556,5 @@ public void CreateConstructActivationPeerExpression ()
}}");
}
}
#endif // !NET
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<TargetFrameworks>net472;net6.0</TargetFrameworks>
<RootNamespace>Java.Interop.Tools.Common_Tests</RootNamespace>
<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<TargetFrameworks>net472;net6.0</TargetFrameworks>
<IsPackable>false</IsPackable>
<DefineConstants>$(DefineConstants);HAVE_CECIL;JCW_ONLY_TYPE_NAMES</DefineConstants>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,12 @@ public void TearDown ()
public void Crc64 ()
{
JavaNativeTypeManager.PackageNamingPolicy = PackageNamingPolicy.LowercaseCrc64;
#if NET
// System.String moved assemblies in .NET
Assert.AreEqual ("crc64d04135c992393d83", JavaNativeTypeManager.GetPackageName (typeof (string)));
#else // !NET
Assert.AreEqual ("crc64b74743e9328eed0a", JavaNativeTypeManager.GetPackageName (typeof (string)));
#endif // !NET
}

[Test]
Expand All @@ -43,7 +48,12 @@ public void Lowercase ()
public void LowercaseWithAssemblyName ()
{
JavaNativeTypeManager.PackageNamingPolicy = PackageNamingPolicy.LowercaseWithAssemblyName;
#if NET
// System.String moved assemblies in .NET
Assert.AreEqual ("assembly_system_private_corelib.system", JavaNativeTypeManager.GetPackageName (typeof (string)));
#else // !NET
Assert.AreEqual ("assembly_mscorlib.system", JavaNativeTypeManager.GetPackageName (typeof (string)));
#endif // !NET
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<TargetFrameworks>net472;net6.0</TargetFrameworks>
<IsPackable>False</IsPackable>
</PropertyGroup>
<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<TargetFrameworks>net472;net6.0</TargetFrameworks>
<IsPackable>false</IsPackable>
</PropertyGroup>

Expand Down
10 changes: 5 additions & 5 deletions tests/Xamarin.Android.Tools.Bytecode-Tests/JavaTypeTests.cs
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 Down Expand Up @@ -114,25 +114,25 @@ public void ClassFile_WithJavaType_class ()
Name = "STATIC_FINAL_SINGLE_MIN",
Descriptor = "F",
AccessFlags = FieldAccessFlags.Public | FieldAccessFlags.Static | FieldAccessFlags.Final,
ConstantValue = "Float(1.401298E-45)",
ConstantValue = "Float(1.40129846E-45)",
},
new ExpectedFieldDeclaration {
Name = "STATIC_FINAL_SINGLE_MAX",
Descriptor = "F",
AccessFlags = FieldAccessFlags.Public | FieldAccessFlags.Static | FieldAccessFlags.Final,
ConstantValue = "Float(3.402823E+38)",
ConstantValue = "Float(3.40282347E+38)",
},
new ExpectedFieldDeclaration {
Name = "STATIC_FINAL_DOUBLE_MIN",
Descriptor = "D",
AccessFlags = FieldAccessFlags.Public | FieldAccessFlags.Static | FieldAccessFlags.Final,
ConstantValue = "Double(4.94065645841247E-324)",
ConstantValue = "Double(4.9406564584124654E-324)",
},
new ExpectedFieldDeclaration {
Name = "STATIC_FINAL_DOUBLE_MAX",
Descriptor = "D",
AccessFlags = FieldAccessFlags.Public | FieldAccessFlags.Static | FieldAccessFlags.Final,
ConstantValue = "Double(1.79769313486232E+308)",
ConstantValue = "Double(1.7976931348623157E+308)",
},
new ExpectedFieldDeclaration {
Name = "STATIC_FINAL_STRING",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@
type="double"
type-generic-aware="double"
jni-signature="D"
value="4.94065645841247E-324"
value="4.9406564584124654E-324"
visibility="public"
volatile="false" />
<field
Expand Down Expand Up @@ -593,7 +593,7 @@
type="float"
type-generic-aware="float"
jni-signature="F"
value="1.401298E-45"
value="1.40129846E-45"
visibility="public"
volatile="false" />
<field
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<TargetFrameworks>net472;net6.0</TargetFrameworks>
<IsPackable>false</IsPackable>
</PropertyGroup>

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

<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<TargetFrameworks>net472;net6.0</TargetFrameworks>
<IsPackable>false</IsPackable>
</PropertyGroup>

Expand Down
6 changes: 5 additions & 1 deletion tests/generator-Tests/Integration-Tests/Compiler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,13 @@ public static Assembly Compile (Xamarin.Android.Binder.CodeGeneratorOptions opti
MetadataReference.CreateFromFile (typeof(Enumerable).Assembly.Location),
MetadataReference.CreateFromFile (typeof(Uri).Assembly.Location),
MetadataReference.CreateFromFile (Path.Combine (binDir, "Java.Interop.dll")),
MetadataReference.CreateFromFile (Path.Combine (facDir, "netstandard.dll"))
MetadataReference.CreateFromFile (Path.Combine (facDir, "netstandard.dll")),
#if NET
MetadataReference.CreateFromFile (Path.Combine (facDir, "System.Runtime.dll")),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this reference required? It doesn't appear to have anything:

 % monodis --typedef /usr/local/share/dotnet/shared/Microsoft.NETCore.App/6.0.0-preview.7.21377.19/System.Runtime.dll       
Typedef Table
1: (null) (flist=1, mlist=1, flags=0x0, extends=0x0)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CS0012: The type 'Enum' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. (SourceFile([871..891)))
CS0012: The type 'ValueType' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. (SourceFile([944..962)))
CS0012: The type 'IDisposable' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. (SourceFile([312..321)))

#endif // NET
};


// Compile!
var compilation = CSharpCompilation.Create (
Path.GetFileName (assemblyFileName),
Expand Down
2 changes: 1 addition & 1 deletion tests/generator-Tests/generator-Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<TargetFrameworks>net472;net6.0</TargetFrameworks>
<IsPackable>false</IsPackable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion tests/logcat-parse-Tests/logcat-parse-Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<TargetFrameworks>net472;net6.0</TargetFrameworks>
<IsPackable>false</IsPackable>
</PropertyGroup>

Expand Down