diff --git a/build-tools/automation/templates/core-tests.yaml b/build-tools/automation/templates/core-tests.yaml index f62747fa3..5123234f6 100644 --- a/build-tools/automation/templates/core-tests.yaml +++ b/build-tools/automation/templates/core-tests.yaml @@ -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 @@ -80,7 +80,7 @@ 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 @@ -88,7 +88,7 @@ steps: 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 diff --git a/src/Xamarin.Android.Tools.Bytecode/ConstantPool.cs b/src/Xamarin.Android.Tools.Bytecode/ConstantPool.cs index d184d4572..57df19fd7 100644 --- a/src/Xamarin.Android.Tools.Bytecode/ConstantPool.cs +++ b/src/Xamarin.Android.Tools.Bytecode/ConstantPool.cs @@ -266,7 +266,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); } } @@ -335,7 +335,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); } } diff --git a/src/Xamarin.Android.Tools.Bytecode/XmlClassDeclarationBuilder.cs b/src/Xamarin.Android.Tools.Bytecode/XmlClassDeclarationBuilder.cs index 0eee7344e..e32d3be6b 100644 --- a/src/Xamarin.Android.Tools.Bytecode/XmlClassDeclarationBuilder.cs +++ b/src/Xamarin.Android.Tools.Bytecode/XmlClassDeclarationBuilder.cs @@ -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; @@ -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: diff --git a/tests/Java.Interop.Dynamic-Tests/Java.Interop.Dynamic-Tests.csproj b/tests/Java.Interop.Dynamic-Tests/Java.Interop.Dynamic-Tests.csproj index 78cf824b0..e9afbb274 100644 --- a/tests/Java.Interop.Dynamic-Tests/Java.Interop.Dynamic-Tests.csproj +++ b/tests/Java.Interop.Dynamic-Tests/Java.Interop.Dynamic-Tests.csproj @@ -1,7 +1,7 @@  - net472 + net472;net6.0 false true diff --git a/tests/Java.Interop.Export-Tests/Java.Interop.Export-Tests.csproj b/tests/Java.Interop.Export-Tests/Java.Interop.Export-Tests.csproj index 88bd39a60..b1d81514b 100644 --- a/tests/Java.Interop.Export-Tests/Java.Interop.Export-Tests.csproj +++ b/tests/Java.Interop.Export-Tests/Java.Interop.Export-Tests.csproj @@ -1,7 +1,7 @@  - net472 + net472;net6.0 false true diff --git a/tests/Java.Interop.Export-Tests/Java.Interop/MarshalMemberBuilderTest.cs b/tests/Java.Interop.Export-Tests/Java.Interop/MarshalMemberBuilderTest.cs index 65ad25777..3d117c508 100644 --- a/tests/Java.Interop.Export-Tests/Java.Interop/MarshalMemberBuilderTest.cs +++ b/tests/Java.Interop.Export-Tests/Java.Interop/MarshalMemberBuilderTest.cs @@ -12,6 +12,7 @@ namespace Java.InteropTests { +#if !NET [TestFixture] class MarshalMemberBuilderTest : JavaVMFixture { @@ -555,4 +556,5 @@ public void CreateConstructActivationPeerExpression () }}"); } } +#endif // !NET } diff --git a/tests/Java.Interop.Tools.Generator-Tests/Java.Interop.Tools.Generator-Tests.csproj b/tests/Java.Interop.Tools.Generator-Tests/Java.Interop.Tools.Generator-Tests.csproj index 8e654fc64..9a3cf0b73 100644 --- a/tests/Java.Interop.Tools.Generator-Tests/Java.Interop.Tools.Generator-Tests.csproj +++ b/tests/Java.Interop.Tools.Generator-Tests/Java.Interop.Tools.Generator-Tests.csproj @@ -1,7 +1,7 @@ - net472 + net472;net6.0 Java.Interop.Tools.Common_Tests false diff --git a/tests/Java.Interop.Tools.JavaCallableWrappers-Tests/Java.Interop.Tools.JavaCallableWrappers-Tests.csproj b/tests/Java.Interop.Tools.JavaCallableWrappers-Tests/Java.Interop.Tools.JavaCallableWrappers-Tests.csproj index 9195db50c..05131ed80 100644 --- a/tests/Java.Interop.Tools.JavaCallableWrappers-Tests/Java.Interop.Tools.JavaCallableWrappers-Tests.csproj +++ b/tests/Java.Interop.Tools.JavaCallableWrappers-Tests/Java.Interop.Tools.JavaCallableWrappers-Tests.csproj @@ -1,7 +1,7 @@ - net472 + net472;net6.0 false $(DefineConstants);HAVE_CECIL;JCW_ONLY_TYPE_NAMES diff --git a/tests/Java.Interop.Tools.JavaCallableWrappers-Tests/Java.Interop.Tools.JavaCallableWrappers/JavaNativeTypeManagerTests.cs b/tests/Java.Interop.Tools.JavaCallableWrappers-Tests/Java.Interop.Tools.JavaCallableWrappers/JavaNativeTypeManagerTests.cs index aca492e74..a86ff05f3 100644 --- a/tests/Java.Interop.Tools.JavaCallableWrappers-Tests/Java.Interop.Tools.JavaCallableWrappers/JavaNativeTypeManagerTests.cs +++ b/tests/Java.Interop.Tools.JavaCallableWrappers-Tests/Java.Interop.Tools.JavaCallableWrappers/JavaNativeTypeManagerTests.cs @@ -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] @@ -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 } } } diff --git a/tests/Java.Interop.Tools.JavaSource-Tests/Java.Interop.Tools.JavaSource-Tests.csproj b/tests/Java.Interop.Tools.JavaSource-Tests/Java.Interop.Tools.JavaSource-Tests.csproj index f563fc18c..71af957fe 100644 --- a/tests/Java.Interop.Tools.JavaSource-Tests/Java.Interop.Tools.JavaSource-Tests.csproj +++ b/tests/Java.Interop.Tools.JavaSource-Tests/Java.Interop.Tools.JavaSource-Tests.csproj @@ -1,6 +1,6 @@  - net472 + net472;net6.0 False diff --git a/tests/Xamarin.Android.Tools.ApiXmlAdjuster-Tests/Xamarin.Android.Tools.ApiXmlAdjuster-Tests.csproj b/tests/Xamarin.Android.Tools.ApiXmlAdjuster-Tests/Xamarin.Android.Tools.ApiXmlAdjuster-Tests.csproj index c723a267b..ecf33d9e1 100644 --- a/tests/Xamarin.Android.Tools.ApiXmlAdjuster-Tests/Xamarin.Android.Tools.ApiXmlAdjuster-Tests.csproj +++ b/tests/Xamarin.Android.Tools.ApiXmlAdjuster-Tests/Xamarin.Android.Tools.ApiXmlAdjuster-Tests.csproj @@ -1,7 +1,7 @@ - net472 + net472;net6.0 false diff --git a/tests/Xamarin.Android.Tools.Bytecode-Tests/JavaTypeTests.cs b/tests/Xamarin.Android.Tools.Bytecode-Tests/JavaTypeTests.cs index 8c828058e..e6a34a5e3 100644 --- a/tests/Xamarin.Android.Tools.Bytecode-Tests/JavaTypeTests.cs +++ b/tests/Xamarin.Android.Tools.Bytecode-Tests/JavaTypeTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; @@ -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", diff --git a/tests/Xamarin.Android.Tools.Bytecode-Tests/Resources/JavaType.xml b/tests/Xamarin.Android.Tools.Bytecode-Tests/Resources/JavaType.xml index 428d687ab..b39986490 100644 --- a/tests/Xamarin.Android.Tools.Bytecode-Tests/Resources/JavaType.xml +++ b/tests/Xamarin.Android.Tools.Bytecode-Tests/Resources/JavaType.xml @@ -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" /> - net472 + net472;net6.0 false diff --git a/tests/Xamarin.SourceWriter-Tests/Xamarin.SourceWriter-Tests.csproj b/tests/Xamarin.SourceWriter-Tests/Xamarin.SourceWriter-Tests.csproj index 3ec049c1b..b6ad9f07b 100644 --- a/tests/Xamarin.SourceWriter-Tests/Xamarin.SourceWriter-Tests.csproj +++ b/tests/Xamarin.SourceWriter-Tests/Xamarin.SourceWriter-Tests.csproj @@ -1,7 +1,7 @@ - net472 + net472;net6.0 false diff --git a/tests/generator-Tests/Integration-Tests/Compiler.cs b/tests/generator-Tests/Integration-Tests/Compiler.cs index d4221fa0d..883ca47b8 100644 --- a/tests/generator-Tests/Integration-Tests/Compiler.cs +++ b/tests/generator-Tests/Integration-Tests/Compiler.cs @@ -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")), +#endif // NET }; + // Compile! var compilation = CSharpCompilation.Create ( Path.GetFileName (assemblyFileName), diff --git a/tests/generator-Tests/generator-Tests.csproj b/tests/generator-Tests/generator-Tests.csproj index 5a8d08bd9..09c902fde 100644 --- a/tests/generator-Tests/generator-Tests.csproj +++ b/tests/generator-Tests/generator-Tests.csproj @@ -1,7 +1,7 @@  - net472 + net472;net6.0 false true diff --git a/tests/logcat-parse-Tests/logcat-parse-Tests.csproj b/tests/logcat-parse-Tests/logcat-parse-Tests.csproj index af4103bed..eacd22fa6 100644 --- a/tests/logcat-parse-Tests/logcat-parse-Tests.csproj +++ b/tests/logcat-parse-Tests/logcat-parse-Tests.csproj @@ -1,7 +1,7 @@  - net472 + net472;net6.0 false