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

27 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 706663845d
[tests] Adjust a few tests to try network requests multiple times. (#14943)
* A few tests seem to be failing rather consistently with network errors.
  Rewrite these tests to try multiple urls before failing (we'll be assuming
  that if one of the urls succeed, the other failures were network related).

* Rename the LinkAnyTest.WebClientTest to LinkAnyTest.WebClientTest_Http to
  follow it's original intent, and make it test http instead of https.

* Remove unnecessary assertion from SSL_IP_5706. This is tested in plenty of other places.
2022-05-13 08:50:28 +02:00
Rolf Bjarne Kvinge 39bdae2b7f
[monotouch-test] Ignore a few tests in non-ARM64 simulators. (#13487)
* [monotouch-test] Ignore a few tests in non-ARM64 simulators.

Some tests fail when running on an M1, but in a x64_86 mode, so just ignore
those unless we're running on ARM64 (this will currently exclude them on
x86_64 hardware too, but that'll eventually not be a problem anymore when
there's no more x86_64 hardware, and just checking for ARM64 is easier than
checking for x86_64 mode on an ARM64 CPU).

* Make more legacy projects unsafe.
2021-12-07 21:10:39 +01:00
Rolf Bjarne Kvinge 66e596e9d9
[tests] Change TestRuntime.CheckSystemVersion to take a ApplePlatform value instead of a PlatformName enum. (#13350)
The PlatformName enum will be removed from .NET soon.
2021-11-15 08:06:36 +01:00
Rolf Bjarne Kvinge cd60fc7123
[tests] Add .NET version of link all for macOS. (#12436)
This also required changing some linker code to not have platform-specific conditional compilation,
because dotnet-linker is built only once for .NET (same binary for all platforms).
2021-08-17 16:39:43 +02:00
Rolf Bjarne Kvinge 2972e1b715
Fix some whitespace issues in various files. (#12399)
* Remove BOM
* Add EOL at end of file.
2021-08-11 10:06:46 +02:00
Rolf Bjarne Kvinge dcfa5015cc [tests] Update Xamarin.Mac tests to use Touch.Client and the official NUnit[Lite]. 2020-08-03 11:53:17 +02:00
Rolf Bjarne Kvinge cff47214ec [tests] Move bindings-test[-mac].csproj to their own directory. 2020-07-21 17:24:15 +02:00
Rolf Bjarne Kvinge 2b2f1d08dc
[tests] Remove Classic code from all tests. (#8702) 2020-05-28 16:35:09 +02:00
Sebastien Pouliot a5ac0ea102
[generator] Add C#8 nullability into generated code (#7570)
Goals
* Reflect Apple nullability annotations in our bindings using C#8
* No warnings when building bindings

Non-Goals
* Update (add or fix) `[NullAllowed]` to match Apple headers (next phase)
* Make the generator or internal code fully nullable aware (`nowarn` is used)

Notes
* Apple's own annotations are not 100% accurate :(
* Where known issue exists we have _fixed_ our attributes to match reality :)
* We also do additional null-checks internally that might seems not required (better safe than sorry).
2020-04-09 09:29:28 -04:00
Manuel de la Pena 245fdf96aa
[Tests] Reuse NetworkResources in the linker tests. (#7451)
The linking tests do use a number of endpoints.
As with PR https://github.com/xamarin/xamarin-macios/pull/7418 we want
to have all the endpoints in a single place to update them if the server
side does give us problems.
2019-11-25 04:54:56 -05:00
Manuel de la Pena ca98880277
[Tests] If we have server errors. Mark test as inconclusive. (#7401)
If we are getting errors (500,401..) do not mark a link all test as a
failure, but as inconclusive. Update the urls since msdn is giving always a 500.

Fixes: https://github.com/xamarin/maccore/issues/2056
2019-11-12 13:34:58 -05:00
Rolf Bjarne Kvinge 7bc0954e96
[mmptest] Port the link-webclient-* tests to NUnit LinkAll+LinkSdk tests. Partial fix for #4975. (#6557)
Fixes part of https://github.com/xamarin/xamarin-macios/issues/4975.
2019-07-11 22:46:02 -07:00
Rolf Bjarne Kvinge accafe9eb4
[mmptest] Port link-httpclient-async to an NUnit LinkAll+LinkSdk test. Partial fix for #4975. (#6554)
Fixes part of https://github.com/xamarin/xamarin-macios/issues/4975.
2019-07-11 06:20:28 -07:00
Rolf Bjarne Kvinge 1a664d44bc
[mmptest] Port the link-xml-serialization test to an NUnit LinkAll test. Partial fix for #4975. (#6555)
Fixes part of https://github.com/xamarin/xamarin-macios/issues/4975.
2019-07-11 06:20:07 -07:00
Rolf Bjarne Kvinge 891dfcb7d9
[mmptest] Port link-uithread-1/2 to an NUnit LinkAll test. Partial fix for #4975. (#6546)
Fixes part of https://github.com/xamarin/xamarin-macios/issues/4975.
2019-07-11 01:24:21 -07:00
Rolf Bjarne Kvinge 270d13538d
[mmptest] Port link-blocks-1 to an NUnit LinkAll+LinkSdk test. Partial fix for #4975. (#6536)
Fixes part of https://github.com/xamarin/xamarin-macios/issues/4975.
2019-07-09 07:09:17 -07:00
Rolf Bjarne Kvinge 87a6dc5fd4
[mmptest] Reuse the existing iOS version of the link-data-contract-1 test. Partial fix for #4975. (#6535)
We already have an iOS version of the link-data-contract-1 test (from which
the link-data-contract-1 test was originally ported), so reuse that version
now.

Fixes part of https://github.com/xamarin/xamarin-macios/issues/4975.
2019-07-09 06:18:29 -07:00
Rolf Bjarne Kvinge 29f26e5c45
[mmptest] Port link-aes-1 to an NUnit LinkAll+LinkSdk test. Partial fix for #4975. (#6501)
Fixes part of https://github.com/xamarin/xamarin-macios/issues/4975.
2019-07-05 06:05:15 -07:00
Rolf Bjarne Kvinge ea55923f54 [tests] Simplify a few [Intermediate]OutputPaths.
Everything is Unified now, so no need to add it to the output path anymore to
make distinguished project output.
2019-06-20 10:36:14 +02:00
Rolf Bjarne Kvinge 2fe7377003
[tests] Remove 32-bit Xamarin.Mac tests (both Classic and Unified). (#6301)
* [tests] Remove 32-bit Xamarin.Mac tests (both Classic and Unified).

We're removing support for 32-bit Xamarin.Mac apps (#6300), which means we
don't need to run the tests anymore.

This part of the implementation for #6300, I'm starting with the tests because
some of our XM/Classic tests are failing and making the bots unnecessarily red
(since we'll remove XM/Classic support anyway). Also CI will be faster if we
don't run these tests.

* [mmptest] Fix build.

* [tests] Fix build for mono-native-mac.csproj.
2019-06-17 08:03:58 +02:00
Rolf Bjarne Kvinge d02c9bc8e0
Add a Runtime.IsARM64CallingConvention property. (#5569)
* Add a Runtime.IsARM64CallingConvention property.

Determining whether we should use the ARM64 calling convention in P/Invokes
gets more complicated with ARM64_32 (which for our purposes is a 32-bit
architecture).

So add a property on the Runtime class to avoid code duplication, and teach
the linker to optimize any calls to this property to a constant value whenever
possible (and the method is marked as optimizable).

Also change our code to use this new property, and make the corresponding
methods optimizable.

Some shuffling in mmp was required, which meant a little bit more code is now
shared between mtouch and mmp.

* Coding style.

* Test tweaks.

* Improve comment.

* Document new optimization

* Move ILReader to shared linker test code location.

* Disable inlining on armv7k.

* Change IsARM64CallingConvention to a read-only field.

We can give the AOT compiler a constant value for a read-only field, so that
the AOT compiler optimizes away the call to the field by using the constant
value.

This commit does not implement this change for the AOT compiler, but using a
read-only field makes it easy to implement it in the future.
2019-02-11 17:29:13 +01:00
Rolf Bjarne Kvinge cca50fe500 Mono 2018-08 requires macOS 10.9+, so Xamarin.Mac must as well. 2018-10-25 09:54:43 +02:00
Sebastien Pouliot 6751f27841
[tests][mmp] Move TypeDescriptor (regression) tests to unit tests (#4994)
Also move some tests to share more (now and in future commits)
with iOS linker-related tests.

Part of https://github.com/xamarin/xamarin-macios/issues/4975
2018-10-17 08:25:37 -04:00
Sebastien Pouliot e8b87b77d7
[tests][mmp] Convert old mmp calendar regression tests to unit tests (#4983) 2018-10-15 11:15:20 -04:00
Rolf Bjarne Kvinge 73f6bf0722
[tests] Determine at runtime instead of compile time whether LinkAll is enabled. Fixes #3812. (#4004)
* [tests] Determine at runtime instead of compile time whether LinkAll is enabled. Fixes #3812.

This way we can remove the LINKALL define, which also means nobody can forget
to define it when building using LinkAll.

https://github.com/xamarin/xamarin-macios/issues/3812
2018-04-27 13:11:27 +02:00
Rolf Bjarne Kvinge 97230c28e1
Optimize calls to BlockLiteral.SetupBlock to inject the block signature. (#3391)
* [linker] Optimize calls to BlockLiteral.SetupBlock to inject the block signature.

Optimize calls to BlockLiteral.SetupBlock[Unsafe] to calculate the block
signature at build time, and inject it into the call site.

This makes block invocations 10-15x faster (I've added tests that asserts at
least an 8x increase).

It's also required in order to be able to remove the dynamic registrar code in
the future (since calculating the block signature at runtime requires the
dynamic registrar).

* [mtouch/mmp] Add support for reporting errors/warnings that point to the code line causing the error/warning.

Add support for reporting errors/warnings that point to the code line causing
the error/warning by adding ErrorHelper overloads that take the exact
instruction to report (previously we defaulted to the first line/instruction
in a method).

* [tests] Add support for asserting filename/linenumber in warning messages.

* Make all methods that manually create BlockLiterals optimizable.

* [tests] Create a BaseOptimizeGeneratedCodeTest test that's included in both XI's and XM's link all test.

* [tests] Add link all test (for both XI and XM) to test the BlockLiteral.SetupBlock optimization.

* [tests] Add mtouch/mmp tests for the BlockLiteral.SetupBlock optimization.

* [tests][linker] Make the base test class abstract, so tests in the base class aren't executed twice.

* [tests][linker] Don't execute linkall-only tests in linksdk.

The optimization tests only apply when the test assembly is linked, and that
only happens in linkall, so exclude those tests in linksdk.

* [tests][mmptest] Update test according to mmp changes.

Fixes these test failures:

    1) Failed : Xamarin.MMP.Tests.MMPTests.MM0132("inline-runtime-arch")
    The warning 'MM0132: Unknown optimization: 'inline-runtime-arch'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size.' was not found in the output:
    	Message #1 did not match:
    		actual:   'Unknown optimization: 'inline-runtime-arch'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size, blockliteral-setupblock.'
    		expected: 'Unknown optimization: 'inline-runtime-arch'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size.'
    	Message #2 did not match:
    		actual:   'Unknown optimization: 'inline-runtime-arch'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size, blockliteral-setupblock.'
    		expected: 'Unknown optimization: 'inline-runtime-arch'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size.'

    2) Failed : Xamarin.MMP.Tests.MMPTests.MM0132("foo")
    The warning 'MM0132: Unknown optimization: 'foo'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size.' was not found in the output:
    	Message #1 did not match:
    		actual:   'Unknown optimization: 'foo'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size, blockliteral-setupblock.'
    		expected: 'Unknown optimization: 'foo'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size.'
    	Message #2 did not match:
    		actual:   'Unknown optimization: 'foo'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size, blockliteral-setupblock.'
    		expected: 'Unknown optimization: 'foo'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size.'

* [tests][linker] Fix typo.

Fixes this test failure:

    1) SetupBlock_CustomDelegate (Linker.Shared.BaseOptimizeGeneratedCodeTest.SetupBlock_CustomDelegate)
         Counter
      Expected: 1
      But was:  2

* [registrar] Minor adjustment to error message to match previous (and better) behavior.

Fixes this test failure:

    1) Failed : Xamarin.Registrar.GenericType_WithInvalidParameterTypes
    The error 'MT4136: The registrar cannot marshal the parameter type 'System.Collections.Generic.List`1<U>' of the parameter 'arg' in the method 'Open`1.Bar(System.Collections.Generic.List`1<U>)'' was not found in the output:
    	Message #1 did not match:
    		actual:   'The registrar cannot marshal the parameter type 'System.Collections.Generic.List`1<Foundation.NSObject>' of the parameter 'arg' in the method 'Open`1.Bar(System.Collections.Generic.List`1<U>)''
    		expected: 'The registrar cannot marshal the parameter type 'System.Collections.Generic.List`1<U>' of the parameter 'arg' in the method 'Open`1.Bar(System.Collections.Generic.List`1<U>)''

* [docs] mmp shows MM errors/warnings.

* [docs] Improve according to reviews.

* [tests] Fix merge failure causing test duplication.
2018-02-06 07:08:15 +01:00
Rolf Bjarne Kvinge 6b5870d668
[tests] Move linker tests to match introspection directory layout. (#3365)
* [tests] Move linker tests to match introspection directory layout.

Move linker tests to match introspectio directory layout: tests/linker/ios and
tests/linker/mac instead of tests/linker-ios and tests/linker-mac.

This creates a logical place for shared linker files (tests/linker).

* [tests] Fix path to GuiUnit_NET_4_5.csproj in sln as well.

This is the path used to find referenced projects when building Classic.

Fixes this build problem:

    warning: Referenced project 'GuiUnit_NET_4_5' not found in the solution.
    /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/common/mac/MacTestMain.cs(11,7) : error CS0246: The type or namespace name `GuiUnit' could not be found. Are you missing an assembly reference?
    /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/common/mac/MacTestMain.cs(64,42) : error CS0246: The type or namespace name `IMainLoopIntegration' could not be found. Are you missing an assembly reference?
    /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/common/mac/MacTestMain.cs(75,34) : error CS0246: The type or namespace name `InvokerHelper' could not be found. Are you missing an assembly reference?
2018-02-05 15:09:04 +01:00