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

3289 Коммитов

Автор SHA1 Сообщение Дата
Manuel de la Pena 867dcfaa77
[Tests] Split groups so that they work on iOS 32b. (#7612)
After this commit we will have more application but they will be the
appropiate size so that they can be built with the linker for iOS 32b.
It is important to note that the following apps WILL CONTINUE to fail
since the dlls need to be splitted in mono:

* mscorlib tests
* Mono BCL tests group 5 - Which is monotouch_System.Core_xunit-test.dll
and is too large.
2019-12-17 17:09:28 -05:00
monojenkins aaafa2df6f [xharness] Don't try to parse log files that don't exist. (#7614)
Makes xharness throw fewer exceptions, which makes tracing output simpler to read.
2019-12-17 17:04:00 -05:00
monojenkins a6c714fa84 [xcode11.3] [monotouch-test] Simplify NetworkReachabilityTest.CtorIPAddressPair test. (#7613)
* [monotouch-test] Improve reachability test.

Tested on:

* All macOS versions we support (10.9 -> 10.15).
* tvOS device: 13.2
* iOS devices: 8.2, 9.3.5, 10.3.3, 11.4.1, 12.4.1, 13.3
* iOS simulators: 10.3, 11.0, 12.0, 13.2.
* tvOS simulators: 10.2, 13.2

* Yay Apple!

* Give up.

* Revert unneeded change.
2019-12-17 16:07:22 -05:00
Manuel de la Pena cfd8c7a20b
[Tests] Improve error when we have network issues in ImageCaptioningTest.GetCaption (#7591)
The error does give a description letting us know that the url was
invalid, that is, we could not reach it.

Fixes: https://github.com/xamarin/maccore/issues/2088
2019-12-16 22:07:22 -05:00
Manuel de la Pena 746d52ef51
[Tests] Ensure that if the TCP connection cannot be done, test are run. (#7605)
TouchUnit uses Console.Out as the writer when the TCP connection cannot
be performed. The BCL tests were not doing so and were crashing.

With this change, when ran locally, if the TCP connection is not done,
we will use Console.Out as TouchUnit and the file will be parsed by
xharness correctly.
2019-12-16 22:05:20 -05:00
Rolf Bjarne Kvinge c422869c4b
[msbuild] Update tests to NUnit 3.12. (#7597)
Updating the msbuild tasks to use netstandard2.0 requires us to bump NUnit to 3+.

This requires:

* A few code changes due to breaking API changes in NUnit.
* Changes in xharness and a makefile to cope with the new location for the
  NUnit console runner (I added a helper script to make things slightly
  easier).
2019-12-16 23:55:59 +01:00
Sebastien Pouliot 2c8cc9bd43
[test][monotouch-test] Fix crash on old iOS8 32bits devices (#7595)
```
20:11:28.9562500 2019-12-12 20:11:48.058 monotouchtest[873:239608] Xamarin.iOS: Received unhandled ObjectiveC exception: NSInvalidArgumentException *** -[AVCaptureMetadataOutput setMetadataObjectTypes:] - unsupported type found.  Use -availableMetadataObjectTypes.
20:11:29.0542980 2019-12-12 20:11:48.154 monotouchtest[873:239608]
20:11:29.0543360 Unhandled Exception:
20:11:29.0543440 0   libmonosgen-2.0.dylib               0x04d53c45 setup_stack_trace + 188
20:11:29.0543500 1   libmonosgen-2.0.dylib               0x04d51df9 mono_handle_exception_internal + 2120
20:11:29.0543560 2   libmonosgen-2.0.dylib               0x04d515ad mono_handle_exception + 50
20:11:29.0543620 3   libmonosgen-2.0.dylib               0x04d47de9 mono_arm_throw_exception + 132
20:11:29.0543690 4   libmscorlib.dll.dylib               0x01570648 throw_exception + 72
...
```

Fixes https://github.com/xamarin/maccore/issues/2091
2019-12-16 08:57:57 -05:00
monojenkins 380ad56e4d [introspection] Update according to changes that seem to have occurred in macOS 10.15.2. (#7592) 2019-12-13 10:22:16 -05:00
Rolf Bjarne Kvinge 9b30d7016a
[xharness] Don't try to parse log files that don't exist. (#7583)
Makes xharness throw fewer exceptions, which makes tracing output simpler to read.
2019-12-12 19:13:19 +01:00
Rolf Bjarne Kvinge a6d2ebddfd
[monotouch-test] Simplify NetworkReachabilityTest.CtorIPAddressPair test. (#7546)
* [monotouch-test] Improve reachability test.

Give up.

Different versions of OSes report different flags. Trying to
figure out which OS versions have which flags set turned out to
be a never-ending game of whack-a-mole, so just don't assert
that any specific flags are set.
2019-12-12 07:57:23 +01:00
Rolf Bjarne Kvinge 1ae28bf034
[introspection] Update according to changes that seem to have occurred in macOS 10.15.2. (#7567) 2019-12-12 07:28:23 +01:00
Manuel de la Pena 3f0985ecac
[Runtime] Move some of the changes back to int. (#7529)
Some of the fixes done for the warnings have breaking changes. Move back
to int and ensure that we do not have any compilation errors (we are
using -Werror).

Fixes: https://github.com/xamarin/xamarin-macios/issues/7509
2019-12-11 22:17:29 -05:00
Sebastien Pouliot ff2d5bb94f
[mtouch][mmp] Include satellite assemblies from nuget dependencies. Fix #7113 (#7548)
It's possible for a nuget to have dependencies that will bring satellite
assemblies into a project.

When doing so the satellite assemblies are copied to the right output
(e.g. `Debug`) directory, so they work fine at runtime. However it's
not 100% fine at build time, e.g. msbuild won't detected them as
satellite assemblies.

Something similar happens with `mtouch` (and `mmp`) since the satellite
assemblies won't be found inside a (culture-named) subdirectory from the
original assembly location. In our case this means the assemblies won't
be copied into the .app bundle (since we don't run from `Debug`) and
localization won't work properly.

The solution is to check for both the (culture-named) subdirectories
from the assembly location (like before) and, if nothing is found, also
try to locate them in the _build_ (like `Debug`) directory - so if
something else (nuget or custom build scripts) tried to outsmart the
build logic then we'll still bring those satellite assemblies in the
app bundle we produce.

https://github.com/xamarin/xamarin-macios/issues/7113
2019-12-10 09:23:31 -05:00
Rolf Bjarne Kvinge e19fd5ba00
[monotouch-test] Improve MessageHandlerTest.TestNSUrlSessionHandlerCookies. (#7542)
1. Instead of fetching the managed response's cookies twice, and then
   comparing them to themselves, fetch the managed response's cookies once and
   then the native response's cookies once, and compare that. This way the
   test does what it's actually supposed to do!
2. Don't pass if we fail to get the managed response's cookies.
3. Improve assertions to verify the actual cookie content as well.
4. Improve diagnostics if an exception was thrown by checking for the
   exception first instead of failing due to something else being different
   (since the underlying cause of the difference is the exception, that's what
   will have the most information about the failure).
5. Use httpbin.org instead of microsoft.com, since microsoft.com does UA
   sniffing and returns different results between the http handlers :/
2019-12-04 23:26:31 +01:00
Jo Shields 5d4ada34c7 Bump to mono:2019-10 (#7192)
## Miscellaneous fixes

* Fixed
`/Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/builds/mono-ios-sdk-destdir/ios-sources/external/linker/src/linker/Linker.Steps/OutputStep.cs(110,15): error CS0246: The type or namespace name ‘OutputException’ could not be found (are you missing a using directive or an assembly reference?) [/Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/tools/mmp/mmp.csproj]`
* Changed the name of the method that is used from linker. Because of this commit 6be26771b9
* Added `OutputException.cs` file on `mtouch.csproj`.
* Removing enter_gc_safe and exit_gc_safe because now it's already gc_safe in this part of code, after a mono change.
* Added known exceptions to LLVM exception list.
* Needs `ifdef` because of this https://github.com/mono/mono/pull/17260.
* Bump MIN_MONO_VERSION to 6.8.0.41 and point MIN_MONO_URL to the PR.
* Add ENABLE_IOS=1 and ENABLE_MAC=1.
* Added switch to disable packaged mono build
* [Tests] Ignore tests that fail on 32b.
    Ignore the test on 32b, and filled issue: https://github.com/mono/mono/issues/17752
* [Tests] Ignore a couple of tests causing OOM.
    Hopefully fixes https://github.com/xamarin/maccore/issues/1659 for good.
* Ignore `MM0135` test on Catalina+ because it needs Xcode 9.4.
* [monotouch-test] Add null checks for teardown when test didn't run because of a too early OS version.
* [CFNetwork]: Http 2.0 requires OS X 10.11 or later.
    Check whether `_HTTPVersion2_0` is available and fallback to HTTP 1.1 otherwise.

## Bring HttpClient from CoreFX

* #7346 
* This bumps Mono to use https://github.com/mono/mono/pull/17645 (which is the 2019-10 backport
of https://github.com/mono/mono/pull/17628).
* The big user-visible change is in regards to certificate validation, everything below are just
some minor adjustments to tests.

### SocketsHttpHandler

CoreFX uses a completely new `HttpClientHandler` implementation called `SocketsHttpHandler`,
which you can find at https://github.com/dotnet/corefx/tree/release/3.0/src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler.

Since this is not based on the web stack anymore, it does not use any of the related APIs such
as `ServicePointManager` or `WebException`.

### Certificate Validation Changes

There is a new API called `HttpClientHandler.ServerCertificateCustomValidationCallback`.
- https://docs.microsoft.com/en-us/dotnet/api/system.net.http.httpclienthandler.servercertificatecustomvalidationcallback?view=netframework-4.8
- c1778515a3/src/System.Net.Http/src/System/Net/Http/HttpClientHandler.Unix.cs (L154)
- c1778515a3/src/System.Net.Http/src/System/Net/Http/HttpClientHandler.Windows.cs (L383)

The `ServicePointManager.ServerCertificateValidationCallback` is no longer invoked and on
certificate validation failure, `AuthenticationException` (from `System.Security.Authentication`)
is thrown instead of `WebException`.

At the moment, the `NSUrlSessionHandler` still uses it's own validation callback and also still
throws `WebException` on failure; we should probably look into making this consistent with the
other handlers.

### Minor adjustments related to internal Mono APIs

* `HttpContent.SerializeToStreamAsync()` is now `protected` (changed from `protected internal`).
  - src/Foundation/NSUrlSessionHandler.cs: changed overload accordingly.
  - src/System.Net.Http/CFContentStream.cs: likewise.

* `HttpHeaders.GetKnownHeaderKind()` is an internal Mono API.
   There is a new internal API called `System.Net.Http.PlatformHelper.IsContentHeader(key)`
   which exists in both the old as well as the new implementation.
   The correct way of doing it with the CoreFX handler is
   `HeaderDescriptor.TryGet (key, out var descriptor) && descriptor.HeaderType == HttpHeaderType.Content`

### Minor adjustments to tests.

* `HttpClientHandler.MaxRequestContentBufferSize` is now longer supported, you can set it to
  any non-negative value, the getter will always return 0.
  See c1778515a3/src/System.Net.Http/src/System/Net/Http/HttpClientHandler.Core.cs (L18).
  - tests/linker/ios/link sdk/HttpClientHandlerTest.cs: removed assertion from test.

* `HttpMessageInvoker.handler` is a `protected private` field - in the CoreFX handler, it is
  called `_handler` and `private`.  This is accessed via reflection by some of the tests, which are
  now using the new name.
  - tests/mmptest/src/MMPTest.cs: here
  - tests/mtouch/MTouch.cs: here

* tests/monotouch-test/System.Net.Http/MessageHandlers.cs:
  Adjust `RejectSslCertificatesServicePointManager` to reflect the certificate validation
  changes described above.
  - FIXME: There was an `Assert.Ignore()` related to `NSUrlSessionHandler` and macOS 10.10;
    I removed that to reenable the test because the description linked to an old issue in
    the private repo that was referenced by several "Merged" PR's, so it looked to me that
    this might have already been fixed - and I also didn't see why it would fail there.
2019-12-04 15:10:32 -05:00
Manuel de la Pena 8abcd9c60c
[Network] Add missing BindingImplAttr. (#7530)
Fixes: https://github.com/xamarin/xamarin-macios/issues/7513
2019-12-04 11:41:29 -05:00
Vincent Dondain 612a5aa158
[xharness] Fix 32 bit device tests selection (#7540)
**Problem**

32 bit tests could only be executed with 64 bit tests. E.g: `run-ios-32-tests` didn't work on its own, only `run-ios-tests,run-ios-32-tests` worked

**Solution**

- Change the logic so that 32 bit tests are only looking for `IncludeiOS32` and 64 bit tests only `IncludeiOS64`
- To keep `run-ios-tests` and `skip-ios-tests` working, hack `SetEnabled` so `IncludeiOS` also sets `IncludeiOS32` and `IncludeiOS64`.
  Otherwise the way the code is currently organised we'd have to use `skip-ios-32-tests` and `skip-ios-64-tests`.
2019-12-04 11:35:09 -05:00
monojenkins 74a94c35d1 [monotouch-test] Make NetworkReachabilityTest.CtorIPAddressPair a bit more permissive. Fixes xamarin/maccore#2047. (#7521)
Try to fix https://github.com/xamarin/maccore/issues/2047 by making the test
accept NetworkReachabilityFlags.Reachable for the loopback address on device.

Fixes https://github.com/xamarin/maccore/issues/2047.
2019-12-02 21:54:33 +01:00
Rolf Bjarne Kvinge e808ad48aa
[xharness] Make sure to always stop log and system capture. (#7506)
This will hopefully stop the runaway mlaunch processes we've seen on the bots.

Ref: https://github.com/xamarin/maccore/issues/1965.
2019-12-02 21:54:07 +01:00
monojenkins 44d411b8de [xharness] Add a timeout to the periodic command. (#7504)
This will hopefully prevent the periodic command from keeping xharness alive longer than it should.
2019-12-02 21:48:22 +01:00
Rolf Bjarne Kvinge bc6735374b
[monotouch-test] Make NetworkReachabilityTest.CtorIPAddressPair a bit more permissive. Fixes xamarin/maccore#2047. (#7516)
Try to fix https://github.com/xamarin/maccore/issues/2047 by making the test
accept NetworkReachabilityFlags.Reachable for the loopback address on device.

Fixes https://github.com/xamarin/maccore/issues/2047.
2019-12-02 07:58:57 +01:00
Sebastien Pouliot 845e7574ae
[linker] Fix "Linked Away" exceptions with Thread.CurrentPrincipal. Fix #7321 (#7510)
Keep 'CallContextSecurityData' around since it's quite small (and the
normal linker logic will be able to deal with it if unused) and allows
the use of `Thread.CurrentPrincipal`

Also add unit test.

Fix https://github.com/xamarin/xamarin-macios/issues/7321
2019-11-28 14:17:00 -05:00
Sebastien Pouliot 4ffbef7cac
[avfoundation] Use a smart enum for AVMetadataObjectType (#7497)
and drop the manual, error prone, conversion code.

The fact that this is also used as a `[Flag]` enum does not mean smart
enum could not be used [1]. The flag code only needed to be updated to
use the smart enum generated code.

[1] https://github.com/xamarin/xamarin-macios/issues/7317

Added unit tests.
2019-11-28 10:40:12 -05:00
Rolf Bjarne Kvinge 0f8bb77320
[xharness] Make sure to always stop log and system capture. (#7499)
This will hopefully stop the runaway mlaunch processes we've seen on the bots.

Ref: https://github.com/xamarin/maccore/issues/1965.
2019-11-27 11:44:26 -05:00
Pramit Mallick faf1275c74
[Foundation] Add bindings for NSBackgroundActivityScheduler (#7496)
* Added NSBackgroundActivityScheduler binding

* DisableDefaultCtor + xtro
2019-11-27 09:55:54 -05:00
Rolf Bjarne Kvinge e86a76e6c7
[xharness] Add a timeout to the periodic command. (#7500)
This will hopefully prevent the periodic command from keeping xharness alive longer than it should.
2019-11-27 09:09:44 -05:00
Marius Ungureanu 38a3c4ed87 [CFNetwork] Fix ownership rules of CFHTTPAuthentication (#6088)
`Create` methods give ownership of the object, so in this case, owns=true. Prevents leak of CFHTTPAuthentication

Co-Authored-By: Rolf Bjarne Kvinge <rolf@xamarin.com>
Co-Authored-By: Manuel de la Pena <mandel@microsoft.com>
2019-11-26 16:28:41 -05:00
monojenkins bcf3899893 [generator] If forcing a managed type, we must do so even if there's another managed instance of an incompatible type. Fixes #7441. (#7460)
If forcing a managed type for a particular native handle, we must ensure we're
always successful.

This means creating another managed instance even if there already is an
existing instance for the native handle. This is not optimal, but the
alternative is worse: some functionality can be completely broken otherwise
(such as NSSavePanel⁄NSOpenPanel may stop working).

If creating multiple managed instances for the same native handle ends up
being too problematic, we'll probably have to add full support for this
scenario (see #7442).

Fixes https://github.com/xamarin/xamarin-macios/issues/7441.
2019-11-26 13:38:57 -05:00
monojenkins fd7a5360a5 [xcode11.3] [linker] Do not mark NSObject subclasses from Xamarin.Forms.Platform.iOS.dll assembly (#7483)
Turn older #7165 prototype into an experimental feature. It can be
enabled by adding `--optimize=experimental-xforms-product-type` to the
**Additional mtouch arguments** of the project.

ref: https://github.com/xamarin/xamarin-macios/pull/7165
2019-11-26 08:32:02 -05:00
Manuel de la Pena cb815ecd39
[Runtime] Update cflags and fix warnings accordingly. (#7478)
Update flags:

* Add -Werror so that warnings are errors.
* Move to -Wconversion that adds:
  * -Wbitfield-enum-conversion
  * -Wbool-conversion
  * -Wconstant-conversion
  * -Wenum-conversion
  * -Wfloat-conversion
  * -Wimplicit-float-conversion
  * -Wimplicit-int-conversion
  * -Wint-conversion
  * -Wliteral-conversion
  * -Wnon-literal-null-conversion
  * -Wnull-conversion
  * -Wobjc-literal-conversion
  * -Wshorten-64-to-32
  * -Wsign-conversion
  * -Wstring-conversion
Last work related to: https://github.com/xamarin/xamarin-macios/pull/7405
2019-11-25 16:00:24 -05: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 dadf69e97e
[Networking] Add missing Mac OS X APIs. (#7426)
Add missing APIs and complete the bindings for Xcode 11.
2019-11-22 15:21:39 -05:00
monojenkins 88dc8642f0 [xcode11.3] [Tests] Update tests.sln to include all the BCL tests. (#7482)
Update the UUIDs of the projects to ensure that they are all present
in the sln for developers to use.

Fixes: https://github.com/xamarin/xamarin-macios/issues/7475
FIxes: https://github.com/xamarin/xamarin-macios/issues/7476
2019-11-22 10:34:30 -05:00
Sebastien Pouliot 58d325746a
[linker] Do not mark NSObject subclasses from Xamarin.Forms.Platform.iOS.dll assembly (#7473)
Turn older #7165 prototype into an experimental feature. It can be
enabled by adding `--optimize=experimental-xforms-product-type` to the
**Additional mtouch arguments** of the project.

ref: https://github.com/xamarin/xamarin-macios/pull/7165
2019-11-22 15:38:46 +01:00
Manuel de la Pena 2de737ef98
[Tests] Update tests.sln to include all the BCL tests. (#7479)
Update the UUIDs of the projects to ensure that they are all present
in the sln for developers to use.

Fixes: https://github.com/xamarin/xamarin-macios/issues/7475
Fixes: https://github.com/xamarin/xamarin-macios/issues/7476
2019-11-21 14:51:31 -05:00
Rolf Bjarne Kvinge f7212e7dc5
[introspection] UIMenuController's default ctor stopped working in iOS 13.3. Fixes xamarin/maccore#2067. (#7458)
* [introspection] UIMenuController's default ctor stopped working in iOS 13.3. Fixes xamarin/maccore#2067.

Fixes https://github.com/xamarin/maccore/issues/2067.

* [tests] Add support for comparing 3-part system version strings to watchOS.
2019-11-20 13:45:01 -05:00
Marius Ungureanu 5913bd1807 Add IComparable<T> to NSString (#7468)
Fixes #5522
2019-11-20 07:45:13 -05:00
Rolf Bjarne Kvinge 806404fa51
Keep track of SDK versions and OS versions separately. Fixes xamarin/maccore#2066. (#7454)
The latest SDK version and the latest OS version does not necessarily have to
match (for instance the iOS 13.2 SDK can support both iOS 13.2 and iOS 13.3),
so keep track of them separately.

Also use the latest OS version to determine which simulator to run, instead of
the latest SDK version (Xcode 11.3 ships with the iOS 13.2 SDK but only has an
iOS 13.3 simulator, not an iOS 13.2 simulator).

Fixes https://github.com/xamarin/maccore/issues/2066.
2019-11-15 17:21:10 +01:00
Pramit Mallick 0e394f7e80
CoreFoundation update - adding to ignore (#7448) 2019-11-15 21:16:40 +05:30
Rolf Bjarne Kvinge 7caf1fbb04
[generator] If forcing a managed type, we must do so even if there's another managed instance of an incompatible type. Fixes #7441. (#7445)
If forcing a managed type for a particular native handle, we must ensure we're
always successful.

This means creating another managed instance even if there already is an
existing instance for the native handle. This is not optimal, but the
alternative is worse: some functionality can be completely broken otherwise
(such as NSSavePanel⁄NSOpenPanel may stop working).

If creating multiple managed instances for the same native handle ends up
being too problematic, we'll probably have to add full support for this
scenario (see #7442).

Fixes https://github.com/xamarin/xamarin-macios/issues/7441.
2019-11-15 08:16:06 +01:00
Manuel de la Pena d83e9687a6
[Tests] Centralized the endpoints for the different network tests. (#7418)
Use a single point where the different enpoints can be found so that
if they need to be updated (server issues or other) it is a simple
change that will affect all tests in monotouch-tests
2019-11-14 05:45:33 -05:00
Manuel de la Pena d99e3b24f9 [CoreFoundation] Add Clone method for CFArray. (#7403)
When working on https://github.com/xamarin/maccore/issues/940 we noticed
that clone the array would be a better approach.

The CFArrayCreateCopy add some nice things:

* The pointer values from theArray are copied into the new array.
* The values are also retained by the new array.
* The count of the new array is the same as theArray
* The new array uses the same callbacks as theArray. [IMPORTANT]

Whith this in, we can have a better fix for https://github.com/xamarin/maccore/issues/940
2019-11-13 17:28:46 -05:00
Manuel de la Pena f613021a3f
[CoreFoundation] Add Clone method for CFArray. (#7403)
When working on https://github.com/xamarin/maccore/issues/940 we noticed
that clone the array would be a better approach.

The CFArrayCreateCopy add some nice things:

* The pointer values from theArray are copied into the new array.
* The values are also retained by the new array.
* The count of the new array is the same as theArray
* The new array uses the same callbacks as theArray. [IMPORTANT]

Whith this in, we can have a better fix for https://github.com/xamarin/maccore/issues/940
2019-11-13 06:06:23 -05:00
Manuel de la Pena 8a63932245
[Tests] GetGlobalQueue_QualityOfService is only supported on Mac OS X 10.10 and later (#7419)
Ensure that the test does not fail in earlier versions of the os.

Fixes: https://github.com/xamarin/maccore/issues/2062
2019-11-13 06:03:23 -05:00
monojenkins 83fd5162f2 [xcode11.3] [Tests] If we have server errors. Mark test as inconclusive. (#7415)
If we are getting errors (500,401..) do not mark a link all test as a
failure, but as inconclusive.

Fixes: https://github.com/xamarin/maccore/issues/2056
2019-11-12 15:08:18 -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
michizhou e9b18d4c2f [CoreFoundation] [tests] Add new DispatchQueue overloaded method (#7343)
* [CoreFoundation] [tests] Add new DispatchQueue overloaded method with unit tests. Fixes #6783

* [CoreFoundation] [tests] Add new variant method to DispatchQueue

* [CoreFoundation] [tests] Remove nonexistent DispatchQueue methods

* [CoreFoundation] [tests] Restore existing methods and tests
2019-11-12 14:56:45 +01:00
Rolf Bjarne Kvinge e23362854e
[tests] Add make target to manually launch a device test run for the current commit. (#7282)
* [tests] Add make target to manually launch a device test run for the current commit.

* Upload a manifest that can be found using only the hash, and use it to find the packages.
2019-11-07 22:41:24 +01:00
monojenkins 8536ba6975 [Tests] Fix introspection failing due to a typo. (#7377)
Fixes: https://github.com/xamarin/maccore/issues/2052
2019-11-06 15:21:24 -05:00
monojenkins 1926eaecee [Tests] Fix introspection failing due to a typo. (#7376)
Fixes: https://github.com/xamarin/maccore/issues/2052
2019-11-06 14:52:13 -05:00
Manuel de la Pena 746fd47638
[Networking] Add the NWFramer implementation. (#7338)
Uncommented the sources and update some mistakes after following the
sample provided by Apple. Initially tests were going to be added but
they resulted to be to flacky and would make the CI red too often to be
adding value.

Porting the sample will ensure that it works are the bindings are not
broken.
2019-11-05 15:32:17 -05:00
Vincent Dondain a558d84457 Merge branch 'xcode11.2' into master-merge-xcode11.2 2019-11-05 15:25:49 -05:00
Vincent Dondain ec3c01d131 Merge branch 'xcode11.2' into d16-4-xcode11.2-merge 2019-11-01 17:11:44 -04:00
Vincent Dondain e3c2b406de Bump to Xcode 11.2 final (#7347)
* Bump to Xcode 11.2 final

* Fix xtro
2019-10-31 23:25:04 -04:00
Whitney Schmidt d90223a316
[MapKit] Xcode 11.2 update (#7331)
* mapkit 11.2

* make methods public

* add async attribute

* style fixes, using pattern
2019-10-31 11:11:41 -04:00
Pramit Mallick c4f28a1888
[MPSCore] Xcode11.1 GM Binding (#7330) 2019-10-31 10:02:53 -04:00
Manuel de la Pena 957572720e
[Tests] Fix some network tests that were leaving the connection in a bad (#7337)
state.

Some of the tests were creating connections when not needed, this
'apparetly' was leaving the internal state of the Networking API in a
bad state in which it would throw a SIGSEGV and will make the connection
of other tests fail. In this case, the Tls tests that use the Network
API.

Cleaning the tests and removing those badly managed connections ensured
that the SIGSEGV would not be thrown and got all the other tests to
work.

This is a blackbox, test now passes without problems.

Fixes: https://github.com/xamarin/maccore/issues/2048
2019-10-30 15:07:28 -04:00
Pramit Mallick 3cf957442e [Foundation] Add 'targetContentIdentifier' to macOS and watchOS 2019-10-30 14:53:55 -04:00
Manuel de la Pena 4a9c10a85b
[Introspection] Add Mac OS X 15.15.1 on availability tests. (#7328) 2019-10-30 01:47:41 -04:00
Whitney Schmidt b71fc30f49
CoreMedia 11.2 updates (#7329) 2019-10-29 17:05:23 -04:00
Alexander Köplinger e8409f2834 [tests] Remove confusing values for old Xcode versions (#5806)
Xcode 5 to 7 are obsolete, we don't need those values in the test config anymore.
2019-10-29 12:02:22 -04:00
Whitney Schmidt 54572a9f7b
add avmetadata updates (#7316) 2019-10-29 11:42:55 -04:00
Manuel de la Pena e4268e83f2
[Tests] Ignore BCL tests on 32b that fail due to threads failing to be created. (#7318)
Related mono issue: https://github.com/mono/mono/issues/17588
2019-10-29 08:20:23 -04:00
Pramit Mallick f35569a715 [Appkit] Bindings part 4 (#7295)
Complete the AppKit bindings up to Xcode 11.2
2019-10-28 15:38:34 -04:00
Manuel de la Pena 610cefaf1e
[Tests] Fix the Network tests. (#7293)
* [Tests] Fix the Network tests.

The pattern used to Cancel then Dispose the connection is wrong and
ended up crashing the tests sometimes. It is a race condition and is
very rare, but makes the tests flaky. The changes ensures that we
Dispose the connection, which internally closes it.

Tests have been added for the NWConnection Close calls.

Also cleaned some on the CWL that were not needed.
2019-10-28 14:50:44 -04:00
Rolf Bjarne Kvinge 3d1790df41 [tests] Fix Xamarin.Tests.Misc.PublicSymbols after recent changes in our native code. (#7312)
Fixes this test:

     1) Failed : Xamarin.Tests.Misc.PublicSymbols(watchOS)
       Failed libraries
       Expected: <empty>
       But was:  "/Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/SDKs/Xamarin.WatchOS.sdk/usr/lib/libxamarin-debug.a:
     	___os_log_helper_16_2_1_4_34
     "
       at Xamarin.Tests.Misc.PublicSymbols (Xamarin.Tests.Profile profile) [0x00000] in <1fca7937273a476381dfa5d9399511ee>:0
2019-10-28 10:40:53 -04:00
Manuel de la Pena 5670872dc6
[Generator] Allow 1 level nester classes. Fixes: #7304 (#7309)
We have only encountered a case in which we had to add a nested
class/enum as the return type of a property. This fix ensures that we
can work with 1 level nested classes. A more general situation with
nested/nested/nested/.. classes is not taken into account because:

1. Would complicate too much the code.
2. Is fixing problems we do not have AFAIK.

So I'm keeping the fix simple, as I said, we have never faced anything
deeper than one level.
2019-10-25 20:06:00 -04:00
Rolf Bjarne Kvinge 34f02ff0a0
Bump mono to a hash with archives and use them. (#7299)
* Bump mono to a hash with archives and use them.

New commits in mono/mono:

* mono/mono@6af4ae7635 [2019-06][ci] Add Xcode 11.2beta2 for XI/XM Mono SDK builds

Diff: 476d72b9e3..6af4ae7635

* Bump mono to get min iOS version fix.

New commits in mono/mono:

* mono/mono@3775d5ac0a [sdks] Bump min iOS version to 7.0.

Diff: 6af4ae7635..3775d5ac0a

* [xharness] Bump mtouch tests timeout to 3h, we have a couple of new PR bots which are old and slow.

The new PR bots are late 2012 mac minis, so quite slow.
2019-10-25 22:13:20 +02:00
William Kent 9be58e4b9c os_log(3) support (#7141)
* Add xamarin_os_log function

See the comment in the function for an explanation
of why this wrapper function is required.

* Add Darwin/OSLog.cs

* Add xamarin_os_log to header

This ensures that the symbol will not be subject
to C++ name mangling, therefore breaking mmp.
With this change applied, OSLog works as expected.

* Resolve stylistic PR feedback

* Move OSLog into CoreFoundation namespace

This is where the NativeObject class lives, and it
also feels like a better fit for a low-level API
that is available on non-Mac platforms than the
macOS-only Darwin namespace.
2019-10-24 17:46:03 -04:00
Manuel de la Pena e1c12bba11
[Network] Add NWFramerMessage implementation. (#7256)
Add a missing object for the type.

Co-Authored-By: Rolf Bjarne Kvinge <rolf@xamarin.com>
2019-10-24 10:40:54 -04:00
Pramit Mallick a95fe82a68 [NetworkExtension] Bindings for xcode11.2 - Added missing selector 'identifier' 2019-10-23 17:33:30 -04:00
Rolf Bjarne Kvinge 4d8ec5d531
[Network] Fix NWTxtRecord.Apply. Fixes xamarin/maccore#2036. (#7281)
The block/delegate passed to NWTxtRecord.Apply is supposed to return a bool.
Not returning anything ends up with random behavior, which causes a test
failure on Catalina:

   3) TestApply (MonoTouchFixtures.Network.NWTxtRecordTest.TestApply)
        keycount
     Expected: 4
     But was:  1

     at MonoTouchFixtures.Network.NWTxtRecordTest.TestApply () [0x000a3] in /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/monotouch-test/Network/NWTxtRecordTest.cs:134
     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 /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/external/mono/mcs/class/corlib/System.Reflection/RuntimeMethodInfo.cs:395

I've fixed the existing API to return 'true' always in the block callback, to
get consistent behavior, and in addition I've added a new overload that takes
a delegate that returns a bool, which allows the consumer of the API to decide
what to return.

Fixes https://github.com/xamarin/maccore/issues/2036.
2019-10-23 23:25:27 +02:00
Waleed Chaudhry bad61b8f5e
[StoreKit] Add StoreKit bindings for xcode11.2b2 (#7294) 2019-10-23 16:29:35 -04:00
Manuel de la Pena e537e52386
[Tests] Allow to ignore the CMattachment tests in certain namespaces. (#7286)
There are a number of namespaces that do not support the API and can be
completly skipped. Also some of the classes in those namspaces are
expensive to create and the test is not providing any useful
information.

Fixes: https://github.com/xamarin/maccore/issues/2038
2019-10-23 16:03:02 -04:00
Waleed Chaudhry c52a59358f
[UIKit] Add UIKit bindings for xcode11.2b2 (#7290) 2019-10-23 15:12:19 -04:00
Rolf Bjarne Kvinge 7df9ddd973
[xharness] Fix a process argument typo. (#7284) 2019-10-23 19:05:54 +02:00
Pramit Mallick fbf33357ab
[Appkit] Bindings - part 3 (#7261)
* added NSCollectionLayoutSupplementaryItem + NSCollectionLayoutItem

* added NSCollectionLayoutBoundarySupplementaryItem + NSCollectionLayoutDecorationItem

* added NSCollectionLayoutGroupCustomItem + NSCollectionViewCompositionalLayoutConfiguration

* added NSColorSampler + NSSwitch

* added NSCollectionLayoutGroup

* merge conflict resolve in todo

* merge

* merge

* merge

* added NSCollectionViewCompositionalLayout

* added NSStepperTouchBarItem

* removed DesignatedInitializer and added cases to ApiCtorInitTest

* ready for PR

* addressed reviews

* added [DisableDefaultCtor]
2019-10-23 10:15:33 -04:00
Manuel de la Pena 20df742564
[Network] Cleanup the NWProtocolMetadata. (#7270)
Co-Authored-By: Rolf Bjarne Kvinge <rolf@xamarin.com>
2019-10-22 23:49:51 +02:00
Rolf Bjarne Kvinge 38c59c9077
[Photos] Update to Xcode 11.2 beta 2. (#7274)
* [Photos] Update to Xcode 11.2 beta 2.

Ref: https://github.com/xamarin/maccore/issues/1797

* Fix xtro.
2019-10-22 22:31:57 +02:00
monojenkins 4f1beb3c8c [xcode11.2] [tests] Fix tests on Catalina. (#7263)
* [tests] Remove 32-bit slice from macOS test libraries. Fixes xamarin/maccore#2031.

The 32-bit slice is causing a build failure on the bots:

    Task "Exec" (TaskId:35)
      Task Parameter:Command=make bin/SimpleClassDylib.dylib bin/SimpleClassStatic.a bin/Mobile-static/MobileBinding.dll (TaskId:35)
      Task Parameter:WorkingDirectory=/Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/mmptest//../mac-binding-project/ (TaskId:35)
      make bin/SimpleClassDylib.dylib bin/SimpleClassStatic.a bin/Mobile-static/MobileBinding.dll (TaskId:35)
      In file included from ../common/mac/SimpleClass.m:1: (TaskId:35)
      In file included from ../common/mac/SimpleClass.h:1: (TaskId:35)
      In file included from /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13: (TaskId:35)
      In file included from /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:27: (TaskId:35)
      In file included from /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSCollectionView.h:9: (TaskId:35)
    /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSViewController.h(247,39): error GF2D19E48: unknown type name 'NSExtensionContext'; did you mean 'NSAnimationContext'? [/Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/xharness/tmp-test-dir/mmptest/mmptest.csproj]
      @property (nullable, readonly,retain) NSExtensionContext *extensionContext API_AVAILABLE(macos(10.10)); (TaskId:35)
                                            ^ (TaskId:35)
      /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSAnimationContext.h:18:12: note: 'NSAnimationContext' declared here (TaskId:35)
      @interface NSAnimationContext : NSObject (TaskId:35)
                 ^ (TaskId:35)
      In file included from ../common/mac/SimpleClass.m:1: (TaskId:35)
      In file included from ../common/mac/SimpleClass.h:1: (TaskId:35)
      In file included from /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13: (TaskId:35)
      In file included from /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:99: (TaskId:35)
      In file included from /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSSharingServicePickerTouchBarItem.h:9: (TaskId:35)
    /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSSharingService.h(181,119): error GC04982C4: expected a type [/Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/xharness/tmp-test-dir/mmptest/mmptest.csproj]
      - (NSCloudKitSharingServiceOptions)optionsForSharingService:(NSSharingService *)cloudKitSharingService shareProvider:(NSItemProvider *)provider; (TaskId:35)
                                                                                                                            ^ (TaskId:35)
    /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSSharingService.h(196,12): error G93352991: cannot find interface declaration for 'NSItemProvider' [/Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/xharness/tmp-test-dir/mmptest/mmptest.csproj]
      @interface NSItemProvider (NSCloudKitSharing) (TaskId:35)
                 ^ (TaskId:35)
      In file included from ../common/mac/SimpleClass.m:1: (TaskId:35)
      In file included from ../common/mac/SimpleClass.h:1: (TaskId:35)
      In file included from /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13: (TaskId:35)
      In file included from /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:250: (TaskId:35)
    /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSItemProvider.h(16,12): error G93352991: cannot find interface declaration for 'NSItemProvider' [/Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/xharness/tmp-test-dir/mmptest/mmptest.csproj]
      @interface NSItemProvider (NSItemSourceInfo) (TaskId:35)
                 ^ (TaskId:35)
      4 errors generated. (TaskId:35)
      make[1]: *** [bin/SimpleClass.i386.a] Error 1 (TaskId:35)

and since we don't need the 32-bit slice anymore, just remove it.

Fixes https://github.com/xamarin/maccore/issues/2031.

* [monotouch-test] Percent-escape some local file paths. Fixes xamarin/maccore#2032.

Fixes this xammac test failure when the csproj has paths in its path:

    1) GetCaption (MonoTouchFixtures.MediaAccessibility.ImageCaptioningTest.GetCaption)
       System.Exception : Could not initialize an instance of the type 'Foundation.NSUrl': the native 'initWithString:' method returned nil.
    It is possible to ignore this condition by setting ObjCRuntime.Class.ThrowOnInitFailure to false.
      at Foundation.NSObject.InitializeHandle (System.IntPtr handle, System.String initSelector) [0x000ab] in <c93a0a20c5e340cb9a858d96ecca3415>:0
      at Foundation.NSUrl..ctor (System.String urlString) [0x00044] in <c93a0a20c5e340cb9a858d96ecca3415>:0
      at MonoTouchFixtures.MediaAccessibility.ImageCaptioningTest.GetCaption () [0x00076] in <7a733573c3684923854270073138d4be>:0
      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 <9c0bd541400747ef85267f70e32bd8e4>:0

Fixes https://github.com/xamarin/maccore/issues/2032.

* [tests] Exclude MPS tests in the simulator on macOS 10.15+. Fixes xamarin/maccore#2030.

The simulator crashes when the app tests if MPS is supported...

Fixes https://github.com/xamarin/maccore/issues/2030.

* [tests] Exclude MPS tests in the simulator on macOS 10.15+. Fixes xamarin/maccore#2030.

The simulator crashes when the app tests if MPS is supported...

Fixes https://github.com/xamarin/maccore/issues/2030.

* Fix whitespace.
2019-10-22 22:30:35 +02:00
Rolf Bjarne Kvinge 56328b8866
Fix a few introspection issues on Catalina. (#7212) (#7243)
* [SceneKit] Adjust deprecation message.

Fixes this introspection failure:

    [FAIL] [Rule 4] Don't use availability keywords in attribute's message: "OpenGL API deprecated, please use Metal instead." - Type: SCNLayer
    [FAIL] [Rule 4] Don't use availability keywords in attribute's message: "OpenGL API deprecated, please use Metal instead." - Member name: get_OpenGLContext, Type: SCNView
    [FAIL] [Rule 4] Don't use availability keywords in attribute's message: "OpenGL API deprecated, please use Metal instead." - Member name: set_OpenGLContext, Type: SCNView
    [FAIL] [Rule 4] Don't use availability keywords in attribute's message: "OpenGL API deprecated, please use Metal instead." - Member name: get_PixelFormat, Type: SCNView
    [FAIL] [Rule 4] Don't use availability keywords in attribute's message: "OpenGL API deprecated, please use Metal instead." - Member name: set_PixelFormat, Type: SCNView

* [AppKit] Adjust deprecation messages.

* [tests] Fix introspection and xammac tests on Catalina. (#7200)

* [tests] Adjust NaturalLanguage.EmbeddingTest to cope with non-existent embeddings. Fixes xamarin/maccore#2011.

Fixes https://github.com/xamarin/maccore/issues/2011.

* [tests] Fix typo test on macOS 10.15. Fixes #7116.

Fixes https://github.com/xamarin/xamarin-macios/issues/7116.

* [introspection] Ignore MTLCounterSampleBufferDescriptor's selectors.

They're implemented using a different/internal type:

    $ nm /System/Library/Frameworks/Metal.framework/Metal | grep MTLCounterSampleBuffer
    00000000000458ab t +[MTLCounterSampleBufferDescriptor allocWithZone:]
    0000000000045897 t +[MTLCounterSampleBufferDescriptor alloc]
    000000000004591e t -[MTLCounterSampleBufferDescriptor copyWithZone:]
    000000000004598e t -[MTLCounterSampleBufferDescriptorInternal copyWithZone:]
    0000000000045c0f t -[MTLCounterSampleBufferDescriptorInternal counterSet]
    0000000000045936 t -[MTLCounterSampleBufferDescriptorInternal dealloc]
    0000000000045b65 t -[MTLCounterSampleBufferDescriptorInternal hash]
    0000000000045a31 t -[MTLCounterSampleBufferDescriptorInternal isEqual:]
    0000000000045c58 t -[MTLCounterSampleBufferDescriptorInternal label]
    0000000000045c7f t -[MTLCounterSampleBufferDescriptorInternal sampleCount]
    0000000000045c25 t -[MTLCounterSampleBufferDescriptorInternal setCounterSet:]
    0000000000045c6e t -[MTLCounterSampleBufferDescriptorInternal setLabel:]
    0000000000045c90 t -[MTLCounterSampleBufferDescriptorInternal setSampleCount:]
    0000000000045c47 t -[MTLCounterSampleBufferDescriptorInternal setStorageMode:]
    0000000000045c36 t -[MTLCounterSampleBufferDescriptorInternal storageMode]
    000000000010b0b8 S _OBJC_CLASS_$_MTLCounterSampleBufferDescriptor
    000000000010b0e0 S _OBJC_CLASS_$_MTLCounterSampleBufferDescriptorInternal
    0000000000107070 S _OBJC_IVAR_$_MTLCounterSampleBufferDescriptorInternal._counterSet
    0000000000107078 S _OBJC_IVAR_$_MTLCounterSampleBufferDescriptorInternal._label
    0000000000107088 S _OBJC_IVAR_$_MTLCounterSampleBufferDescriptorInternal._sampleCount
    0000000000107080 S _OBJC_IVAR_$_MTLCounterSampleBufferDescriptorInternal._storageMode
    000000000010b108 S _OBJC_METACLASS_$_MTLCounterSampleBufferDescriptor
    000000000010b130 S _OBJC_METACLASS_$_MTLCounterSampleBufferDescriptorInternal

Fixes these test failures:

    1) ApiSelectorTest.InstanceMethods (Introspection.MacApiSelectorTest.ApiSelectorTest.InstanceMethods)
         8 errors found in 26658 instance selector validated:
    Selector not found for Metal.MTLCounterSampleBufferDescriptor : counterSet
    Selector not found for Metal.MTLCounterSampleBufferDescriptor : setCounterSet:
    Selector not found for Metal.MTLCounterSampleBufferDescriptor : label
    Selector not found for Metal.MTLCounterSampleBufferDescriptor : setLabel:
    Selector not found for Metal.MTLCounterSampleBufferDescriptor : sampleCount
    Selector not found for Metal.MTLCounterSampleBufferDescriptor : setSampleCount:
    Selector not found for Metal.MTLCounterSampleBufferDescriptor : storageMode
    Selector not found for Metal.MTLCounterSampleBufferDescriptor : setStorageMode:

* [introspection] Ignore some API we've bound incorrectly. Fixes #7116.

There are also a few API fixes, those will be submitted in a different PR.

Fixes https://github.com/xamarin/xamarin-macios/issues/7116.
2019-10-22 22:30:19 +02:00
Pramit Mallick e3c9fb0a99
Xcode11.2 HomeKit bindings (#7268) 2019-10-22 09:45:58 -04:00
William Kent 8425129eeb Add bindings for NSXpcConnection and related types (#7001)
* Add bindings for NSXpcConnection and related types

* Re-add accidentally deleted file

* Typo fix

* Add NSXpcInterface.CreateForType()

* Add MethodInfo-taking overloads to NSXpcInterface

* Add null check

* Mark methods with wrappers as internal

Also fixed a formatting bug that I didn't catch earlier.

* Change NSXPCProxyCreating methods to be strongly typed

I got rid of the NSXpcProxyCreating interface in this change,
because its only user was NSXpcConnection, and I needed to
inline the protocol methods into the class definition so I
could mark them as [Internal].

* Add missing casts

* Add NSXpcConnectionOptions enum

* Convert NSXpcConnection constructor to use new enum

* Remove now-unneeded manual constructor

* Fix bgen warning

* Typo fix

* Fix selector

* Remove incorrect use of BindAsAttribute

Per the docs, this only works for enums backed
by NSNumber and NSValue, not for enums
passed directly as integers.

* Fix duplicated selector errors

* Throw ArgumentException instead of InvalidOperationException

* Extend AppExtension targets to produce XPC services

Rather than create an entirely new set of targets
(that would require VS and VSMac updates to properly
consume), I have decided to use the existing AppExtension
build targets to produce XPC services as well. All the
user must do is set the $(IsXPCService) property to true in
their project file, and the targets will do The Right Thing™.

Note that this support is Mac-only for now; I may need a bit
of help adjusting them to work on for iOS/watchOS/tvOS, as I
am not as familiar with those platforms.

* Copy XPC service bundles into the correct location

* Move IsXPCService property definition to props file

* Don't pass /extension to mmp for XPC service targets

This would cause the XPC service binary to
be linked incorrectly.

* Add NSXpcConnection/NSXpcInterface.cs files to the build

* Fix build

* Fix build

* Add required type parameter requirements

* Fix type parameter requirements

* Fix return type

* Fix return type of NSXpcInterface.CreateForProtocol ()

* Take ownership of the returned object types

* Adjust XPC service mmp invocation

I need to link the XPC service bundle as if it is an app extension, but
I must not use xamarin_mac_extension_main. I added a new flag to make
this possible.

* Change mmp to correctly construct XPC service bundle

* Set the MonoBundleExecutable Info.plist key for XPC services

* Use the runtime to get the protocol

* Make NSXpcInterface.CreateForProtocol() public

The static registrar must be used for Cocoa to accept the protocol
as a valid XPC interface, but that then seems to break resolving
the protocol from the type. I must therefore hard-code the protocol
name in my code, and that requires I make this constructor public.

* Add XpcInterfaceAttribute

See the doc comment in XpcInterfaceAttribute.cs for why
this type is required. The referenced mmp optimizations
will be added in future commits.

* Add XpcInterfaceAttribute to generator build

* Add support for XpcInterfaceAttribute to the generator

* Force static generation of protocols decorated with XpcInterfaceAttribute

* Change how static registrar translates block parameters

Previously, they would always be marshalled as "id".
This would throw off the XPC subsystem, which parses
the block signature to determine the communication
protocol.

* Undo whitespace noise

* Remove unneeded casts

* Add trailing comma

* Use HasAttribute instead of GetCustomAttribute

* Fix style issues

* Bind NSXpcConnection.auditSessionIdentifier

* Address naming feedback

* Make Get/SetAllowedClasses public

IMHO, passing the selector as a string is just as
usable as passing a MethodInfo, and is also less
verbose if you copy/paste the selector string
from the ExportAttribute. There is no reason why
we cannot have both overloads be public.

* Update overload names to match

* Update more overload names to match

* Make mmp --xpc imply --extension

* Reformat if statement

* Fix build

* Conditionalize creation of PlugIns and XPCServices directories

* Add AutoGeneratedName

Co-Authored-By: Rolf Bjarne Kvinge <rolf@xamarin.com>

* Get rid of ProtocolizeAttribute

* Update availability attributes to please xharness

I actually think xharness is wrong here, since the
NSXPCConnection header lists these types as being
available starting in macOS 10.8.

* Update sharpie ignore files to reflect changes

This should fix the xtro-sharpie test failures CI has been reporting.

* Fix MM4105 error generation

* Adjust error message in test to match mmp

I had to change the error text slightly, because the type of the parameter
cannot be determined where the error is thrown anymore. However, the newer
exception message IMO is just as clear.

* Make exception message match test exactly

* Remove outdated copyright header text

* Remove more outdated copyright header text

* Revert changes to MM4105 error generation

I have a more elegant way of fixing this test now.

* Return "id" if Invoke method cannot be found

This fixes the MM4105 error unit test,
without requiring modification to that test.

* Remove redundant availability attributes

* Add DesignatedInitializerAttribute

* Re-add required code to macOS-Foundation.ignore

* Put DesignatedInitializer on the right constructor

* Update xtro-sharpie ignore files
2019-10-22 15:38:01 +02:00
Vincent Dondain 4b3a6a79fa [d16-4] Bump mono 2019-08@ef75d4be (#7269)
New commits in mono/mono:

* mono/mono@ef75d4bef7 [2019-08]   BeginConnect complete to early when not using callback. (#17416)

Diff: 01dbbb746f..ef75d4bef7
2019-10-22 10:59:47 +02:00
monojenkins 9b13690a2d [d16-4] [tests] Fix tests on Catalina. (#7262)
* [tests] Remove 32-bit slice from macOS test libraries. Fixes xamarin/maccore#2031.

The 32-bit slice is causing a build failure on the bots:

    Task "Exec" (TaskId:35)
      Task Parameter:Command=make bin/SimpleClassDylib.dylib bin/SimpleClassStatic.a bin/Mobile-static/MobileBinding.dll (TaskId:35)
      Task Parameter:WorkingDirectory=/Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/mmptest//../mac-binding-project/ (TaskId:35)
      make bin/SimpleClassDylib.dylib bin/SimpleClassStatic.a bin/Mobile-static/MobileBinding.dll (TaskId:35)
      In file included from ../common/mac/SimpleClass.m:1: (TaskId:35)
      In file included from ../common/mac/SimpleClass.h:1: (TaskId:35)
      In file included from /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13: (TaskId:35)
      In file included from /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:27: (TaskId:35)
      In file included from /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSCollectionView.h:9: (TaskId:35)
    /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSViewController.h(247,39): error GF2D19E48: unknown type name 'NSExtensionContext'; did you mean 'NSAnimationContext'? [/Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/xharness/tmp-test-dir/mmptest/mmptest.csproj]
      @property (nullable, readonly,retain) NSExtensionContext *extensionContext API_AVAILABLE(macos(10.10)); (TaskId:35)
                                            ^ (TaskId:35)
      /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSAnimationContext.h:18:12: note: 'NSAnimationContext' declared here (TaskId:35)
      @interface NSAnimationContext : NSObject (TaskId:35)
                 ^ (TaskId:35)
      In file included from ../common/mac/SimpleClass.m:1: (TaskId:35)
      In file included from ../common/mac/SimpleClass.h:1: (TaskId:35)
      In file included from /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13: (TaskId:35)
      In file included from /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:99: (TaskId:35)
      In file included from /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSSharingServicePickerTouchBarItem.h:9: (TaskId:35)
    /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSSharingService.h(181,119): error GC04982C4: expected a type [/Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/xharness/tmp-test-dir/mmptest/mmptest.csproj]
      - (NSCloudKitSharingServiceOptions)optionsForSharingService:(NSSharingService *)cloudKitSharingService shareProvider:(NSItemProvider *)provider; (TaskId:35)
                                                                                                                            ^ (TaskId:35)
    /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSSharingService.h(196,12): error G93352991: cannot find interface declaration for 'NSItemProvider' [/Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/xharness/tmp-test-dir/mmptest/mmptest.csproj]
      @interface NSItemProvider (NSCloudKitSharing) (TaskId:35)
                 ^ (TaskId:35)
      In file included from ../common/mac/SimpleClass.m:1: (TaskId:35)
      In file included from ../common/mac/SimpleClass.h:1: (TaskId:35)
      In file included from /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13: (TaskId:35)
      In file included from /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:250: (TaskId:35)
    /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSItemProvider.h(16,12): error G93352991: cannot find interface declaration for 'NSItemProvider' [/Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/xharness/tmp-test-dir/mmptest/mmptest.csproj]
      @interface NSItemProvider (NSItemSourceInfo) (TaskId:35)
                 ^ (TaskId:35)
      4 errors generated. (TaskId:35)
      make[1]: *** [bin/SimpleClass.i386.a] Error 1 (TaskId:35)

and since we don't need the 32-bit slice anymore, just remove it.

Fixes https://github.com/xamarin/maccore/issues/2031.

* [monotouch-test] Percent-escape some local file paths. Fixes xamarin/maccore#2032.

Fixes this xammac test failure when the csproj has paths in its path:

    1) GetCaption (MonoTouchFixtures.MediaAccessibility.ImageCaptioningTest.GetCaption)
       System.Exception : Could not initialize an instance of the type 'Foundation.NSUrl': the native 'initWithString:' method returned nil.
    It is possible to ignore this condition by setting ObjCRuntime.Class.ThrowOnInitFailure to false.
      at Foundation.NSObject.InitializeHandle (System.IntPtr handle, System.String initSelector) [0x000ab] in <c93a0a20c5e340cb9a858d96ecca3415>:0
      at Foundation.NSUrl..ctor (System.String urlString) [0x00044] in <c93a0a20c5e340cb9a858d96ecca3415>:0
      at MonoTouchFixtures.MediaAccessibility.ImageCaptioningTest.GetCaption () [0x00076] in <7a733573c3684923854270073138d4be>:0
      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 <9c0bd541400747ef85267f70e32bd8e4>:0

Fixes https://github.com/xamarin/maccore/issues/2032.

* [tests] Exclude MPS tests in the simulator on macOS 10.15+. Fixes xamarin/maccore#2030.

The simulator crashes when the app tests if MPS is supported...

Fixes https://github.com/xamarin/maccore/issues/2030.

* [tests] Exclude MPS tests in the simulator on macOS 10.15+. Fixes xamarin/maccore#2030.

The simulator crashes when the app tests if MPS is supported...

Fixes https://github.com/xamarin/maccore/issues/2030.

* Fix whitespace.
2019-10-22 07:13:14 +02:00
Rolf Bjarne Kvinge 5aade5e00a
Bump prebuilt-apps, ios-samples and xamarin-form-samples for SampleTester. (#7265) 2019-10-21 22:00:31 +02:00
Rolf Bjarne Kvinge f496904082
[tests] Fix tests on Catalina. (#7255)
* [monotouch-test] Percent-escape some local file paths. Fixes xamarin/maccore#2032.

Fixes this xammac test failure when the csproj has paths in its path:

    1) GetCaption (MonoTouchFixtures.MediaAccessibility.ImageCaptioningTest.GetCaption)
       System.Exception : Could not initialize an instance of the type 'Foundation.NSUrl': the native 'initWithString:' method returned nil.
    It is possible to ignore this condition by setting ObjCRuntime.Class.ThrowOnInitFailure to false.
      at Foundation.NSObject.InitializeHandle (System.IntPtr handle, System.String initSelector) [0x000ab] in <c93a0a20c5e340cb9a858d96ecca3415>:0
      at Foundation.NSUrl..ctor (System.String urlString) [0x00044] in <c93a0a20c5e340cb9a858d96ecca3415>:0
      at MonoTouchFixtures.MediaAccessibility.ImageCaptioningTest.GetCaption () [0x00076] in <7a733573c3684923854270073138d4be>:0
      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 <9c0bd541400747ef85267f70e32bd8e4>:0

Fixes https://github.com/xamarin/maccore/issues/2032.

* [tests] Exclude MPS tests in the simulator on macOS 10.15+. Fixes xamarin/maccore#2030.

The simulator crashes when the app tests if MPS is supported...

Fixes https://github.com/xamarin/maccore/issues/2030.

* [tests] Remove 32-bit slice from macOS test libraries. Fixes xamarin/maccore#2031.

The 32-bit slice is causing a build failure on the bots:

    Task "Exec" (TaskId:35)
      Task Parameter:Command=make bin/SimpleClassDylib.dylib bin/SimpleClassStatic.a bin/Mobile-static/MobileBinding.dll (TaskId:35)
      Task Parameter:WorkingDirectory=/Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/mmptest//../mac-binding-project/ (TaskId:35)
      make bin/SimpleClassDylib.dylib bin/SimpleClassStatic.a bin/Mobile-static/MobileBinding.dll (TaskId:35)
      In file included from ../common/mac/SimpleClass.m:1: (TaskId:35)
      In file included from ../common/mac/SimpleClass.h:1: (TaskId:35)
      In file included from /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13: (TaskId:35)
      In file included from /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:27: (TaskId:35)
      In file included from /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSCollectionView.h:9: (TaskId:35)
    /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSViewController.h(247,39): error GF2D19E48: unknown type name 'NSExtensionContext'; did you mean 'NSAnimationContext'? [/Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/xharness/tmp-test-dir/mmptest/mmptest.csproj]
      @property (nullable, readonly,retain) NSExtensionContext *extensionContext API_AVAILABLE(macos(10.10)); (TaskId:35)
                                            ^ (TaskId:35)
      /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSAnimationContext.h:18:12: note: 'NSAnimationContext' declared here (TaskId:35)
      @interface NSAnimationContext : NSObject (TaskId:35)
                 ^ (TaskId:35)
      In file included from ../common/mac/SimpleClass.m:1: (TaskId:35)
      In file included from ../common/mac/SimpleClass.h:1: (TaskId:35)
      In file included from /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13: (TaskId:35)
      In file included from /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:99: (TaskId:35)
      In file included from /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSSharingServicePickerTouchBarItem.h:9: (TaskId:35)
    /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSSharingService.h(181,119): error GC04982C4: expected a type [/Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/xharness/tmp-test-dir/mmptest/mmptest.csproj]
      - (NSCloudKitSharingServiceOptions)optionsForSharingService:(NSSharingService *)cloudKitSharingService shareProvider:(NSItemProvider *)provider; (TaskId:35)
                                                                                                                            ^ (TaskId:35)
    /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSSharingService.h(196,12): error G93352991: cannot find interface declaration for 'NSItemProvider' [/Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/xharness/tmp-test-dir/mmptest/mmptest.csproj]
      @interface NSItemProvider (NSCloudKitSharing) (TaskId:35)
                 ^ (TaskId:35)
      In file included from ../common/mac/SimpleClass.m:1: (TaskId:35)
      In file included from ../common/mac/SimpleClass.h:1: (TaskId:35)
      In file included from /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13: (TaskId:35)
      In file included from /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:250: (TaskId:35)
    /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSItemProvider.h(16,12): error G93352991: cannot find interface declaration for 'NSItemProvider' [/Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/xharness/tmp-test-dir/mmptest/mmptest.csproj]
      @interface NSItemProvider (NSItemSourceInfo) (TaskId:35)
                 ^ (TaskId:35)
      4 errors generated. (TaskId:35)
      make[1]: *** [bin/SimpleClass.i386.a] Error 1 (TaskId:35)

and since we don't need the 32-bit slice anymore, just remove it.

Fixes https://github.com/xamarin/maccore/issues/2031.
2019-10-19 00:01:53 +02:00
Rolf Bjarne Kvinge 8411955e2f
[CoreImage] Fix a couple of test/availability issues. (#7259)
Fixes this on macOS 10.9:

    1) ApiCtorInitTest.DefaultCtorAllowed (Introspection.MacApiCtorInitTest.ApiCtorInitTest.DefaultCtorAllowed)
         1 potential errors found in 860 default ctor validated:
    CoreImage.CIMaskedVariableBlur : Handle

      Expected: 0
      But was:  1

      at Introspection.ApiCtorInitTest.DefaultCtorAllowed () [0x0019b] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/tests/introspection/ApiCtorInitTest.cs:295
      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 /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/external/mono/mcs/class/corlib/System.Reflection/RuntimeMethodInfo.cs:395

    2) ApiCoreImageFiltersTest.Keys (Introspection.MacCoreImageFiltersTest.ApiCoreImageFiltersTest.Keys)
       System.ArgumentNullException : Value cannot be null.
    Parameter name: array
      at System.Array.IndexOf[T] (T[] array, T value) [0x0000e] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/external/mono/external/corert/src/System.Private.CoreLib/src/System/Array.cs:666
      at Introspection.ApiCoreImageFiltersTest.Keys () [0x002b7] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/tests/introspection/ApiCoreImageFiltersTest.cs:445
      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 /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/external/mono/mcs/class/corlib/System.Reflection/RuntimeMethodInfo.cs:395

    3) ApiCoreImageFiltersTest.Protocols (Introspection.MacCoreImageFiltersTest.ApiCoreImageFiltersTest.Protocols)
         1 potential errors found:
    Managed CIMaskedVariableBlur was not part of the native filter list

      Expected: 0
      But was:  1

      at Introspection.ApiCoreImageFiltersTest.Protocols () [0x0104e] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/tests/introspection/ApiCoreImageFiltersTest.cs:370
      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 /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/external/mono/mcs/class/corlib/System.Reflection/RuntimeMethodInfo.cs:395

And this on macOS 10.10:

    1) ApiCoreImageFiltersTest.Keys (Introspection.MacCoreImageFiltersTest.ApiCoreImageFiltersTest.Keys)
         1 potential errors found:
    CICode128BarcodeGenerator: Property `BarcodeHeight` mapped to key `inputBarcodeHeight` is not part of `InputKeys`.

      Expected: 0
      But was:  1

      at Introspection.ApiCoreImageFiltersTest.Keys () [0x006b1] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/tests/introspection/ApiCoreImageFiltersTest.cs:524
      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 /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/external/mono/mcs/class/corlib/System.Reflection/RuntimeMethodInfo.cs:395

    2) ApiCoreImageFiltersTest.Protocols (Introspection.MacCoreImageFiltersTest.ApiCoreImageFiltersTest.Protocols)
         1 potential errors found:
    CICode128BarcodeGenerator: Property `BarcodeHeight` mapped to key `inputBarcodeHeight` is not part of `InputKeys`.

      Expected: 0
      But was:  1

      at Introspection.ApiCoreImageFiltersTest.Protocols () [0x0104e] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/tests/introspection/ApiCoreImageFiltersTest.cs:370
      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 /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/external/mono/mcs/class/corlib/System.Reflection/RuntimeMethodInfo.cs:395

And this on macOS 11.11:

    1) ApiCoreImageFiltersTest.Keys (Introspection.MacCoreImageFiltersTest.ApiCoreImageFiltersTest.Keys)
         2 potential errors found:
    CICode128BarcodeGenerator: Property `BarcodeHeight` mapped to key `inputBarcodeHeight` is not part of `InputKeys`.
    CIGaussianBlur: Output Key `outputImageV1` is NOT mapped to a `OutputImageV1` property.

      Expected: 0
      But was:  2

      at Introspection.ApiCoreImageFiltersTest.Keys () [0x006b1] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/tests/introspection/ApiCoreImageFiltersTest.cs:524
      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 /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/external/mono/mcs/class/corlib/System.Reflection/RuntimeMethodInfo.cs:395

    2) ApiCoreImageFiltersTest.Protocols (Introspection.MacCoreImageFiltersTest.ApiCoreImageFiltersTest.Protocols)
         2 potential errors found:
    CICode128BarcodeGenerator: Property `BarcodeHeight` mapped to key `inputBarcodeHeight` is not part of `InputKeys`.
    CIGaussianBlur: Output Key `outputImageV1` is NOT mapped to a `OutputImageV1` property.

      Expected: 0
      But was:  2

      at Introspection.ApiCoreImageFiltersTest.Protocols () [0x0104e] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/tests/introspection/ApiCoreImageFiltersTest.cs:370
      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 /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/external/mono/mcs/class/corlib/System.Reflection/RuntimeMethodInfo.cs:395
2019-10-18 22:42:12 +02:00
Pramit Mallick dc72d592cf
[Appkit] Bindings - part 2 (#7215)
* Added NSButtonTouchBarItem interface

* Added NSTextScalingType

* name changes

* Text Scaling options

* Deprecated KeyEquivalentFont

* Deprecated CopiesOnScroll

* Added missing enums first

* Added some deprecated attributes

* some more deprecations

* Strong typed TextScaling

* apple docs to correct deprecations

* Changed deprecated messages

* strong typing NSTouchBarItemIdentifier identifier

* internal attr

* Making TextScalingDocumentOption simple Fields following UIKit

* Moved NSDirectionalEdgeInsets

* Added NSCollectionLayoutAnchor

* removed extra methods for mac from xkit/types

* removed todos

* added automaticCustomizeTouchBarMenuItemEnabled

* added NSCollectionLayoutDimension

* added NSPickerTouchBarItem

* added NSCollectionLayoutSize

* added NSCollectionLayoutSpacing

* added NSCollectionLayoutEdgeSpacing

* added DesignatedInitializer

* addressed reviews

* naming + alignment

* adding test case for NSPickerTouchBarItem .ctor

* added comment

* removed deprecated selectors to ignore

* updated copyright info in Xkit/Types header
2019-10-18 15:45:34 -04:00
Manuel de la Pena a50ec24e4a
[Network] Clean up the protocol options class. (#7196)
Add classes for each of the protocol types. Deprecated the old methods.
2019-10-18 04:04:41 +02:00
Rolf Bjarne Kvinge ab60a11f14
[mmp] Add deployment target to the -fobjc-runtime clang argument. Fixes #7204. (#7227) (#7231)
This is required when also passing the -fobjc-arc argument.

Fixes https://github.com/xamarin/xamarin-macios/issues/7204.

This is a backport of #7227.
2019-10-17 17:44:37 +02:00
Vincent Dondain bc76464bef
Merge pull request #7211 from VincentDondain/d16-4-mono-bump
[d16-4] Bump mono 2019-08@3eb5f34f
2019-10-17 10:29:19 -04:00
Rolf Bjarne Kvinge ec62a8dd51
[tests] Fix tests after a modification to our dummy x86-64 slice in our shipping libraries. Fixes xamarin/maccore#2026. (#7241)
Previously we only had a single dynamic library that was used as the dummy
slice, but there may be a static library instead. So teach the tests about
that static library.

Fixes these test failures:

    1) Failed : Xamarin.Tests.ProductTests.MinOSVersion(iOS,MiniPhoneOS,IOS,True)
      Unexpected build version command in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/SDKs/MonoTouch.iphoneos.sdk/usr/lib/libmono-profiler-log.a (x86-64-slice.o)
      Expected: IOS or 0
      But was:  MacOS
      at Xamarin.Tests.ProductTests.MinOSVersion (Xamarin.Tests.Profile profile, Xamarin.MachO+LoadCommands load_command, Xamarin.MachO+Platform platform, System.Boolean device) [0x00000] in <a0c772db19e5407bb3edc34b20e04476>:0

    2) Failed : Xamarin.Tests.ProductTests.MinOSVersion(watchOS,MinwatchOS,WatchOS,True)
      Unexpected build version command in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/SDKs/Xamarin.WatchOS.sdk/usr/lib/libmono-profiler-log.a (x86-64-slice.o)
      Expected: WatchOS or 0
      But was:  MacOS
      at Xamarin.Tests.ProductTests.MinOSVersion (Xamarin.Tests.Profile profile, Xamarin.MachO+LoadCommands load_command, Xamarin.MachO+Platform platform, System.Boolean device) [0x00000] in <a0c772db19e5407bb3edc34b20e04476>:0

    3) Failed : Xamarin.Tests.ProductTests.MinOSVersion(tvOS,MintvOS,TvOS,True)
      Unexpected build version command in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/SDKs/Xamarin.AppleTVOS.sdk/usr/lib/libmono-profiler-log.a (x86-64-slice.o)
      Expected: TvOS or 0
      But was:  MacOS
      at Xamarin.Tests.ProductTests.MinOSVersion (Xamarin.Tests.Profile profile, Xamarin.MachO+LoadCommands load_command, Xamarin.MachO+Platform platform, System.Boolean device) [0x00000] in <a0c772db19e5407bb3edc34b20e04476>:0

Fixes https://github.com/xamarin/maccore/issues/2026.
2019-10-17 07:25:47 +02:00
Rolf Bjarne Kvinge ad0489f79c
Fix a few introspection issues on Catalina. (#7212) (#7239)
* [SceneKit] Adjust deprecation message.

Fixes this introspection failure:

    [FAIL] [Rule 4] Don't use availability keywords in attribute's message: "OpenGL API deprecated, please use Metal instead." - Type: SCNLayer
    [FAIL] [Rule 4] Don't use availability keywords in attribute's message: "OpenGL API deprecated, please use Metal instead." - Member name: get_OpenGLContext, Type: SCNView
    [FAIL] [Rule 4] Don't use availability keywords in attribute's message: "OpenGL API deprecated, please use Metal instead." - Member name: set_OpenGLContext, Type: SCNView
    [FAIL] [Rule 4] Don't use availability keywords in attribute's message: "OpenGL API deprecated, please use Metal instead." - Member name: get_PixelFormat, Type: SCNView
    [FAIL] [Rule 4] Don't use availability keywords in attribute's message: "OpenGL API deprecated, please use Metal instead." - Member name: set_PixelFormat, Type: SCNView

* [tests] Fix introspection and xammac tests on Catalina. (#7200)

* [tests] Adjust NaturalLanguage.EmbeddingTest to cope with non-existent embeddings. Fixes xamarin/maccore#2011.

Fixes https://github.com/xamarin/maccore/issues/2011.

* [tests] Fix typo test on macOS 10.15. Fixes #7116.

Fixes https://github.com/xamarin/xamarin-macios/issues/7116.

* [introspection] Ignore MTLCounterSampleBufferDescriptor's selectors.

They're implemented using a different/internal type:

    $ nm /System/Library/Frameworks/Metal.framework/Metal | grep MTLCounterSampleBuffer
    00000000000458ab t +[MTLCounterSampleBufferDescriptor allocWithZone:]
    0000000000045897 t +[MTLCounterSampleBufferDescriptor alloc]
    000000000004591e t -[MTLCounterSampleBufferDescriptor copyWithZone:]
    000000000004598e t -[MTLCounterSampleBufferDescriptorInternal copyWithZone:]
    0000000000045c0f t -[MTLCounterSampleBufferDescriptorInternal counterSet]
    0000000000045936 t -[MTLCounterSampleBufferDescriptorInternal dealloc]
    0000000000045b65 t -[MTLCounterSampleBufferDescriptorInternal hash]
    0000000000045a31 t -[MTLCounterSampleBufferDescriptorInternal isEqual:]
    0000000000045c58 t -[MTLCounterSampleBufferDescriptorInternal label]
    0000000000045c7f t -[MTLCounterSampleBufferDescriptorInternal sampleCount]
    0000000000045c25 t -[MTLCounterSampleBufferDescriptorInternal setCounterSet:]
    0000000000045c6e t -[MTLCounterSampleBufferDescriptorInternal setLabel:]
    0000000000045c90 t -[MTLCounterSampleBufferDescriptorInternal setSampleCount:]
    0000000000045c47 t -[MTLCounterSampleBufferDescriptorInternal setStorageMode:]
    0000000000045c36 t -[MTLCounterSampleBufferDescriptorInternal storageMode]
    000000000010b0b8 S _OBJC_CLASS_$_MTLCounterSampleBufferDescriptor
    000000000010b0e0 S _OBJC_CLASS_$_MTLCounterSampleBufferDescriptorInternal
    0000000000107070 S _OBJC_IVAR_$_MTLCounterSampleBufferDescriptorInternal._counterSet
    0000000000107078 S _OBJC_IVAR_$_MTLCounterSampleBufferDescriptorInternal._label
    0000000000107088 S _OBJC_IVAR_$_MTLCounterSampleBufferDescriptorInternal._sampleCount
    0000000000107080 S _OBJC_IVAR_$_MTLCounterSampleBufferDescriptorInternal._storageMode
    000000000010b108 S _OBJC_METACLASS_$_MTLCounterSampleBufferDescriptor
    000000000010b130 S _OBJC_METACLASS_$_MTLCounterSampleBufferDescriptorInternal

Fixes these test failures:

    1) ApiSelectorTest.InstanceMethods (Introspection.MacApiSelectorTest.ApiSelectorTest.InstanceMethods)
         8 errors found in 26658 instance selector validated:
    Selector not found for Metal.MTLCounterSampleBufferDescriptor : counterSet
    Selector not found for Metal.MTLCounterSampleBufferDescriptor : setCounterSet:
    Selector not found for Metal.MTLCounterSampleBufferDescriptor : label
    Selector not found for Metal.MTLCounterSampleBufferDescriptor : setLabel:
    Selector not found for Metal.MTLCounterSampleBufferDescriptor : sampleCount
    Selector not found for Metal.MTLCounterSampleBufferDescriptor : setSampleCount:
    Selector not found for Metal.MTLCounterSampleBufferDescriptor : storageMode
    Selector not found for Metal.MTLCounterSampleBufferDescriptor : setStorageMode:

* [introspection] Ignore some API we've bound incorrectly. Fixes #7116.

There are also a few API fixes, those will be submitted in a different PR.

Fixes https://github.com/xamarin/xamarin-macios/issues/7116.
2019-10-17 07:20:22 +02:00
Vincent Dondain 307dc86f6f [tests] Ignore mscorlib test that runs out of memory
See mono issue: https://github.com/mono/mono/issues/17375

```
[PASS] System.Reflection.Tests.RuntimeReflectionExtensionsTests.GetMethodInfo
Test name: System.Reflection.Tests.RuntimeReflectionExtensionsTests.GetRuntimeMethod
Exception messages: System.OutOfMemoryException : Out of memory
	Handler for event TestFailedEvent failed with exception
	System.Reflection.Tests.RuntimeReflectionExtensionsTests 0 ms
```
2019-10-16 19:50:20 -04:00
Rolf Bjarne Kvinge bdc8e693f9
[msbuild] Provide the correct value for the operating system for tvOS and watchOS to a few tasks. Fixes #6200. (#7226)
The problem with #6200 was that we'd pass -mios-version-min=x.y to the metal
tool even for tvOS apps. This fixes it so that now pass -mtvos-version-min.

Fixes https://github.com/xamarin/xamarin-macios/issues/6200.
2019-10-16 22:14:11 +02:00
Sebastien Pouliot a50c753117
[coreimage] Update for Xcode 11[.2] (#7216)
Apple decided to expose most (but not all) `CIFilter` using protocols
(instead of weakly named dictionaries). Most of this maps well with
our strong bindings but there are cases where we:

* missing some properties (easy, there were added); or
* used a different types [1] and that requires new members / obsoletion

A few other API were also added in Xcode 11 (nothing in 11.1 or 11.2) and
included in this PR.

New introspection tests were also added to minimize the risk that
the API and generator changes produced incorrect code. This lead
to the finding of some missing API (in particular `Output*` properties)
that were added.

[1] Often ours are better (using `float` for a `bool` value is not
optimal) but we do not have `[BindAs]` for protocols :( to _fix_ them

Note: this replace draft PR https://github.com/xamarin/xamarin-macios/pull/7120 but it's has quite a bit of changes in filter generation (inlining protocols) and that affected bindings too.
2019-10-16 09:16:32 -04:00
Rolf Bjarne Kvinge 1d88f13be6
Fix a few introspection issues on Catalina. (#7212)
* [SceneKit] Adjust deprecation message.

Fixes this introspection failure:

    [FAIL] [Rule 4] Don't use availability keywords in attribute's message: "OpenGL API deprecated, please use Metal instead." - Type: SCNLayer
    [FAIL] [Rule 4] Don't use availability keywords in attribute's message: "OpenGL API deprecated, please use Metal instead." - Member name: get_OpenGLContext, Type: SCNView
    [FAIL] [Rule 4] Don't use availability keywords in attribute's message: "OpenGL API deprecated, please use Metal instead." - Member name: set_OpenGLContext, Type: SCNView
    [FAIL] [Rule 4] Don't use availability keywords in attribute's message: "OpenGL API deprecated, please use Metal instead." - Member name: get_PixelFormat, Type: SCNView
    [FAIL] [Rule 4] Don't use availability keywords in attribute's message: "OpenGL API deprecated, please use Metal instead." - Member name: set_PixelFormat, Type: SCNView

* [tests] Fix introspection and xammac tests on Catalina. (#7200)

* [tests] Adjust NaturalLanguage.EmbeddingTest to cope with non-existent embeddings. Fixes xamarin/maccore#2011.

Fixes https://github.com/xamarin/maccore/issues/2011.

* [tests] Fix typo test on macOS 10.15. Fixes #7116.

Fixes https://github.com/xamarin/xamarin-macios/issues/7116.

* [introspection] Ignore MTLCounterSampleBufferDescriptor's selectors.

They're implemented using a different/internal type:

    $ nm /System/Library/Frameworks/Metal.framework/Metal | grep MTLCounterSampleBuffer
    00000000000458ab t +[MTLCounterSampleBufferDescriptor allocWithZone:]
    0000000000045897 t +[MTLCounterSampleBufferDescriptor alloc]
    000000000004591e t -[MTLCounterSampleBufferDescriptor copyWithZone:]
    000000000004598e t -[MTLCounterSampleBufferDescriptorInternal copyWithZone:]
    0000000000045c0f t -[MTLCounterSampleBufferDescriptorInternal counterSet]
    0000000000045936 t -[MTLCounterSampleBufferDescriptorInternal dealloc]
    0000000000045b65 t -[MTLCounterSampleBufferDescriptorInternal hash]
    0000000000045a31 t -[MTLCounterSampleBufferDescriptorInternal isEqual:]
    0000000000045c58 t -[MTLCounterSampleBufferDescriptorInternal label]
    0000000000045c7f t -[MTLCounterSampleBufferDescriptorInternal sampleCount]
    0000000000045c25 t -[MTLCounterSampleBufferDescriptorInternal setCounterSet:]
    0000000000045c6e t -[MTLCounterSampleBufferDescriptorInternal setLabel:]
    0000000000045c90 t -[MTLCounterSampleBufferDescriptorInternal setSampleCount:]
    0000000000045c47 t -[MTLCounterSampleBufferDescriptorInternal setStorageMode:]
    0000000000045c36 t -[MTLCounterSampleBufferDescriptorInternal storageMode]
    000000000010b0b8 S _OBJC_CLASS_$_MTLCounterSampleBufferDescriptor
    000000000010b0e0 S _OBJC_CLASS_$_MTLCounterSampleBufferDescriptorInternal
    0000000000107070 S _OBJC_IVAR_$_MTLCounterSampleBufferDescriptorInternal._counterSet
    0000000000107078 S _OBJC_IVAR_$_MTLCounterSampleBufferDescriptorInternal._label
    0000000000107088 S _OBJC_IVAR_$_MTLCounterSampleBufferDescriptorInternal._sampleCount
    0000000000107080 S _OBJC_IVAR_$_MTLCounterSampleBufferDescriptorInternal._storageMode
    000000000010b108 S _OBJC_METACLASS_$_MTLCounterSampleBufferDescriptor
    000000000010b130 S _OBJC_METACLASS_$_MTLCounterSampleBufferDescriptorInternal

Fixes these test failures:

    1) ApiSelectorTest.InstanceMethods (Introspection.MacApiSelectorTest.ApiSelectorTest.InstanceMethods)
         8 errors found in 26658 instance selector validated:
    Selector not found for Metal.MTLCounterSampleBufferDescriptor : counterSet
    Selector not found for Metal.MTLCounterSampleBufferDescriptor : setCounterSet:
    Selector not found for Metal.MTLCounterSampleBufferDescriptor : label
    Selector not found for Metal.MTLCounterSampleBufferDescriptor : setLabel:
    Selector not found for Metal.MTLCounterSampleBufferDescriptor : sampleCount
    Selector not found for Metal.MTLCounterSampleBufferDescriptor : setSampleCount:
    Selector not found for Metal.MTLCounterSampleBufferDescriptor : storageMode
    Selector not found for Metal.MTLCounterSampleBufferDescriptor : setStorageMode:

* [introspection] Ignore some API we've bound incorrectly. Fixes #7116.

There are also a few API fixes, those will be submitted in a different PR.

Fixes https://github.com/xamarin/xamarin-macios/issues/7116.
2019-10-16 08:01:55 +02:00
Waleed Chaudhry c156a30a0b
Bump prebuilt-apps for SampleTester (#7230) 2019-10-15 18:29:27 -04:00
Pramit Mallick 6cee62c10c
[AppKit] Bindings - part 1 (#7187)
* Added NSButtonTouchBarItem interface

* Added NSTextScalingType

* name changes

* Text Scaling options

* Deprecated KeyEquivalentFont

* Deprecated CopiesOnScroll

* Added missing enums first

* Added some deprecated attributes

* some more deprecations

* Strong typed TextScaling

* apple docs to correct deprecations

* Changed deprecated messages

* strong typing NSTouchBarItemIdentifier identifier

* internal attr

* Making TextScalingDocumentOption simple Fields following UIKit

* smart enum for identifier
2019-10-15 17:41:56 -04:00
Rolf Bjarne Kvinge cd2e86e86d
[xharness] Fix typo when launching mlaunch to get crash reports. (#7234) 2019-10-15 21:59:35 +02:00
Vincent Dondain 5e837a755a
Merge pull request #7210 from VincentDondain/master-merge-d16-4
Merge d16-4 (with xcode11.1 bits) into master
2019-10-15 14:38:40 -04:00
Manuel de la Pena 4cff2bc4e3
[Networking] Improve the NWBrowser API. (#7214)
Kept the API as it was but added a new handler that will be called when
all the changes from the browser have been done. The old Set* method
could be deleted in a future release and just expose the property.
2019-10-15 14:31:31 -04:00
Vincent Dondain 5c102d920f
Bump for Xcode 11.2 beta 2 (#7223) 2019-10-15 11:18:29 -04:00
Rolf Bjarne Kvinge e32731cb3d
[sampletester] Timestamp build logs. (#7233)
Makes it easier to figure out timeouts sometimes.
2019-10-15 15:16:02 +02:00
Vincent Dondain 61d0e1809f Merge remote-tracking branch 'origin/master' into master-merge-d16-4 2019-10-14 18:17:35 -04:00
Vincent Dondain a71292165e Merge branch 'd16-4' into master-merge-d16-4 2019-10-14 18:06:42 -04:00
Rolf Bjarne Kvinge dee19397f7
[mmp] Add deployment target to the -fobjc-runtime clang argument. Fixes #7204. (#7227)
This is required when also passing the -fobjc-arc argument.

Fixes https://github.com/xamarin/xamarin-macios/issues/7204.
2019-10-14 22:25:58 +02:00
Vincent Dondain c9d7bb7d0c
[monotouch-test] Fix RejectSslCertificatesServicePointManager test after bad merge (#7203) 2019-10-14 14:14:26 -04:00
Waleed Chaudhry 366da20ff0
Bump samples tester for ios-samples and xamarin-form-samples (#7166) 2019-10-14 11:30:11 -04:00
Rolf Bjarne Kvinge a8fdf6db6e
Implement a different escaping/quoting algorithm for arguments to System.Diagnostics.Process. (#7177)
* Implement a different escaping/quoting algorithm for arguments to System.Diagnostics.Process.

mono changed how quotes should be escaped when passed to
System.Diagnostic.Process, so we need to change accordingly.

The main difference is that single quotes don't have to be escaped anymore.

This solves problems like this:

    System.ComponentModel.Win32Exception : ApplicationName='nuget', CommandLine='restore '/Users/vsts/agent/2.158.0/work/1/s/tests/sampletester/bin/Debug/repositories/ios-samples/WorkingWithTables/Part 3 - Customizing a Table\'s appearance/3 - CellCustomTable/CellCustomTable.sln' -Verbosity detailed -SolutionDir '/Users/vsts/agent/2.158.0/work/1/s/tests/sampletester/bin/Debug/repositories/ios-samples/WorkingWithTables/Part 3 - Customizing a Table\'s appearance/3 - CellCustomTable'', CurrentDirectory='/Users/vsts/agent/2.158.0/work/1/s/tests/sampletester/bin/Debug/repositories', Native error= Cannot find the specified file
      at System.Diagnostics.Process.StartWithCreateProcess (System.Diagnostics.ProcessStartInfo startInfo) [0x0029f] in /Users/builder/jenkins/workspace/build-package-osx-mono/2019-08/external/bockbuild/builds/mono-x64/mcs/class/System/System.Diagnostics/Process.cs:778

ref: https://github.com/mono/mono/pull/15047

* Rework process arguments to pass arrays/lists around instead of quoted strings.

And then only convert to a string at the very end when we create the Process
instance.

In the future there will be a ProcessStartInfo.ArgumentList property we can
use to give the original array/list of arguments directly to the BCL so that
we can avoid quoting at all. These changes gets us almost all the way there
already (except that the ArgumentList property isn't available quite yet).

We also have to bump to target framework version v4.7.2 from v4.5 in several
places because of 'Array.Empty<T> ()' which is now used in more places.

* Parse linker flags from LinkWith attributes.

* [sampletester] Bump to v4.7.2 for Array.Empty<T> ().

* Fix typo.

* Rename GetVerbosity -> AddVerbosity.

* Remove unnecessary string interpolation.

* Remove unused variable.

* [mtouch] Simplify code a bit.

* Use implicitly typed arrays.
2019-10-14 16:18:46 +02:00
Waleed Chaudhry b3d566db3b
[WatchKit] Add WatchKit bindings for Xcode 11.2 (#7202)
* [WatchKit] Add WatchKit bindings for Xcode 11.2
2019-10-11 11:00:31 -04:00
Rolf Bjarne Kvinge f8f7de004c
[tests] Fix introspection and xammac tests on Catalina. (#7200)
* [tests] Adjust NaturalLanguage.EmbeddingTest to cope with non-existent embeddings. Fixes xamarin/maccore#2011.

Fixes https://github.com/xamarin/maccore/issues/2011.

* [tests] Fix typo test on macOS 10.15. Fixes #7116.

Fixes https://github.com/xamarin/xamarin-macios/issues/7116.
2019-10-10 08:35:38 +02:00
Vincent Dondain 07e9dd0b06
Bump for Xcode 11.2 beta 1 (#7195) 2019-10-08 23:57:41 -04:00
Manuel de la Pena e37549bc90
[Networking] Bring the framework up to Xcode 11.1 (#7091)
Add most of the new classes for Networking on Xcode11.1
2019-10-07 21:53:04 -04:00
Vincent Dondain a3076f29a3 Merge branch 'xcode11.1' into d16-4 2019-10-07 21:46:13 -04:00
Vũ Đức Tuyến fec41fa64a Fix #7174: ArgumentNullException for NSExpression.FromConstant (#7181)
* - Add missing NullAllowed attribute
- Add unit test for null value

* Normalize coding style
2019-10-07 14:09:17 +02:00
monojenkins c7830a082f [bcl-tests] Ignore test that's running out of memory (#7138)
- First appeared here: https://github.com/xamarin/xamarin-macios/pull/7127#issuecomment-536688551
- Mono issue filed here: https://github.com/mono/mono/issues/17129
2019-10-04 14:57:22 -04:00
Rolf Bjarne Kvinge bffca7df7b
[tests] Fix building the test libraries. (#7172)
Fix building the test libraries so that the native compiler gets passed the
right arguments (which makes us build the tvOS and watchOS versions of these
libraries with bitcode).

This fixes a build problem with the framework-test test for tvOS and watchOS.

Also remove an outdated comment.
2019-10-04 16:51:12 +02:00
Vincent Dondain 2600739f54
[bcl-tests] Ignore test that's running out of memory (#7137)
- First appeared here: https://github.com/xamarin/xamarin-macios/pull/7127#issuecomment-536688551
- Mono issue filed here: https://github.com/mono/mono/issues/17129
2019-10-03 18:21:23 -04:00
Rolf Bjarne Kvinge 8128976084
[runtime] Split the build differently: build libraries for simulator and device separately. (#7143)
This has a couple of advantages:

* It makes it easier to add a catalyst version of these libraries (because it
  becomes cumbersome to build for catalyst when the build rules assumes we're
  building for both simulator and device).
* It makes it easier to create an xcframework of our libraries, because the
  contents in an xcframework is split like this.
2019-10-03 16:38:44 +02:00
Manuel de la Pena 718f57f7ad
[Tests] Ignore some tests when using the interpreter (#7158)
Some tests do fail with the interpreter on tvOS. Ignoring them only
there.

Fixes https://github.com/xamarin/maccore/issues/1909
2019-10-02 18:12:20 -04:00
monojenkins dcad385e4e [monotouch-test] Fix UrlProtocolTest after a server we don't control changed its output. Fixes xamarin/maccore#2006. (#7156)
microsoft.com is doing user agent sniffing, and broke our our test since their
output is now different. Switch to example.com instead.

Fixes https://github.com/xamarin/maccore/issues/2006.
2019-10-02 18:08:18 +02:00
monojenkins c7d9fc10f8 [d16-4] [AppKit] Add missing Accessibility protocols. (#7146)
* [AppKit] Add missing Accessibility protocols.

This commit adds a few protocols that were missing. It is interesting to
mention that there are two of the protocols that are decorated with
NS_PROTOCOL_REQUIRES_EXPLICIT_IMPLEMENTATION, as per Apple documentation
this means that:

'Unlike normal protocols, when you adopt one of the role-specific protocols,
 Xcode may ask you to reimplement methods that have already been implemented
 by one of your ancestors.

 In order to ensure that your control returns accurate and useful information,
 some methods are tagged with the NS_PROTOCOL_REQUIRES_EXPLICIT_IMPLEMENTATION
 attribute. For these methods, you need to override your superclass’s
 implementation with your own.
'

In this case, we need to add the methods from all the parent classes and
set them to be [Abstract] since they are required. Not all methods have
to be added ONLY the required ones.

fixes: https://github.com/xamarin/xamarin-macios/issues/7079

* Remove the new methods.
2019-10-02 11:04:41 -05:00
monojenkins bc35a27aad [monotouch-test] Fix UrlProtocolTest after a server we don't control changed its output. Fixes xamarin/maccore#2006. (#7155)
microsoft.com is doing user agent sniffing, and broke our our test since their
output is now different. Switch to example.com instead.

Fixes https://github.com/xamarin/maccore/issues/2006.
2019-10-02 16:50:08 +02:00
Rolf Bjarne Kvinge 41c6fa029d
[monotouch-test] Fix UrlProtocolTest after a server we don't control changed its output. Fixes xamarin/maccore#2006. (#7154)
microsoft.com is doing user agent sniffing, and broke our our test since their
output is now different. Switch to example.com instead.

Fixes https://github.com/xamarin/maccore/issues/2006.
2019-10-02 15:59:31 +02:00
Vincent Dondain d81f05feab
[SceneKit] Update for Xcode 11 (#7140) 2019-10-01 10:55:49 -04:00
Rolf Bjarne Kvinge 4d5d38be02
Drop the Xcode 9.4 dependency. (#7044) (#7135)
* Drop the Xcode 9.4 dependency. (#7044)

* Drop the Xcode 9.4 dependency.

Also bump mono to get the removal of the mac32 binaries.

New commits in mono/mono:

* mono/mono@beb9a1b182 [sdks] Remove the mac32 build.
* mono/mono@747a919a06 [ci] Make ios/mac sdks archive URL more predictable
* mono/mono@114013096e [ci] Build iOS/Mac Mono sdks archive using Xcode 11
* mono/mono@10a24f3ea1 Implement WriteCore and ReadCore in DeflateStream
* mono/mono@a925846b1f [offsets-tool] Install clang into the user-specific python directory. (#16933)
* mono/mono@fe64a4765e [2019-06] Bump msbuild and sdk versions to 3.0.1xx latest (#16870)
* mono/mono@7293597b90 [corlib] Fix building nunit-lite twice (#16910)
* mono/mono@1648e88687 Rename bundle identifier for the various Mono.frameworks we create for Xamarin.iOS. Fixes xamarin/xamarin-macios#7005. (#16896)
* mono/mono@a6b5187d76 [metadata] Fix leaks when handling a few attributes (#16675) (#16851)
* mono/mono@7da9a041b3 [2019-06] Bump to mono/corefx@e79cf5b
* mono/mono@2b7050bdf3 [2019-06] Add RenamedEvent* to FSW sources from CoreFX (#16758)
* mono/mono@4f5ed502c6 [msbuild] pick up p4 versions
* mono/mono@f04ee2219d [2019-06][msbuid][roslyn] Bump msbuild and roslyn-binaries to pick up dotnet 3.0.100-p9 toolset
* mono/mono@6b4b99e571 Vtable [i] can be null so this should be check before use it. Fixes #16712

Diff: 7af64d1ebe..beb9a1b182

* [tests] Add a fat macOS dylib for testing purposes.

Add a binary version of a fat macOS dylib (because we can't create one when we
need it since we can't create 32-bit slice anymore).

It was created like this (in tests/test-libraries):

	$ cat test.m
	int theUltimateAnswer ()
	{
		return 42;
	}

	$ /Applications/Xcode94.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang test.m -olibtest.i386.dylib -shared -isysroot /Applications/Xcode94.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -framework Foundation -framework CoreLocation -lz  -arch i386
	$ lipo -create libtest.i386.dylib .libs/macos/libtest.dylib -output libtest-fat.dylib

* [tests] Adjust XM tests to XM not having fat dylibs anymore.

* [tests] Adjust product tests to some libraries not being fat anymore.

* [tests] Don't treat an Xcode with the same major version number as old.

Fixes an issue in the MT0091 test, where it would fail on tvOS because the
test wanted to use an older Xcode, and we could end up returning Xcode 11.0
when the current Xcode is 11.1. Since the test depends on using the OS SDK as
it was designed for (technically using an OS SDK earlier than the latest), it
ended up failing because while the iOS SDK was bumped in Xcode 11.1, the tvOS
SDK was not.
2019-10-01 16:18:28 +02:00
Rolf Bjarne Kvinge ea829b5a3f [tests] Remove workaround for xamarin/maccore#1996.
Fixes https://github.com/xamarin/maccore/issues/1996.
2019-09-30 13:30:28 -04:00
Rolf Bjarne Kvinge 979eb13ab2 [tests] Remove workaround for xamarin/maccore#1996.
Fixes https://github.com/xamarin/maccore/issues/1996.
2019-09-30 15:14:23 +02:00
Difegue 36d9417f92 Fix the NSFileTypeForHFSTypeCode enum (#6676)
* Rework NSFileTypeForHFSTypeCode

* Start writing 4cc test

* Update NSWorkspace.cs

* Fix formatting issues

* Fix tests

* Update src/AppKit/Enums.cs

Co-Authored-By: Rolf Bjarne Kvinge <rolf@xamarin.com>

* Update src/AppKit/NSWorkspace.cs

Co-Authored-By: Rolf Bjarne Kvinge <rolf@xamarin.com>

* Reintroduce old NSFileTypeForHFSTypeCode

+ Fix tests style

* Invert XAMCORE_4_0 check

* Fix xtro (new API added)
2019-09-27 14:14:15 -04:00
Manuel de la Pena b360408197
[Tests] Make the CoreBluetooth tests more reliable. (#7115)
Tests were failing because the manager was getting dispose and the
delegate was not. We ran into the failure because there was a device
close to the lab with the UUID that was being used.

The change uses a even more common UUID (heart monitor), which should
increase the chances to pick up a device and re-orgs the disposal of the
manager and the delegate.

This was confirmed with a BLE device, watchOS does not like us to try
and access it as a bluetooth device and is 'hacky'.

Fixes: https://github.com/xamarin/xamarin-macios/issues/7108
2019-09-26 17:07:57 -04:00
Manuel de la Pena 2cea3568b9
[AppKit] Add missing Accessibility protocols. (#7105) 2019-09-26 09:46:38 -04:00
Alex Soto cd5917650e
[mono] Bump mono to match android (#7104)
* [mono] Bump mono to match android

4546440471...c99adb97ed

* [tests] Add workaround for xamarin/maccore#1996.
2019-09-26 08:39:49 -04:00
Vincent Dondain 253900cf00
Bump for Xcode 11.1 GM (#7090)
- Fixes https://github.com/xamarin/xamarin-macios/issues/7045
- Fixes Xcode path and point API diff to HEAD of d16-3
- Ignore ScanForPeripherals & RetrievePeripherals tests for now (https://github.com/xamarin/xamarin-macios/issues/7108)
2019-09-25 23:13:13 -04:00
Rolf Bjarne Kvinge 1e92a732ef
[mtouch] Tweak watchOS architecture test to build for bitcode when building with llvm. Fixes xamarin/maccore#1994. (#7097)
Tweak the watchOS architecture test to build for bitcode when building with
llvm, since that's what's usually done.

Also tweak the MT0145 error message a bit.

Fixes https://github.com/xamarin/maccore/issues/1994.
2019-09-25 17:06:27 +02:00
monojenkins abfa32c09f [master] [generator] Do not generate PlatformNotSupportedException in chaining .ctor (#7092)
Types that are new in 64bits only OS are generated differently on 32bits
bindings. They mainly throw a `PlatformNotSupportedException` so it's
easier to diagnose (than a crash) what's happening at runtime.

This works well in all cases except one. When a new type, let's say
`UIMenuElement` is added **and** serves as a new base type for existing
types.

`UIKeyCommand` (iOS 7) -> `UICommand` (iOS 13)-> `UIMenuElement` (iOS 13)

This is _correct_ as new base types can be added (in ObjC and C#).
However the generated code for the constructors of `UICommand` and
`UIMenuElement` would be throwing a `PlatformNotSupportedException`
which breaks the `UIKeyCommand` on 32 bits devices.

We fixed this in a few places by tweaking the availability attribute
but that requires spotting the new base type while doing bindings and
that is error prone [1][2].

This PR simply does let the `protected` constructor, using when chaining,
be generated normally. It's simpler and will cover all the cases (without
requiring hacks in the availability of those types)

[1] https://github.com/xamarin/xamarin-macios/issues/7083
[2] https://github.com/xamarin/xamarin-macios/issues/7084
2019-09-24 21:12:59 -04:00
Sebastien Pouliot 6bdce2dac8
[generator] Do not generate PlatformNotSupportedException in chaining .ctor (#7085)
Types that are new in 64bits only OS are generated differently on 32bits
bindings. They mainly throw a `PlatformNotSupportedException` so it's
easier to diagnose (than a crash) what's happening at runtime.

This works well in all cases except one. When a new type, let's say
`UIMenuElement` is added **and** serves as a new base type for existing
types.

`UIKeyCommand` (iOS 7) -> `UICommand` (iOS 13)-> `UIMenuElement` (iOS 13)

This is _correct_ as new base types can be added (in ObjC and C#).
However the generated code for the constructors of `UICommand` and
`UIMenuElement` would be throwing a `PlatformNotSupportedException`
which breaks the `UIKeyCommand` on 32 bits devices.

We fixed this in a few places by tweaking the availability attribute
but that requires spotting the new base type while doing bindings and
that is error prone [1][2].

This PR simply does let the `protected` constructor, using when chaining,
be generated normally. It's simpler and will cover all the cases (without
requiring hacks in the availability of those types)

[1] https://github.com/xamarin/xamarin-macios/issues/7083
[2] https://github.com/xamarin/xamarin-macios/issues/7084
2019-09-24 16:24:08 -04:00
Rolf Bjarne Kvinge 2adecee3d9
Drop the Xcode 9.4 dependency. (#7044)
* Drop the Xcode 9.4 dependency.

Also bump mono to get the removal of the mac32 binaries.

New commits in mono/mono:

* mono/mono@70d6903053 [2019-08] [merp] Use a separate program as the hang supervisor. (#16900)
* mono/mono@4bff2b6370 [offsets-tool] Install clang into the user-specific python directory.
* mono/mono@81894ec8ca Implement WriteCore and ReadCore in DeflateStream
* mono/mono@bfbf823ca1 [ci] Remove more XCODE32_DIR usages (#16964)
* mono/mono@ce01b20a4d Add net_4.8.xml to EXTRA_DIST and bump binary-reference-assemblies again
* mono/mono@7a587d7fa6 Add .NET 4.8 reference assemblies (#16912)
* mono/mono@35e454a8f6 [sdks] Remove the mac32 build. (#16936)
* mono/mono@75eb342f53 [2019-08] [System] Make FileSystemWatcher backend non-static (#16926)
* mono/mono@5881981f79 [2019-08] [mini] Add missing membars when initializing rgctx entries (#16909)
* mono/mono@6290b6cd6e Temporarily disable embedded ppdb data decompression (#16911)
* mono/mono@a0e7f9eaf2 [2019-08] [arm64_32] make "Debug Mode" work on Watch series 4 with --interpreter (#16886)
* mono/mono@6275840a7f Rename bundle identifier for the various Mono.frameworks we create for Xamarin.iOS. Fixes xamarin/xamarin-macios#7005. (#16901)
* mono/mono@25f6093283 [corlib] Fix building nunit-lite twice (#16895)
* mono/mono@7ec17ba1be [2019-08] [android sdk] Add aprofutil tool (#16884)
* mono/mono@f755f3b539 [metadata] Fix leaks when handling a few attributes (#16850)
* mono/mono@5f9a2db39b [2019-08] Fix infrequent hangs in test-runner. (#16854)
* mono/mono@f31f5ea1f1 [2019-08] [threads] do not convert NULL thread name (#16828)
* mono/mono@20308e6f87 [aot] Do not wrap tool_prefix path when calling strip (#16820)
* mono/mono@cecda47c48 [aprofutil] Add -p and -f options
* mono/mono@824cc12ac3 Bump to mono/corefx@e79cf5b
* mono/mono@b77dc06a7e [aprofutil] Install the tool correctly (#16112)
* mono/mono@1848d78d60 [aotprof-tool] Initial import of AOT profiler tool (#15384)
* mono/mono@da0086e304 [2019-08] Add RenamedEvent* to FSW sources from CoreFX (#16756)
* mono/mono@0297b21b03 [msbuild][roslyn] Bump msbuild and roslyn to pull in new versions (#16768)
* mono/mono@40631e3b9e [2019-08] [aot] move method_addresses to data.rel.so section to avoid text relocations (#16751)
* mono/mono@68b77674e2 Vtable [i] can be null so this should be check before use it. Fixes #16712
* mono/mono@4a0b4f41ed [mini] publish global patches after JitInfo has been added
* mono/mono@7a1f63fde6 [debugger][android] It was not initialising seq_points on MonoCompile on Android, so when was compiling dynamic methods, seq_points wasn't created and we got the assert when try to single step.

Diff: 29b1ac19c9..70d6903053

* [tests] Add a fat macOS dylib for testing purposes.

Add a binary version of a fat macOS dylib (because we can't create one when we
need it since we can't create 32-bit slice anymore).

It was created like this (in tests/test-libraries):

	$ cat test.m
	int theUltimateAnswer ()
	{
		return 42;
	}

	$ /Applications/Xcode94.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang test.m -olibtest.i386.dylib -shared -isysroot /Applications/Xcode94.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -framework Foundation -framework CoreLocation -lz  -arch i386
	$ lipo -create libtest.i386.dylib .libs/macos/libtest.dylib -output libtest-fat.dylib

* [tests] Adjust XM tests to XM not having fat dylibs anymore.

* [tests] Adjust product tests to some libraries not being fat anymore.

* One more test fix.
2019-09-24 13:40:18 +02:00
Bernhard Urban 62466d4c46 [monotouch-tests] reduce amount of test objects to avoid out of memory (#7075)
I get this otherwise on the watch4 in debug mode (with interp):

```
Process 1255 stopped
* thread #1, name = 'tid_303', queue = 'com.apple.main-thread', stop reason = EXC_RESOURCE RESOURCE_TYPE_MEMORY (limit=80 MB, unused=0x0)
    frame #0: 0x1e185ae8 CoreGraphics`x_malloc + 44
CoreGraphics`x_malloc:
->  0x1e185ae8 <+44>: str    w19, [x0], #0x10
    0x1e185aec <+48>: ldp    x29, x30, [sp, #0x10]
    0x1e185af0 <+52>: ldp    x20, x19, [sp], #0x20
    0x1e185af4 <+56>: ret
Target 0: (monotouchtest) stopped.
```
2019-09-24 13:29:56 +02:00
Manuel de la Pena 5703082581
[Metal] Add support up to GM1 of metal. (#7007) 2019-09-23 11:14:15 -04:00
Vincent Dondain a7e50fd89d
[xharness] Bring more joy to the developer when all tests pass 🎉 (#6962) (#7037)
- When everything just works, skip the "test results" header and output that all tests pass with a 🎉 (:
2019-09-20 14:11:03 -04:00
Waleed Chaudhry 1dc3beabfa
[Generator] Provide clear error message on type mismatch with BindAs error (#7016)
* [Generator] Provide clear error message on type mismatch with BindAs attribute that results in  generator crashing. Fixes 6863.
2019-09-19 21:05:22 -04:00
monojenkins 982346cbb3 [xharness] Fix incorrect merge. (#7034)
Add new device tasks to the right list so that they're processed and marked as
ignored correctly later.
2019-09-19 18:53:26 +02:00
Rolf Bjarne Kvinge 7fc8db2fca
[xharness] Fix incorrect merge. (#7032)
Add new device tasks to the right list so that they're processed and marked as
ignored correctly later.
2019-09-19 14:40:32 +02:00
Rolf Bjarne Kvinge e7a5d56dd2 Merge remote-tracking branch 'origin/xcode11' into master-xcode11 2019-09-17 19:44:13 +02:00
Rolf Bjarne Kvinge 80bcb021b3 Merge remote-tracking branch 'origin/xcode11' into d16-3-xcode11-v2 2019-09-17 08:40:53 +02:00
Waleed Chaudhry 706581c1ab Fix broken introspection tests on macOS 10.15. Fixes #6998. (#6999)
* Fix broken introspec tests on macOS 10.15

* Add aliases

* Add fields to .ignore

* Remove new line

* Add comment to .ignore
2019-09-16 23:40:34 -07:00
Rolf Bjarne Kvinge df523c8b18 Merge remote-tracking branch 'origin/xcode11' into d16-3. 2019-09-17 08:30:12 +02:00
Rolf Bjarne Kvinge 5b7ea53e2e [monotouch-test] Fix ProxyTest according to changed behavior in iOS 13.
In iOS 13 it's no longer possible to get PACs from file:// urls (this is
explained in the release notes, so it's expected). So launch a local
httpserver and serve the PAC that way.
2019-09-16 15:21:29 +02:00