Граф коммитов

134 Коммитов

Автор SHA1 Сообщение Дата
Sebastien Pouliot 5accd102cf
[dotnet][tvos] Enable ICU (instead of using Invariant) and additional tests (#11247) 2021-04-21 20:19:05 -04:00
Alex Soto 8b926000a6
Merge branch 'main' into alex-xcode12.5-main 2021-04-08 17:42:32 -04:00
Sebastien Pouliot 99892d79f9
[tests] Revert manual preservation of InternalsVisibleToAttribute.ctor(string) (#11160)
The issue https://github.com/mono/linker/issues/1913 was fixed a while ago.
2021-04-08 13:01:35 -04:00
Alex Soto bc1d8513a6 Merge remote-tracking branch 'xamarin/xcode12.5' into alex-xcode12.5-main 2021-04-02 21:46:31 -04:00
Sebastien Pouliot 710604a867
Revert "[tests] Ignore the XmlSerializationTest.Bug1820_GenericList test in .NET due to a linker bug." (#11053)
This reverts commit 9cbf14500b.

The original issue https://github.com/mono/linker/issues/1454 -> https://github.com/dotnet/runtime/issues/41389 was fixed a while ago.

Co-authored-by: Sebastien Pouliot <sebastien.pouliot@microsoft.com>
2021-04-02 00:05:02 -04:00
Peter Collins 5c12fdfac9
[build] Use arcade dependency management tooling (#10890)
* [build] Use arcade dependency management tooling

* Apply feedback

* Apply second round of feedback

* Always make dotnet.config before trying to read it

* Debugging

* Update dependencies, trim tabs and spaces

* [dotnet] Remove the existing workload shipped with .NET and install our locally built ones.

The new version of .NET ships with our workloads, but those aren't
the workloads we want to use, so replace them with our own.

* Update .gitignores.

* Bump to 6.0.100-preview.3.21181.5

That required renaming simulator runtime packs...

* More rename for simulator packages

* moar (hopefully all)

* Bump to 6.0.100-preview.3.21201.11

This fix the issue with `Wait` that failed several tests in monotouch-tests

However it does not include the fix for AppConext.GetData on device (AOT)

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
Co-authored-by: Sebastien Pouliot <sebastien@xamarin.com>
2021-04-02 00:02:27 -04:00
Sebastien Pouliot 35ddc1fcb0
Revert "[tests] Ignore CommonLinkSdkTest.TypeDescriptor_A7793 in .NET due to a linker bug." (#11054)
This reverts commit dea6580c78.

This was fixed a while ago https://github.com/mono/linker/issues/1451 -> https://github.com/dotnet/runtime/issues/41390

Co-authored-by: Sebastien Pouliot <sebastien.pouliot@microsoft.com>
2021-04-01 23:47:21 -04:00
Sebastien Pouliot 747cc9a2b8
[dotnet] Fix device builds (#11036)
With P3 addition on ICU we must now link the native executable as C++.

Remove an old workaround, in many tests, referencing old (5.0/previews)
packages that caused native link time failures.

ref: https://github.com/mono/linker/issues/1139
2021-03-31 12:59:07 -04:00
Sebastien Pouliot f663072514
Revert "[tests] Ignore LinkSdkRegressionTest.AsQueryable_Enumerable due to an issue in .NET" (#11041)
This reverts commit ae0649f4e5.

Original issue https://github.com/dotnet/runtime/issues/41392 was fixed long ago
2021-03-31 09:10:04 -04:00
Sebastien Pouliot bf8bcda9fe
Revert "[tests] Ignore linkall's DataContractTest in .NET due to a linker bug." (#11042)
This reverts commit bc668916e7.

Original issue https://github.com/dotnet/runtime/issues/41525 was solved a while ago.
2021-03-31 09:06:47 -04:00
Sebastien Pouliot b186bd675a
[dotnet] Call monovm_initialize before mono_jit_init (#11014)
Those are called respectively inside `xamarin_vm_initialize` and
`xamarin_bridge_initialize` functions.

This fix the **AppContext.GetData always return null for iOS** issue
https://github.com/dotnet/runtime/issues/50290

Thanks for @filipnavara for diagnosing this quicker than anyone else!

Added unit tests to ensure `AppContext.GetData` can read back the values
we're providing at startup.
2021-03-29 16:23:38 -04:00
Rolf Bjarne Kvinge b30777f420
Bump to .NET 6.0.100-preview.3.21161.23 (#10772)
* Bump to .NET 6.0.100-preview.3.21152.10

* Bump to 6.0.100-preview.3.21152.10.

* Bump to 6.0.100-preview.3.21161.7.

* Bump to .NET 6.0.100-preview.3.21161.23.

* [dotnet-linker] Bump ILink and use the supported method of getting an assembly's location.

* Bump to MSBuild.StructuredLogger 2.1.364 to get support for newer binlog versions.

* Fix build failure

Fixes:

    TestHelpers/BuildEngine.cs(161,24): error CS0433: The type 'ProjectEvaluationFinishedEventArgs' exists in both 'Microsoft.Build.Framework, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'StructuredLogger, Version=2.1.0.0, Culture=neutral, PublicKeyToken=d4c7181801cb6448' [/Users/builder/azdo/_work/1/s/xamarin-macios/tests/msbuild/Xamarin.MacDev.Tests/Xamarin.MacDev.Tests.csproj]

* Update parsing binlog properties.

* Be more defensive.

* [tests] Make sure the InternalsVisibleToAttribute constructor isn't linked away.

* [tests] Implement better printing of binlogs.

The latest MSBuild.StructuredLogger made some internal changes to the Message
property which confuses some of our test logic. So implement manual printing
of the log entries that we care about to make sure they conform to the
expected format by the tests (the output is mimicing what 'msbuild /v:diag
foo.binlog' would show).
2021-03-24 16:59:33 +01:00
Manuel de la Pena f7b208b980
[Xcode12.5] Fix regression test not to crash. fixes #10918 (#10919)
The api does not longer allow you to pass a null ptr. Create a dummy
controller:

fixes https://github.com/xamarin/xamarin-macios/issues/10918
2021-03-19 17:25:56 -04:00
Sebastien Pouliot 00a69e1654
[dotnet] Update `Min*` constants and fix builds for tests (#10835)
We're bumping the minimum OS versions for all supported platforms
https://github.com/dotnet/core/blob/master/release-notes/6.0/6.0-supported-os.md

Intro's `Introduced` test is ignored as it require (a lot of) changes. This
will be fixed in separate PRs and gradually re-enabled.

iOS
```
[FAIL] Introduced : 7573 API with unneeded or incorrect version information
```

tvOS
```
[FAIL] Introduced : 299 API with unneeded or incorrect version information
```

Tracking progress in https://github.com/xamarin/xamarin-macios/issues/10834
2021-03-13 10:38:46 -05:00
Rolf Bjarne Kvinge 2d6a3c42a7
Bump to .NET 6.0.100-preview.2.21153.28. (#10788)
* Bump to .NET 6.0.100-preview.2.21153.28.

* [tests] Ignore failing tests due to dotnet/runtime#49201.
2021-03-05 16:28:31 +01:00
Sebastien Pouliot 0f69381be8
[catalyst][addressbookui] Remove AddressBookUI framework that is not available on Catalyst (#10711)
This required working around internal ctor that uses internal (non
re-generated) types. E.g.

```
build/dotnet/maccatalyst/ref/Xamarin.iOS.cs(9201,64): error CS0234: The type or namespace name 'ABFunc<>' does not exist in the namespace 'AddressBookUI' (are you missing an assembly reference?)
```

We cannot just skip such constructor since the C# compiler will add a
**public** default one when none is present (and that's the case for
the error above),

This also required fixing the ctor chaining code (which can't be shared
with the, previously fixed, override code) so base classes could be
called for some `*EventArg` types.

Follow up to https://github.com/xamarin/xamarin-macios/pull/10658 , https://github.com/xamarin/xamarin-macios/pull/10678 and https://github.com/xamarin/xamarin-macios/pull/10706

This is the last framework that needs removal - but there's still a few
`unknown-*` entries in Catalyst-supported frameworks (more PR coming).
2021-02-25 11:22:02 -05:00
Rolf Bjarne Kvinge 3a29de80a8
[tests] Make link sdk and link all work on Mac Catalyst. (#10579)
* [link sdk/link all] Adjust to compile on Mac Catalyst.

* [tests] Adjust the LinkAllRegressionTest.NoFatCorlib to work on Mac Catalyst.

* [tests] Add version checks to make link sdk green on Mac Catalyst.

* [tests] Make the LinkSdkRegressionTest.SpecialFolder test pass on Mac Catalyst.

* [xharness] link sdk and link all are green on Mac Catalyst now.

* Fix test build.
2021-02-05 07:43:33 +01:00
Rolf Bjarne Kvinge 69c1a715c6
[dotnet] Add support for LinkDescription items. (#10467)
* [dotnet] Add support for LinkDescription items.

Also use the LinkDescription item group instead of a custom one
(_BundlerXmlDefinitions), since there's no need for the custom one.

* The world (aka mmp) isn't quite ready for this yet.

* Don't parse into LinkDescription, use a temporary variable instead.

And then only use the temporary variable for .NET.

The problem is that parsing mtouch extra args and adding any --xml arguments
to LinkDescription is that the xml file will be passed again to mtouch, and in
this case any ${ProjectDir} properties won't be evaluated.
2021-01-27 17:59:35 +01:00
Rolf Bjarne Kvinge df4388e8d1
[link sdk] Adjust the LinkSdkRegressionTest.SpecialFolder to handle uncertainty whether a directory exists or not on .NET. Fixes #xamarin/maccore@2379. (#10511)
The directory does not exist for me locally, but exists when running the tests on
the bots.

Fixes https://github.com/xamarin/maccore/issues/2379.
2021-01-27 17:56:43 +01:00
Rolf Bjarne Kvinge 41c56269f6
[tests] Adjust link all's project file to set properties to their expected values according to the current configuration. (#10468)
Also don't overwrite DefineConstants, just add to it instead.
2021-01-20 07:15:33 +01:00
Rolf Bjarne Kvinge bc7af2ebb7
[tests] Ignore a few known failures in link sdk / link all on device with .NET. (#10458) 2021-01-19 07:53:13 +01:00
Rolf Bjarne Kvinge 7584ada30d
Bump to .NET 6.0.100-alpha.1.21060.3. (#10388)
* Bump to .NET 6.0.100-alpha.1.21060.3.

* Fix dotnet command line arguments.

* dotnet build: the project file must be the first argument.
* dotnet build/publish: use the documented verbosity format.

* Update version number in tests.

* [tests/introspection] Adjust introspection to cope with different library names in the new .NET version.

* [tests/link sdk] Adjust the LinkSdkRegressionTest.SpecialFolder test according to the new version of .NET 6.

* [tests/link sdk] Preserve a required method in System.Private.CoreLib to work around a bug in .NET 6.

Ref: https://github.com/dotnet/runtime/issues/46908.

* Revert "[CI][VSTS] Add the donet 6 pkg as a dependency. (#10348)"

This reverts commit 6de4e717e7.

There's no need to provision .NET 6, it's done automatically.
2021-01-14 14:07:28 +01:00
Rolf Bjarne Kvinge c640775699 [dotnet] Bump to .NET 6.0.100-alpha.1.20556.2. and net6.0
New commits in spouliot/Touch.Unit:

* spouliot/Touch.Unit@f8768d9 Advance into the world of net6.0

Diff: 9abe69e6f5..f8768d99ef
2020-11-10 11:41:06 +01:00
Rolf Bjarne Kvinge 062352ccae [tests] Use 'Microsoft.NET.Sdk' instead of 'Microsoft.<platform>.Sdk'. 2020-10-16 14:27:57 +02:00
Rolf Bjarne Kvinge ac496baabb
[dotnet-linker] Make sure to preserve block-related generated code. Fixes #9562. (#9685)
Fixes https://github.com/xamarin/xamarin-macios/issues/9562.

It also fixes this monotouch-test when enabling all optimizations:

    [FAIL] BlockReturnTest : ObjCRuntime.RuntimeException : Invalid DelegateProxyAttribute for the return value for the method MonoTouchFixtures.ObjCRuntime.RegistrarTest+BlockReturnTestClass.MethodReturningBlock: DelegateType (ObjCRuntime.Trampolines+SDRegistrarTestBlock) specifies a type without a 'Handler' field.
2020-09-25 16:57:04 +02:00
Rolf Bjarne Kvinge 1a582ed59a
[tests] Ignore a few link sdk tests in .NET for now. (#9614)
There are easier fish to fry right now, so implementing the linker support for
these tests to pass (metadata reduction and code removal) can wait.

This makes the link sdk/Release variation green for .NET.

Ref: https://github.com/xamarin/xamarin-macios/issues/9612
Ref: https://github.com/xamarin/xamarin-macios/issues/9613
2020-09-10 16:01:19 +02:00
Rolf Bjarne Kvinge c56b893b68
[tests] Disable some of linkall's SealerTest in .NET/Release until we can implement them. (#9575)
Fixes these test failures:

    Linker.Sealer.SealerTest
    [FAIL] Final :   A
        Expected: True
        But was:  False
            at Linker.Sealer.SealerTest.Final()

    [FAIL] Sealed :   Sealable
        Expected: True
        But was:  False
            at Linker.Sealer.SealerTest.Sealed()

    [FAIL] Virtual :   C
        Expected: False
        But was:  True
            at Linker.Sealer.SealerTest.Virtual()
2020-09-07 10:20:38 +02:00
Rolf Bjarne Kvinge c1c5b9aac6
[tests] Ignore/fix/adjust several link all tests to make them pass in .NET. (#9570)
This gets linkall to an almost green state (there are still a few more failing
tests, those are a bit more complex to fix and will get seperate PRs).
2020-09-02 08:50:31 +02:00
Rolf Bjarne Kvinge 93eb592fba
[tests] Add test case for issue #9566. (#9567)
LinkAll.Interfaces.InterfaceTest

        [FAIL] Issue9566 : System.InvalidCastException : Specified cast is not valid.
            at LinkAll.Interfaces.InterfaceTest.Issue9566 () [0x00001] in /Users/rolf/work/maccore/whatever/xamarin-macios/tests/linker/ios/link all/InterfacesTest.cs:97
            at (wrapper managed-to-native) System.Reflection.RuntimeMethodInfo.InternalInvoke(System.Reflection.RuntimeMethodInfo,object,object[],System.Exception&)
            at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0006a] in
2020-09-02 08:45:58 +02:00
Rolf Bjarne Kvinge c3af3304a8 [tests] Update linkall's CommonLinkAllTest.BindingsAndBeforeInitField[_2] tests to work around linker heuristics.
Also ignore the BindingsAndBeforeInitField test because we're missing a few linker bits to make it work.

Fixes this linkall test failure:

    LinkAll.CommonLinkAllTest
        [FAIL] BindingsAndBeforeInitField :   one
            Expected: 1
            But was:  0
                at LinkAll.CommonLinkAllTest.BindingsAndBeforeInitField() in /Users/rolf/work/maccore/whatever/xamarin-macios/tests/linker/CommonLinkAllTest.cs:line 65
2020-09-01 13:29:05 +02:00
Rolf Bjarne Kvinge 1bbc6c8cbf [tests] Ignore linkall's XmlSerializationTest because .NET's linker doesn't support Xml serialization yet.
Ref: https://github.com/dotnet/runtime/issues/41389#issuecomment-682668670

Fixes this test failure:

    LinkAll.Serialization.Xml.XmlSerializationTest
        [FAIL] GenericProperty_Bug5543 : System.InvalidOperationException : There was an error reflecting type 'LinkAll.Serialization.Xml.XmlResult`1[System.String]'.
            ----> System.InvalidOperationException : There was an error reflecting property 'Result'.
            ----> System.InvalidOperationException : You need to add XmlChoiceIdentifierAttribute to the 'Result' member.
            at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping(TypeModel model, String ns, ImportContext context, String dataType, XmlAttributes a, Boolean repeats, Boolean openModel, RecursionLimiter limiter)
            at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping(TypeModel model, String ns, ImportContext context, String dataType, XmlAttributes a, RecursionLimiter limiter)
            at System.Xml.Serialization.XmlReflectionImporter.ImportElement(TypeModel model, XmlRootAttribute root, String defaultNamespace, RecursionLimiter limiter)
            at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping(Type type, XmlRootAttribute root, String defaultNamespace)
            at System.Xml.Serialization.XmlSerializer..ctor(Type type, String defaultNamespace)
            at System.Xml.Serialization.XmlSerializer..ctor(Type type)
            at LinkAll.Serialization.Xml.XmlSerializationTest.GenericProperty_Bug5543() in /Users/rolf/work/maccore/whatever/xamarin-macios/tests/linker/ios/link all/XmlSerializationTest.cs:line 52
            at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
            --InvalidOperationException
            at System.Xml.Serialization.XmlReflectionImporter.InitializeStructMembers(StructMapping mapping, StructModel model, Boolean openModel, String typeName, RecursionLimiter limiter)
            at System.Xml.Serialization.XmlReflectionImporter.ImportStructLikeMapping(StructModel model, String ns, Boolean openModel, XmlAttributes a, RecursionLimiter limiter)
            at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping(TypeModel model, String ns, ImportContext context, String dataType, XmlAttributes a, Boolean repeats, Boolean openModel, RecursionLimiter limiter)
            --InvalidOperationException
            at System.Xml.Serialization.XmlReflectionImporter.CheckAmbiguousChoice(XmlAttributes a, Type accessorType, String accessorName)
            at System.Xml.Serialization.XmlReflectionImporter.ImportAccessorMapping(MemberMapping accessor, FieldModel model, XmlAttributes a, String ns, Type choiceIdentifierType, Boolean rpc, Boolean openModel, RecursionLimiter limiter)
            at System.Xml.Serialization.XmlReflectionImporter.ImportFieldMapping(StructModel parent, FieldModel model, XmlAttributes a, String ns, RecursionLimiter limiter)
            at System.Xml.Serialization.XmlReflectionImporter.InitializeStructMembers(StructMapping mapping, StructModel model, Boolean openModel, String typeName, RecursionLimiter limiter)
2020-09-01 13:29:05 +02:00
Rolf Bjarne Kvinge 22f67c0103 [tests] Adjust linkall's ClassLayoutTest's DefaultLayoutClass and AutoLayoutClass tests to continue outsmarting a somewhat smarter linker.
Fixes these test failures:

    LinkAll.Layout.ClassLayoutTest
        [FAIL] AutoLayoutClass :   Length
            Expected: 1
            But was:  2
                at LinkAll.Layout.ClassLayoutTest.AutoLayoutClass() in /Users/rolf/work/maccore/whatever/xamarin-macios/tests/linker/ios/link all/ClassLayoutTest.cs:line 73

        [FAIL] DefaultLayoutClass :   Length
            Expected: 1
            But was:  2
                at LinkAll.Layout.ClassLayoutTest.DefaultLayoutClass() in /Users/rolf/work/maccore/whatever/xamarin-macios/tests/linker/ios/link all/ClassLayoutTest.cs:line 57
2020-09-01 13:29:05 +02:00
Rolf Bjarne Kvinge bc668916e7 [tests] Ignore linkall's DataContractTest in .NET due to a linker bug.
Ref: https://github.com/mono/linker/issues/1460

Fixes this test failure:

    LinkAll.Serialization.DataContract.DataContractTest
        [FAIL] Flags : System.NullReferenceException : Object reference not set to an instance of an object
            at System.Runtime.Serialization.CodeGenerator.VerifyParameterCount(MethodInfo methodInfo, Int32 expectedCount)
            at System.Runtime.Serialization.CodeGenerator.Call(Object thisObj, MethodInfo methodInfo, Object param1, Object param2)
            at System.Runtime.Serialization.XmlFormatWriterGenerator.CriticalHelper.InternalSerialize(MethodInfo methodInfo, LocalBuilder memberValue, Type memberType, Boolean writeXsiType)
            at System.Runtime.Serialization.XmlFormatWriterGenerator.CriticalHelper.WriteValue(LocalBuilder memberValue, Boolean writeXsiType)
            at System.Runtime.Serialization.XmlFormatWriterGenerator.CriticalHelper.WriteMembers(ClassDataContract classContract, LocalBuilder extensionDataLocal, ClassDataContract derivedMostClassContract)
            at System.Runtime.Serialization.XmlFormatWriterGenerator.CriticalHelper.WriteClass(ClassDataContract classContract)
            at System.Runtime.Serialization.XmlFormatWriterGenerator.CriticalHelper.GenerateClassWriter(ClassDataContract classContract)
            at System.Runtime.Serialization.XmlFormatWriterGenerator.GenerateClassWriter(ClassDataContract classContract)
            at System.Runtime.Serialization.ClassDataContract.CreateXmlFormatWriterDelegate()
            at System.Runtime.Serialization.ClassDataContract.get_XmlFormatWriterDelegate()
            at System.Runtime.Serialization.ClassDataContract.WriteXmlValue(XmlWriterDelegator xmlWriter, Object obj, XmlObjectSerializerWriteContext context)
            at System.Runtime.Serialization.XmlObjectSerializerWriteContext.WriteDataContractValue(DataContract dataContract, XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle declaredTypeHandle)
            at System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeWithoutXsiType(DataContract dataContract, XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle declaredTypeHandle)
            at System.Runtime.Serialization.DataContractSerializer.InternalWriteObjectContent(XmlWriterDelegator writer, Object graph, DataContractResolver dataContractResolver)
            at System.Runtime.Serialization.DataContractSerializer.InternalWriteObject(XmlWriterDelegator writer, Object graph, DataContractResolver dataContractResolver)
            at System.Runtime.Serialization.XmlObjectSerializer.WriteObjectHandleExceptions(XmlWriterDelegator writer, Object graph, DataContractResolver dataContractResolver)
            at System.Runtime.Serialization.XmlObjectSerializer.WriteObjectHandleExceptions(XmlWriterDelegator writer, Object graph)
            at System.Runtime.Serialization.DataContractSerializer.WriteObject(XmlWriter writer, Object graph)
            at LinkAll.Serialization.DataContract.DataContractTest.ToXml[TestClass](TestClass obj) in [...]/xamarin-macios/tests/linker/ios/link all/DataContractTest.cs:line 35
            at LinkAll.Serialization.DataContract.DataContractTest.Flags() in [...]/xamarin-macios/tests/linker/ios/link all/DataContractTest.cs:line 73
            at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
2020-09-01 13:29:05 +02:00
Rolf Bjarne Kvinge 3940df936b [tests] Exclude test case in linkall's InterfacesTest.Bug10866 test due to a bugfix in the linker.
Ref: https://github.com/mono/linker/issues/1459
Ref: https://github.com/xamarin/xamarin-macios/issues/9566

Fixes this test failure:

    LinkAll.Interfaces.InterfaceTest
        [FAIL] Bug10866 :   B::Bar
            Expected: null
            But was:  <Void Bar()>
                at LinkAll.Interfaces.InterfaceTest.Bug10866() in /Users/rolf/work/maccore/whatever/xamarin-macios/tests/linker/ios/link all/InterfacesTest.cs:line 91
2020-09-01 13:29:05 +02:00
Rolf Bjarne Kvinge bdb91f9272 [tests] Update linkall's CommonLinkAllTest.TypeConverter_Custom to take into account that .NET will generate assembly attributes by default.
Fixes this test failure:

    LinkAll.CommonLinkAllTest
        [FAIL] TypeConverter_Custom :   ConverterTypeName
            String lengths are both 88. Strings differ at index 43.
            Expected: "...nk all, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"
            But was:  "...nk all, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
            ------------------------------^
                at LinkAll.CommonLinkAllTest.TypeConverter_Custom() in /Users/rolf/work/maccore/whatever/xamarin-macios/tests/linker/CommonLinkAllTest.cs:line 88
2020-09-01 13:29:05 +02:00
Rolf Bjarne Kvinge 1c57da6d4c [tests] Update linkall's CommonLinkAllTest.TypeConverter_BuiltIn to take into account that BooleanConverter is in a different assembly in .NET.
Fixes this test failure:

    LinkAll.CommonLinkAllTest
        [FAIL] TypeConverter_BuiltIn :   ConverterTypeName
            Expected string length 113 but was 142. Strings differ at index 46.
            Expected: "...Model.BooleanConverter, System, Version=2.0.5.0, Culture=n..."
            But was:  "...Model.BooleanConverter, System.ComponentModel.TypeConverte..."
            --------------------------------------------^
                at LinkAll.CommonLinkAllTest.TypeConverter_BuiltIn() in /Users/rolf/work/maccore/whatever/xamarin-macios/tests/linker/CommonLinkAllTest.cs:line 79
2020-09-01 13:29:05 +02:00
Rolf Bjarne Kvinge 6cc233a110 [tests] Make reflection more complicated to work around linker heuristics in linkall's PreserveTest.
This fixes this linkall test failure:

    LinkAll.Attributes.PreserveTest
        [FAIL] PreserveTypeWithoutMembers :   members
            Expected: null
            But was:  <System.String Absent>
                at LinkAll.Attributes.PreserveTest.PreserveTypeWithoutMembers() in /Users/rolf/work/maccore/whatever/xamarin-macios/tests/linker/ios/link all/PreserveTest.cs:line 76

There were more complications added than strictly required to make the above
test pass, but it seems like this way we make sure the linker isn't too smart
for the other tests as well, and we end up testing what we actually want to
test.
2020-09-01 13:29:05 +02:00
Rolf Bjarne Kvinge e9f2381563 [tests] Ignore linkall tests that require globalization support.
.NET doesn't have any globalization support yet.

Ref: https://github.com/xamarin/xamarin-macios/issues/8906

This fixes these tests:

    LinkAll.Calendars.CalendarTest
        [FAIL] Hijri :   Calendar
            Expected string length 34 but was 38. Strings differ at index 21.
            Expected: "System.Globalization.HijriCalendar"
            But was:  "System.Globalization.GregorianCalendar"
            --------------------------------^
                at LinkAll.Calendars.CalendarTest.Hijri() in [...]/xamarin-macios/tests/linker/ios/link all/CalendarTest.cs:line 28

        [FAIL] ThaiBuddhist :   Calendar
            Expected string length 41 but was 38. Strings differ at index 21.
            Expected: "System.Globalization.ThaiBuddhistCalendar"
            But was:  "System.Globalization.GregorianCalendar"
            --------------------------------^
                at LinkAll.Calendars.CalendarTest.ThaiBuddhist() in [...]/xamarin-macios/tests/linker/ios/link all/CalendarTest.cs:line 35

        [FAIL] UmAlQura :   Calendar
            Expected string length 37 but was 38. Strings differ at index 21.
            Expected: "System.Globalization.UmAlQuraCalendar"
            But was:  "System.Globalization.GregorianCalendar"
            --------------------------------^
                at LinkAll.Calendars.CalendarTest.UmAlQura() in [...]/xamarin-macios/tests/linker/ios/link all/CalendarTest.cs:line 21
2020-09-01 13:29:05 +02:00
Rolf Bjarne Kvinge 41b1f540f7 [tests] Use the correct corlib assembly name in linkall's AttributeTest.
Fixes this linkall test failure:

    LinkAll.Attributes.AttributeTest
        [FAIL] DebuggerTypeProxy_24203 :   proxy
            Expected: not null
            But was:  null
                at LinkAll.Attributes.AttributeTest.DebuggerTypeProxy_24203() in /Users/rolf/work/maccore/whatever/xamarin-macios/tests/linker/ios/link all/AttributeTest.cs:line 191
2020-09-01 13:29:05 +02:00
Rolf Bjarne Kvinge bb443fdcf3
[tests] Remove dead code in linkall's PreserveTest. (#9548) 2020-08-31 17:57:22 +02:00
Rolf Bjarne Kvinge d2788511b6
[dotnet] Use net5.0-[ios|tvos|watchos|macos] TargetFrameworks. (#9532)
* [dotnet] Set TargetPlatformSupported when the right TargetPlatformIdentifier is used.

* [dotnet] Generate a list of valid OS versions for each platform, and add it to the SupportedTargetPlatform item group.

The generated files: https://gist.github.com/rolfbjarne/765c4e4b38b1b017380c9378d9666317

* [dotnet] Define and set the default platform version if it's not set in the TargetFramework variable.

* [dotnet] Switch to using the new-style TargetFramework values.

This includes bumping spouliot/Touch.Unit to get new-style TargetFramework values for Touch.Client.

* spouliot/Touch.Unit@89afaf7 [Touch.Client] Use the right TargetFrameworks for watchOS and macOS as well. (#92)
* spouliot/Touch.Unit@fd0e576 [Touch.Client] Use the right TargetFrameworks. (#91)
* spouliot/Touch.Unit@40f47db [Touch.Client] Add a macOS and watchOS version for .NET. (#90)
* spouliot/Touch.Unit@1d4b8c0 Add .gitignore for NuGet.config and global.json. (#89)
* spouliot/Touch.Unit@49441f3 Call `mlaunch` instead of `mtouch` (#88)
* spouliot/Touch.Unit@b157cf4 Fix a few markdown issues found by markdownlint. (#87)

Diff: d7f55a6167..89afaf7e05

* [dotnet] Document the script that generates the lists of the target platform versions a little bit better.

* [dotnet] Make the [Platform]SupportedTargetPlatform variables public.

This matches how Android and Windows do it:

* https://github.com/xamarin/xamarin-android/pull/5007
* 18ee4eac8b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.WindowsSupportedTargetPlatforms.props

* [xharness] Update the TargetFramework value when creating project variations.
2020-08-31 09:27:19 +02:00
Rolf Bjarne Kvinge d5ddc920e7
[tests] Skip the TypeDescriptorCanary test in .NET. (#9527)
It tests internal implementation details, and those details have now changed
(https://github.com/dotnet/runtime/pull/39973). So just skip the entire test
for now.

Fixes this test failure:

    DontLink.CommonDontLinkTest
        [FAIL] TypeDescriptorCanary : System.InvalidCastException : Specified cast is not valid. :    at DontLink.CommonDontLinkTest.TypeDescriptorCanary() in /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/linker/CommonDontLinkTest.cs:line 22
            at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
2020-08-27 16:01:49 +02:00
Rolf Bjarne Kvinge 30b1a8acbd
[tests] Port link all to .NET (#9515)
* [tests] Port link all to .NET

* [tests] Exclude link all tests in .NET that reference OpenTK-1.0.dll

OpenTK-1.0.dll isn't supported yet.

* [tests] Exclude link all tests using API that isn't available anymore in .NET.
2020-08-27 08:07:50 +02:00
Rolf Bjarne Kvinge 1adcd5e89c [tests] Adjust the PclTest.ServiceModel test to not throw ArgumentNullException in .NET.
This fix works just as well for the current Mono BCL as well, so there's no .NET condition.

This fixes this link sdk test:

    LinkSdk.PclTest
        [FAIL] ServiceModel : System.ArgumentNullException : Value cannot be null. (Parameter 'name')
            at System.ServiceModel.Channels.AddressHeaderCollection.FindAll(String name, String ns)
            at LinkSdk.PclTest.ServiceModel() in /Users/rolf/work/maccore/whatever/xamarin-macios/tests/linker/ios/link sdk/PclTest.cs:line 73
            at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
2020-08-26 09:58:47 +02:00
Rolf Bjarne Kvinge eb79bccd74 [tests] Skip testing Environment.SpecialFolder.ProgramFiles in .NET due to a .NET issue.
Ref: https://github.com/dotnet/runtime/issues/41383

Fixes this link sdk test failure:

    [FAIL] SpecialFolder :   /Users/rolf/Library/Developer/CoreSimulator/Devices/0E45B8DF-05EF-47E7-A31F-3B829DEA2628/data/Containers/Data/Application/6454039E-D5F1-4C41-BF16-6C81CBAB1724/Applications
        Expected: True
        But was:  False
            at LinkSdk.LinkSdkRegressionTest.TestFolder(SpecialFolder folder, Boolean supported, Boolean exists, Boolean readOnly) in [...]/xamarin-macios/tests/linker/ios/link sdk/LinkSdkRegressionTest.cs:line 815
            at LinkSdk.LinkSdkRegressionTest.SpecialFolder() in [...]/xamarin-macios/tests/linker/ios/link sdk/LinkSdkRegressionTest.cs:line 900
2020-08-26 09:58:47 +02:00
Rolf Bjarne Kvinge 9cbf14500b [tests] Ignore the XmlSerializationTest.Bug1820_GenericList test in .NET due to a linker bug.
Ref: https://github.com/mono/linker/issues/1454

Fixes this link sdk test failure:

    LinkSdk.Serialization.XmlSerializationTest
        [FAIL] Bug1820_GenericList : System.ArgumentNullException : Value cannot be null. (Parameter 'obj')
            at System.Reflection.Emit.ModuleBuilder.GetToken(MemberInfo member, Boolean create_open_instance)
            at System.Reflection.Emit.ModuleBuilderTokenGenerator.GetToken(MemberInfo member, Boolean create_open_instance)
            at System.Reflection.Emit.ILGenerator.Emit(OpCode opcode, ConstructorInfo con)
            at System.Xml.Serialization.CodeGenerator.Call(ConstructorInfo ctor)
            at System.Xml.Serialization.XmlSerializationILGen.GenerateSerializerContract(String className, XmlMapping[] xmlMappings, Type[] types, String readerType, String[] readMethods, String writerType, String[] writerMethods, Dictionary`2 serializers)
            at System.Xml.Serialization.TempAssembly.GenerateRefEmitAssembly(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace)
            at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, String location)
            at System.Xml.Serialization.XmlSerializer.GenerateTempAssembly(XmlMapping xmlMapping, Type type, String defaultNamespace, String location)
            at System.Xml.Serialization.XmlSerializer.GenerateTempAssembly(XmlMapping xmlMapping, Type type, String defaultNamespace)
            at System.Xml.Serialization.XmlSerializer..ctor(Type type, String defaultNamespace)
            at System.Xml.Serialization.XmlSerializer..ctor(Type type)
            at LinkSdk.Serialization.XmlSerializationTest.Response.get_Serializer() in [...]/xamarin-macios/tests/linker/ios/link sdk/Bug1820Test.cs:line 38
            at LinkSdk.Serialization.XmlSerializationTest.Response.Deserialize(String xml) in [...]/xamarin-macios/tests/linker/ios/link sdk/Bug1820Test.cs:line 48
            at LinkSdk.Serialization.XmlSerializationTest.Bug1820_GenericList() in [...]/xamarin-macios/tests/linker/ios/link sdk/Bug1820Test.cs:line 166
            at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
2020-08-26 09:58:47 +02:00
Rolf Bjarne Kvinge 39660b687c [tests] Assert that the Mono.Runtime type does *not* exist in .NET.
Fixes this link sdk test failure:

    LinkSdk.LinkSdkRegressionTest
        [FAIL] MonoRuntime34671 :   Mono.Runtime
            Expected: not null
            But was:  null
                at LinkSdk.LinkSdkRegressionTest.MonoRuntime34671() in /Users/rolf/work/maccore/whatever/xamarin-macios/tests/linker/ios/link sdk/LinkSdkRegressionTest.cs:line 1007
2020-08-26 09:58:47 +02:00
Rolf Bjarne Kvinge 14aefe5576 [tests] Adjust LinkSdkRegressionTest.PrivateMemorySize64 in .NET to expected values.
This fixes this link sdk test failure:

    LinkSdk.LinkSdkRegressionTest
        [FAIL] PrivateMemorySize64 :   PrivateMemorySize64
            Expected: not equal to 0
            But was:  0
                at LinkSdk.LinkSdkRegressionTest.PrivateMemorySize64() in /Users/rolf/work/maccore/whatever/xamarin-macios/tests/linker/ios/link sdk/LinkSdkRegressionTest.cs:line 805
2020-08-26 09:58:47 +02:00
Rolf Bjarne Kvinge ae0649f4e5 [tests] Ignore LinkSdkRegressionTest.AsQueryable_Enumerable due to an issue in .NET
Ref: https://github.com/dotnet/runtime/issues/41392

Fixes this link sdk test failure:

    LinkSdk.LinkSdkRegressionTest
        [FAIL] AsQueryable_Enumerable : System.NullReferenceException : Object reference not set to an instance of an object
            at System.Linq.EnumerableRewriter.FindEnumerableMethod(String name, ReadOnlyCollection`1 args, Type[] typeArgs)
            at System.Linq.EnumerableRewriter.VisitMethodCall(MethodCallExpression m)
            at System.Linq.Expressions.MethodCallExpression.Accept(ExpressionVisitor visitor)
            at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node)
            at System.Linq.Expressions.ExpressionVisitor.Visit(ReadOnlyCollection`1 nodes)
            at System.Linq.EnumerableRewriter.VisitMethodCall(MethodCallExpression m)
            at System.Linq.Expressions.MethodCallExpression.Accept(ExpressionVisitor visitor)
            at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node)
            at System.Linq.EnumerableExecutor`1[[System.Linq.IGrouping`2[[System.String, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.String, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Linq, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]].Execute()
            at System.Linq.EnumerableQuery`1[[System.Linq.IGrouping`2[[System.String, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.String, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Linq, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]].System.Linq.IQueryProvider.Execute[IGrouping`2](Expression expression)
            at System.Linq.Queryable.FirstOrDefault[IGrouping`2](IQueryable`1 source)
            at LinkSdk.LinkSdkRegressionTest.AsQueryable_Enumerable() in /Users/rolf/work/maccore/whatever/xamarin-macios/tests/linker/ios/link sdk/LinkSdkRegressionTest.cs:line 1100
            at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
2020-08-26 09:58:47 +02:00
Rolf Bjarne Kvinge 75fbd970e0 [tests] Adjust LinkSdkRegressionTest.Pointer_5200 to work on .NET
Fixes this link sdk test failure:

    LinkSdk.LinkSdkRegressionTest
        [FAIL] Pointer_5200 :
            Expected: not null
            But was:  null
                at LinkSdk.LinkSdkRegressionTest.Pointer_5200() in /Users/rolf/work/maccore/whatever/xamarin-macios/tests/linker/ios/link sdk/LinkSdkRegressionTest.cs:line 696
2020-08-26 09:58:47 +02:00