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

960 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge c199c9f2c2 [mtouch] Show a nice error (MT4168) if the user registers a managed class with an Objective-C keyword. Fixes #51776. (#2150)
Previously:

    obj/iPhone/Ad-Hoc/mtouch-cache/64/registrar.m:4402:12: error: expected identifier
    @interface register : UITableViewController {
    ^
    obj/iPhone/Ad-Hoc/mtouch-cache/64/registrar.m:4402:21: error: expected unqualified-id
    @interface register : UITableViewController {

    error : Failed to compile the generated registrar code. Please file a bug report at http://bugzilla.xamarin.com

Now:

    error MT4168: Cannot register the type 'register' because its Objective-C name 'register' is an Objective-C keyword. Please use a different name.

https://bugzilla.xamarin.com/show_bug.cgi?id=51776
2017-05-31 19:07:02 +02:00
Rolf Bjarne Kvinge 57ff742bd9 [xharness] Silence scary debug spew. (#2146) 2017-05-31 17:34:26 +02:00
Rolf Bjarne Kvinge b4331523f6 [tests] Don't cap return value to 32-bit on 64-bit platforms in NSArrayTest.Sort. Fixes #53298. (#2149)
https://bugzilla.xamarin.com/show_bug.cgi?id=53298
2017-05-31 17:33:00 +02:00
Chris Hamons 0be72f3c13 [macos] Fix target framework detection issues in mmp (#2096)
- Also detect mismatches between referenced XM.dll and target framework selected
2017-05-30 09:23:28 -05:00
Andi McClure a6cf8c5edc [Do not merge yet] Update to mono 2017-04 branch (#1960)
* Update to mono 2017-04 branch

* Patch from Zoltan to fix build error with CppSharp.CppParser.dll

* Include new linker files in Makefile, based on mareks commit

* [msbuild] Fix running bgen for Xamarin.Mac.

bgen must be executed with the system mono, not bmac-mobile-mono, and without
the MONO_PATH variable set.

* System.Data tests should act as if they are running on mobile profile

* Add --runtime=mobile to mono flags in Modern

* Move runtime launcher options up

* System.Data tests should use Mobile profile (mac fix)

* Bump 2017-04 to pick up AOT and assembly resolution fixes

* Build fixes for netstandard.dll and System.Drawing.Primitives.dll

The new handling went in with https://github.com/mono/mono/pull/4501.

I also noticed that WatchOS was missing a target for System.Drawing.Primitives.dll, so I added that.

* Add netstandard.dll to 2.1/Facades and System.Drawing.Primitives.dll to WatchOS

* Fix 2.1/Facades/netstandard.dll build

* Fix the netstandard targets

* Bump mono to latest 2017-04 commit

* [xharness] Fix adding defines to csproj by correctly detecting existing defines.

* Bump mono to latest 2017-04 commit

* [mtouch] Update csproj with new files.

* [mtouch] Improve reporting for MarkExceptions from the linker.

* Bump mono to latest 2017-04 commit

* Bump mono to pick up latest 2017-04 branch commit (Fixes #55436)

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=55436

* Add a missing Makefile dependency

* Chris Hamons patch to apply --runtime=mobile as necessary at AOT time

(It is currently being applied for some configurations at runtime only)

* Bump system mono

* Bump mono for assembly loader changes

* Bump system mono

* Update assemblies list as some where moved to facades

6ca5ec442b
c38e4d9220

* Bump mono to latest 2017-04 commit

* Add another new facade

* Bump mono to tip of 2017-04.

* Bump mono to tip of 2017-04.

* [tests][mtouch] Adjust tests to cope with fewer assemblies being included in linked apps. Fixes #56307 and #56308.

System.dll is now completely linked away unless the app actually uses any
System.dll API.

This is the change that caused this to change: 4960d5d2a2

Previously the following types would always be kept by the linker:

```
$ monodis --typedef System.dll
Typedef Table
1: (null) (flist=1, mlist=1, flags=0x0, extends=0x0)
2: ObjCRuntime.INativeObject (flist=1, mlist=1, flags=0xa0, extends=0x0)
3: Mono.Net.CFObject (flist=1, mlist=2, flags=0x100000, extends=0x5)
4: Mono.Net.CFArray (flist=4, mlist=19, flags=0x100, extends=0xc)
5: Mono.Net.CFNumber (flist=5, mlist=32, flags=0x100100, extends=0xc)
6: Mono.Net.CFRange (flist=5, mlist=41, flags=0x100108, extends=0x25)
7: Mono.Net.CFString (flist=7, mlist=42, flags=0x100100, extends=0xc)
8: Mono.Net.CFData (flist=8, mlist=53, flags=0x100100, extends=0xc)
9: Mono.Net.CFDictionary (flist=8, mlist=63, flags=0x0, extends=0xc)
10: Mono.Net.CFMutableDictionary (flist=10, mlist=75, flags=0x100100, extends=0x24)
11: Mono.Net.CFUrl (flist=10, mlist=80, flags=0x100100, extends=0xc)
12: Mono.Net.CFRunLoop (flist=10, mlist=83, flags=0x100100, extends=0xc)
13: Mono.Net.CFBoolean (flist=10, mlist=94, flags=0x100, extends=0x5)
14: Mono.AppleTls.SecCertificate (flist=13, mlist=106, flags=0x100100, extends=0x5)
15: Mono.AppleTls.SecIdentity (flist=14, mlist=122, flags=0x100, extends=0x5)
16: Mono.AppleTls.SecIdentity/ImportOptions (flist=19, mlist=134, flags=0x100105, extends=0x5)
17: Mono.AppleTls.SecKey (flist=19, mlist=134, flags=0x100100, extends=0x5)
18: Mono.AppleTls.SecStatusCode (flist=21, mlist=141, flags=0x100, extends=0x69)
19: Mono.AppleTls.SecTrustResult (flist=395, mlist=141, flags=0x100, extends=0x69)
20: Mono.AppleTls.SecImportExport (flist=404, mlist=141, flags=0x100100, extends=0x5)
21: Mono.AppleTls.SecImportExport/<>c (flist=404, mlist=144, flags=0x102103, extends=0x5)
22: Mono.AppleTls.SecPolicy (flist=406, mlist=147, flags=0x100100, extends=0x5)
23: Mono.AppleTls.SecTrust (flist=407, mlist=154, flags=0x100100, extends=0x5)
24: System.Security.Cryptography.OidGroup (flist=408, mlist=174, flags=0x101, extends=0x69)
25: System.Security.Cryptography.Oid (flist=420, mlist=174, flags=0x100101, extends=0x5)
26: System.Security.Cryptography.CAPI (flist=423, mlist=176, flags=0x100180, extends=0x5)
27: System.Security.Cryptography.AsnEncodedData (flist=423, mlist=178, flags=0x100101, extends=0x5)
28: System.Security.Cryptography.X509Certificates.X509Utils (flist=424, mlist=179, flags=0x100100, extends=0x5)
29: System.Security.Cryptography.X509Certificates.PublicKey (flist=424, mlist=181, flags=0x100101, extends=0x5)
30: System.Security.Cryptography.X509Certificates.X509Certificate2 (flist=429, mlist=188, flags=0x102101, extends=0x51)
31: System.Security.Cryptography.X509Certificates.X509Certificate2Impl (flist=431, mlist=204, flags=0x100080, extends=0x55)
32: System.Security.Cryptography.X509Certificates.X509CertificateCollection (flist=431, mlist=209, flags=0x102101, extends=0x6d)
33: System.Security.Cryptography.X509Certificates.X509CertificateCollection/X509CertificateEnumerator (flist=431, mlist=212, flags=0x100102, extends=0x5)
34: System.Security.Cryptography.X509Certificates.X509Helper2 (flist=432, mlist=217, flags=0x100180, extends=0x5)
35: <PrivateImplementationDetails> (flist=432, mlist=218, flags=0x100, extends=0x5)
36: <PrivateImplementationDetails>/__StaticArrayInitTypeSize=9 (flist=433, mlist=219, flags=0x113, extends=0x25)
```

Some of the above types from System.dll implemented ObjCRuntime.INativeObject
(from System.dll), which our linker detected as implementing
ObjCRuntime.INativeObject (from Xamarin.iOS.dll), so these types were treated
as custom NSObject subclasses, and the MarkNSObjects linker step would mark
them (which would in turn cause all the other types in the list to be marked).

With that change, these types now implement ObjCRuntimeInternal.INativeObject,
and the linker does not treat them as custom NSObject subclasses anymore.

I think the new behavior is correct: these types do not actually inherit from
the real NSObject/INativeObject, so the linker should not treat them as such.

This may run into different bugs because the linker might now remove more
stuff than before, but that would be a different issue.

This means that the fix is to modify these tests accordingly.

https://bugzilla.xamarin.com/show_bug.cgi?id=56307
https://bugzilla.xamarin.com/show_bug.cgi?id=56308

* Bump mono to latest.

* Fix merge conflict that was missed

* [mtouch] Renumber new error which clashes with an existing error number in master.
2017-05-29 18:39:29 +02:00
Rolf Bjarne Kvinge 05895c41f5 [registrar] Add support for specifying that a protocol changed informal status in a certain SDK. Fixes #43780 and #48311. (#2130)
* [registrar] Add support for specifying that a protocol changed informal status in a certain SDK. Fixes #43780

Add support for specifying that an informal protocol became a formal protocol
(or the reverse) in a certain SDK version, so that the static registrar can
generate the correct code based on the SDK being built with.

This also fixes a series of compiler warnings when using the static registrar:

    In file included from Xamarin.Mac.registrar.full.i386.m:1:
    ./Xamarin.Mac.registrar.full.i386.h:374:11: warning: duplicate protocol definition of 'CALayerDelegate' is ignored
    @protocol CALayerDelegate
              ^
    /Applications/Xcode83.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CALayer.h:798:11: note: previous definition is here
    @protocol CALayerDelegate <NSObject>
              ^
    In file included from Xamarin.Mac.registrar.full.i386.m:1:
    ./Xamarin.Mac.registrar.full.i386.h:824:11: warning: duplicate protocol definition of 'WebDownloadDelegate' is ignored
    @protocol WebDownloadDelegate
              ^
    /Applications/Xcode83.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/WebKit.framework/Headers/WebDownload.h:60:11: note: previous definition is here
    @protocol WebDownloadDelegate <NSURLDownloadDelegate>
              ^
    In file included from Xamarin.Mac.registrar.full.i386.m:1:
    ./Xamarin.Mac.registrar.full.i386.h:851:11: warning: duplicate protocol definition of 'WebFrameLoadDelegate' is ignored
    @protocol WebFrameLoadDelegate
              ^
    /Applications/Xcode83.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/WebKit.framework/Headers/WebFrameLoadDelegate.h:51:11: note: previous definition is here
    @protocol WebFrameLoadDelegate <NSObject>
              ^
    In file included from Xamarin.Mac.registrar.full.i386.m:1:
    ./Xamarin.Mac.registrar.full.i386.h:866:11: warning: duplicate protocol definition of 'WebPolicyDelegate' is ignored
    @protocol WebPolicyDelegate
              ^
    /Applications/Xcode83.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/WebKit.framework/Headers/WebPolicyDelegate.h:138:11: note: previous definition is here
    @protocol WebPolicyDelegate <NSObject>
              ^
    In file included from Xamarin.Mac.registrar.full.i386.m:1:
    ./Xamarin.Mac.registrar.full.i386.h:869:11: warning: duplicate protocol definition of 'WebResourceLoadDelegate' is ignored
    @protocol WebResourceLoadDelegate
              ^
    /Applications/Xcode83.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/WebKit.framework/Headers/WebResourceLoadDelegate.h:46:11: note: previous definition is here
    @protocol WebResourceLoadDelegate <NSObject>
              ^
    In file included from Xamarin.Mac.registrar.full.i386.m:1:
    ./Xamarin.Mac.registrar.full.i386.h:872:11: warning: duplicate protocol definition of 'WebUIDelegate' is ignored
    @protocol WebUIDelegate
              ^
    /Applications/Xcode83.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/WebKit.framework/Headers/WebUIDelegate.h:153:11: note: previous definition is here
    @protocol WebUIDelegate <NSObject>
              ^

https://bugzilla.xamarin.com/show_bug.cgi?id=43780

* [registrar] Use a string to specify when a protocol went from informal to formal.

Use a string to specify when a protocol went from informal to formal, and
don't support the reverse condition (going from formal to informal), since
it's currently not needed and makes the code more complicated and harder to
understand.

Also add an mtouch test, and update an existing mmp test to be more restrictive.

* [registrar] Rename from 'InformalUntil' to 'FormalSince'.

It just sounds better.
2017-05-29 16:15:54 +02:00
Alex Soto 43e220df7f [generator] Keep [NotImplemented] info so it is usable in 3rd party bindings. Fixes bug 52664 (#2131)
* [generator] Keep [NotImplemented] info so it is usable in 3rd party bindings. Fixes bug 52664

https://bugzilla.xamarin.com/show_bug.cgi?id=52664

Currently we do not keep the [NotImplemented](0) information and the
generator gets a little confused because it will not find an Export
inside the getters/setters of properties and there is no way to tell
if this was intentional or not. We now keep the [NotImplemented]
and also add some null checks in the generator where needed.

Reenabled tests disabled in 9f036b218a

[0]: https://developer.xamarin.com/guides/cross-platform/macios/binding/objective-c-libraries/#Objective-C_Mutable_Pattern_and_Properties

* [generator] Implement feedback

* Added quote method
* Teach linker about NotImplementedAttribute

* [generator] Improve Quote method

* [generator] Fix quote now for realsssss
2017-05-25 14:42:25 -05:00
Rolf Bjarne Kvinge 4b4e14119d [xharness] Fix generated makefile to avoid generating duplicated targets. Fixes #56492. (#2129)
Rework how the two different xammac configurations are done, so that we don't
generate identical makefile targets for both variations (we'll generate a
single makefile target, and the configuration is selected using an environment
variable).

Fixes these makefile warnings:

Makefile-mac.inc:303: warning: overriding commands for target `build-mac-unified-xammac_tests'
Makefile-mac.inc:287: warning: ignoring old commands for target `build-mac-unified-xammac_tests'
Makefile-mac.inc:307: warning: overriding commands for target `clean-mac-unified-xammac_tests'
Makefile-mac.inc:291: warning: ignoring old commands for target `clean-mac-unified-xammac_tests'
Makefile-mac.inc:310: warning: overriding commands for target `exec-mac-unified-xammac_tests'
Makefile-mac.inc:294: warning: ignoring old commands for target `exec-mac-unified-xammac_tests'
Makefile-mac.inc:313: warning: overriding commands for target `run-mac-unified-xammac_tests'
Makefile-mac.inc:297: warning: ignoring old commands for target `run-mac-unified-xammac_tests'

https://bugzilla.xamarin.com/show_bug.cgi?id=56492
2017-05-25 07:11:36 +02:00
Rolf Bjarne Kvinge 1548594e7b [mtouch] Allow code sharing assemblies from multiple locations if they're identical. Fixes #56513. (#2119)
* [mtouch] Allow code sharing assemblies from multiple locations if they're identical. Fixes #56498.

We disallow code sharing when the same assembly (based on name) is referenced
from multiple paths, but poke a hole in this logic by allowing the same
assembly from multiple paths when those assemblies are 100% identical, since
that should be 100% safe.

https://bugzilla.xamarin.com/show_bug.cgi?id=56498

* [tests] Comment out assert that asserts due to another bug.
2017-05-25 07:10:56 +02:00
Rolf Bjarne Kvinge ea15ebd859 [mtouch] Don't look for assembly references in attributes in assemblies we ship. Partially fixes #49087. (#2121)
* [mtouch] Don't look for assembly references in attributes in assemblies we ship. Partially fixes #49087.

Don't look for assembly references in attributes in assemblies we ship,
because it takes a significant amount of time to do this, and we can
precompute the fact that there aren't any such assembly references.

Additionally add a test to ensure we catch any changes to this assumption.

For a simple test app this makes rebuilding (without any changes) go from
~1.1s to ~0.4s.

https://bugzilla.xamarin.com/show_bug.cgi?id=49087

* [tests] Simplify tests to not use [TestCaseSource].

Using [TestCaseSource] is nice when running from the IDE, since it shows all
test cases in the test tree.

Unfortunately it causes the console runner to freak out [1], because the method
that lists all the test cases calls Configuration's cctor, which calls
TestContext.CurrentContext.TestDirectory, which is apparently not safe this
early in the test run.

[1] I think 'freak out' is the appropriate term for this behavior, which has
absolutely no direct nor obvious connection to the cause of the problem:

System.Runtime.Remoting.RemotingException: Cannot create channel sink to connect to URL 93a78115_c0da_4b6a_9661_9f9b9d9fb935/6669afd6_4.rem. An appropriate channel has probably not been registered.

Server stack trace:
  at System.Runtime.Remoting.RemotingServices.GetClientChannelSinkChain (System.String url, System.Object channelData, System.String& objectUri) [0x00019] in <04300341516a482b9708b764d58af7ca>:0
  at System.Runtime.Remoting.RemotingServices.GetOrCreateClientIdentity (System.Runtime.Remoting.ObjRef objRef, System.Type proxyType, System.Object& clientProxy) [0x0001d] in <04300341516a482b9708b764d58af7ca>:0
  at System.Runtime.Remoting.RemotingServices.GetRemoteObject (System.Runtime.Remoting.ObjRef objRef, System.Type proxyType) [0x00000] in <04300341516a482b9708b764d58af7ca>:0
  at System.Runtime.Remoting.RemotingServices.GetProxyForRemoteObject (System.Runtime.Remoting.ObjRef objref, System.Type classToProxy) [0x0001b] in <04300341516a482b9708b764d58af7ca>:0
  at System.Runtime.Remoting.RemotingServices.Unmarshal (System.Runtime.Remoting.ObjRef objectRef, System.Boolean fRefine) [0x0007a] in <04300341516a482b9708b764d58af7ca>:0
  at System.Runtime.Remoting.RemotingServices.Unmarshal (System.Runtime.Remoting.ObjRef objectRef) [0x00000] in <04300341516a482b9708b764d58af7ca>:0
  at System.Runtime.Remoting.ObjRef.GetRealObject (System.Runtime.Serialization.StreamingContext context) [0x0000f] in <04300341516a482b9708b764d58af7ca>:0
  at System.Runtime.Serialization.ObjectManager.ResolveObjectReference (System.Runtime.Serialization.ObjectHolder holder) [0x00010] in <04300341516a482b9708b764d58af7ca>:0
  at System.Runtime.Serialization.ObjectManager.DoFixups () [0x0007f] in <04300341516a482b9708b764d58af7ca>:0
  at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize (System.Runtime.Remoting.Messaging.HeaderHandler handler, System.Runtime.Serialization.Formatters.Binary.__BinaryParser serParser, System.Boolean fCheck, System.Boolean isCrossAppDomain, System.Runtime.Remoting.Messaging.IMethodCallMessage methodCallMessage) [0x00077] in <04300341516a482b9708b764d58af7ca>:0
  at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize (System.IO.Stream serializationStream, System.Runtime.Remoting.Messaging.HeaderHandler handler, System.Boolean fCheck, System.Boolean isCrossAppDomain, System.Runtime.Remoting.Messaging.IMethodCallMessage methodCallMessage) [0x000a2] in <04300341516a482b9708b764d58af7ca>:0
  at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize (System.IO.Stream serializationStream, System.Runtime.Remoting.Messaging.HeaderHandler handler, System.Boolean fCheck, System.Runtime.Remoting.Messaging.IMethodCallMessage methodCallMessage) [0x00000] in <04300341516a482b9708b764d58af7ca>:0
  at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.DeserializeMethodResponse (System.IO.Stream serializationStream, System.Runtime.Remoting.Messaging.HeaderHandler handler, System.Runtime.Remoting.Messaging.IMethodCallMessage methodCallMessage) [0x00000] in <04300341516a482b9708b764d58af7ca>:0
  at System.Runtime.Remoting.Channels.BinaryClientFormatterSink.SyncProcessMessage (System.Runtime.Remoting.Messaging.IMessage msg) [0x00083] in <270c90abbc234cde9d33eb198a97cf71>:0
2017-05-24 21:05:21 +02:00
Rolf Bjarne Kvinge d672fbf9dd [xharness] Don't wait forever for output streams to end. (#2122)
Sometimes streams won't write null when done, which means that if we wait
indefinitely for this to happen, we'll effectively deadlock.

Instead have a 1s timeout, after which we consider that we've captured
everything we need.

Example: https://jenkins.mono-project.com/job/xamarin-macios-pr-builder/3771/Test_Report/
(the test run hangs waiting for the mtouch tests, which finished pretty much instantly).
2017-05-24 21:04:18 +02:00
Rolf Bjarne Kvinge a161f64415 [xharness] Fix a few failure logging scenarios to not throw exceptions. (#2123)
The "Failed to load simulators" line would throw a sharing violation, because
the log object already has the file open.
2017-05-24 21:03:59 +02:00
Rolf Bjarne Kvinge 74f1bb0acc [mmptest] Delay test directory cleanup until next test run. (#2115)
Use our Cache.CreateTemporaryDirectory method which will clean up the test
directories on the next test run (instead of when a test is done).

This makes it easier to inspect temporary test files after a test has
completed.
2017-05-22 17:44:06 +02:00
Rolf Bjarne Kvinge 9b872a154a [mmp] Fix release builds when not embedding mono. (#2114)
The generated registrar code must be built with -DDYNAMIC_MONO_RUNTIME so that
it references our local mono functions which do a dynamic function lookup.

This fixes an issue where release builds that don't embed mono fails to link,
because there are numerous unresolved externals pointing to mono symbols.
2017-05-22 07:39:10 +02:00
Rolf Bjarne Kvinge fafaa91790 [tests] Update tests-mac.sln to make sure configurations are right. (#2113)
I don't quite understand VSfM's problem with the existing configuration (it
wouldn't build mmptest, claming an invalid solution configuration), but
hopefully these will work fine.
2017-05-22 07:36:51 +02:00
Alex Soto b75f8eda31 [generator] Create CVPixelBuffer using GetINativeObject so its usable from 3rd party bindings (#2111)
* [generator] Create CVPixelBuffer using GetINativeObject so its usable from 3rd party bindings

Complements https://bugzilla.xamarin.com/show_bug.cgi?id=52665
and PR #2102

CVPixelBuffer was created using the internal handle ctor, this
did not allow 3rd party bindings to bind it correctly since it
generated not compilable code.

We now use Runtime.GetINativeObject<CVPixelBuffer> (ptr, false); just
like the base ctor https://git.io/vHvLj.

* [tests] Add IntPtr.Zero check and fix link in code

* [generator] Make comment easier to find
2017-05-19 11:10:22 -05:00
Rolf Bjarne Kvinge 0c87730ff1 [mtouch] Fix linking with the same third-party framework from both extension and container app. Fixes #56635. (#2112)
If both an extension and the container app (or multiple extensions) reference
the same binding assembly for a framework, then we'd error out with an
internal error when trying to copy the framework from both locations to the
container app.

So instead detect when we're trying to copy multiple identical (by comparing
the on-disk contents) frameworks, and only copy one of them.

We'll still show an error if the frameworks are different, but now a nice
MT1035 error with a proper error description instead of an internal error.

https://bugzilla.xamarin.com/show_bug.cgi?id=56635
2017-05-19 17:05:38 +02:00
Rolf Bjarne Kvinge 9466ae5080 [registrar] Support 'out' parameters from NULL pointers. Fixes #54919. (#2106)
[registrar] Support 'out' parameters from NULL pointers. Fixes #54919.

Native code doesn't have the 'out' and 'ref' distinction C# has, and passes
NULL around left and right.

So make sure the generated code from the static registrar doesn't write to such NULLs.

https://bugzilla.xamarin.com/show_bug.cgi?id=54919
2017-05-19 12:07:12 +02:00
Alex Soto 9621842016 [generator] Deriving from certain protocol interfaces generates uncompilable code. Fixes bug 52665 (#2102)
Some namespaces are missing on generated files, causing error CS0246
The type or namespace name `Foo` could not be found.

While fixing this another error arose, by enabling the following test

[Protocol] interface C140 : ICIImageProcessorInput {}

some codepaths leads to CVPixelBuffer creation which our code
tries to invoke the handle ctor and fails to find it because it
is internal. This will be fixed in a different commit.
2017-05-18 12:42:57 -04:00
Sebastien Pouliot 6f68ab6f79 [tests][security] Re-enable some tests inside KeyTest. Fix #51277 (#2103)
The minimum size for RSA keypairs is 1024 bits on macOS while it is
512 bits on iOS. Some tests using the minimum size (because we test the
API not the security) were disable on macOS. This re-enables them using
the platform minimum.

https://bugzilla.xamarin.com/show_bug.cgi?id=51277
2017-05-17 21:59:35 -04:00
Sebastien Pouliot 845f365c91 [mmp] Add support for linking only the platform (Xamarin.Mac.dll) assembly on the full profile (#1990)
Replace https://github.com/xamarin/xamarin-macios/pull/1973 expect that
the test parts are still needed.

* Add XM SDK + LinkSkip test

* [macos] Add platform linking support to msbuild

* [macos] Add full SDK test

* [macios] Diable classic from using linkplatform

- Extended test infrastructure change to allow classic projects that include bundling
- Setting linkplatform in MonoBundlingExtraArgs since we don't even read project setting LinkMode - Platform for classic
2017-05-16 18:05:26 -04:00
Chris Hamons 562560d936 Fixup Xamarin.Mac Hybrid AOT and improve testing (#1995)
- Actually enable hybrid AOT by adding argument in right location
- Hybrid AOT and stripping does not play well currently with partial AOT
- Fix AOT makefile to work with nuget nunit
- https://bugzilla.xamarin.com/show_bug.cgi?id=55041
2017-05-16 13:29:08 -05:00
Chris Hamons 30cf1fd626 [macos] Fix Multiple Native References (#2073)
- https://bugzilla.xamarin.com/show_bug.cgi?id=56098
- "%(NativeReference) was invoking mmp task multiple times incorrectly, move to what XI is doing
2017-05-16 09:59:55 -05:00
Rolf Bjarne Kvinge d395249480 [xharness] Set the test name correctly so that macOS and iOS variations of the same tests are grouped together in the html report. (#2082)
This affects introspection-ios/introspection-mac (which are now grouped in an
`introspection` test), and dontlink-mac (which now shows up in the `dont link`
tests).
2017-05-10 17:17:39 +02:00
Rolf Bjarne Kvinge c58996b604 [xharness] Remove duplicated code. (#2083)
This chunk of code is repeated 30 lines below.
2017-05-10 17:17:10 +02:00
Rolf Bjarne Kvinge d5a69906c1 [xharness] Make sure different variations of the xammac tests aren't run in parallel. Fixes #56161. (#2081)
We run the xammac tests both in Debug and Release mode now, but those two
modes can't be run in parallel, so make sure they don't.

https://bugzilla.xamarin.com/show_bug.cgi?id=56161
2017-05-10 17:16:40 +02:00
Rolf Bjarne Kvinge 469133a8fd [ObjCRuntime] Remove XM limitation. Fixes #55857. (#2076)
* [ObjCRuntime] Remove XM limitation. Fixes #55857.

I can't remember why I added this limitation, and git history provides now
clues.

Everything compiles without the limitation, and the bug is fixed, so I can't
see a reason not to fix it.

https://bugzilla.xamarin.com/show_bug.cgi?id=55857

* [tests] Run xammac tests both in Debug and Release configurations.
2017-05-10 10:08:56 +02:00
Rolf Bjarne Kvinge 0a6dba5bba [xharness] Reduce code duplication a bit. (#2071) 2017-05-09 07:34:11 +02:00
Rolf Bjarne Kvinge 03589db5ba [mmp/mtouch/ObjCRuntime] Calculate the path to the runtime-options.plist using NSBundle's ResourcePath. (#2072)
* [mmp/mtouch/ObjCRuntime] Calculate the path to the runtime-options.plist using NSBundle's ResourcePath.

The anatomy of apps and frameworks differ between iOS and macOS:

* iOS: we put runtime-options.plist in the root directory of the app.
* macOS:
  * for apps we put runtime-options in foo.app/Contents/Resources
  * for frameworks we put runtime-options in foo.framework/Versions/Current/A/Resources

Luckily NSBundle's ResourcePath property returns exactly this path, so change
our logic to use this property.

Also calculate the NSBundle using an exported type we know we have (using the
main bundle won't work when we're a framework).

* [tests] Add mmp/mtouch tests to verify the default HttpClientHandler according to build arguments.

* [ObjCRuntime] Use a custom class for finding the bundle.

Use a self-defined custom class to find the bundle where our resources are.
Using the internal NSObject.NSObject_Disposer class doesn't work when this
file (RuntimeOptions.cs) is compiled into System.Net.Http.dll.
2017-05-08 17:58:21 +02:00
Rolf Bjarne Kvinge 336dc74fa2 [tests] Convert mmp tests to a standard NUnit test library. (#2067)
* [tests] Convert mmp tests to a standard NUnit test library.

* [xharness] Add support for restoring nugets before building projects.

And restore nugets for tests-mac.sln before building mac test projects.
2017-05-08 13:20:01 +02:00
Rolf Bjarne Kvinge 6c98ed2956 [tests] Fix spleling. (#2066) 2017-05-05 15:11:11 +02:00
Rolf Bjarne Kvinge 1eb6c335a6 [mtouch] Disable incremental builds for the simulator. Fixes #55712. (#2054)
It does not make sense to support incremental builds for the simulator (since
no AOT compilation is done), it just makes the test matrix more complicated.

So simplify things by removing support for incremental builds.

We also ignore any (other) --assembly-build-target arguments, because building
to frameworks doesn't make sense either in the simulator.

https://bugzilla.xamarin.com/show_bug.cgi?id=55712
2017-04-28 13:34:37 -04:00
Rolf Bjarne Kvinge af0bc93ee3 [tests] Clean up after tests on wrench to minimize the peak diskspace requirements. (#2047) 2017-04-27 14:30:04 +02:00
Rolf Bjarne Kvinge f445856652 Merge pull request #2039 from rolfbjarne/e4k-static-registrar
Add support for the embeddinator in the static registrar.
2017-04-27 06:54:34 +02:00
Chris Hamons d0963e2097 [macos] Fix test failure in CertificateTest (#2036)
- SecCertificateCopyEmailAddresses behaves differently on macOS than iOS with
 macOS getting the "documented" behavior of returning an empty array and iOS
 returning null.
- Fix the test to just accept null or 0 elements
2017-04-26 13:22:19 -05:00
Rolf Bjarne Kvinge fb89076593 [tests] Fix mmptest after static registrar change causing warnings to be reported for header instead of implementation file. 2017-04-26 18:39:07 +02:00
Sebastien Pouliot 63a67b5287 Merge pull request #2040 from rolfbjarne/bug55555
[mtouch] Don't remove information when collecting all architectures. Fixes #55555.
2017-04-25 21:29:53 -04:00
Rolf Bjarne Kvinge d8d9a96254 [mtouch] Add support for stripping bitcode from frameworks when not needed. Fixes #55256. (#2037)
This dramatically decreases the size of watchOS apps built for debug when
using frameworks, because it ends up removing all the bitcode from
Mono.framework.

https://bugzilla.xamarin.com/show_bug.cgi?id=55256
2017-04-25 17:46:41 +02:00
Rolf Bjarne Kvinge f6cbea8545 [mtouch] Don't remove information when collecting all architectures. Fixes #55555.
Of particular importance is if we're building for LLVM or not: this fixes a
bug where we wouldn't pass --llvm to the AOT compiler when compiling
assemblies to frameworks (which we do when sharing code).

https://bugzilla.xamarin.com/show_bug.cgi?id=55555
2017-04-25 14:32:08 +02:00
Rolf Bjarne Kvinge 6b89100044 Merge pull request #2019 from rolfbjarne/embeddinator-4000
Add embeddinator support.
2017-04-20 10:09:02 +02:00
Rolf Bjarne Kvinge 144ff1a6ba [mtouch] A few adjustments after allowing multiple root assemblies.
* Remove the MT0008 test, since the error will never be shown again.
* Check non-existent root assemblies and report MT0018 instead of MT0007 if
  they look like command-line arguments.
* Collect all MT0018/MT0007 errors before reporting any of them.
2017-04-19 19:08:59 +02:00
Rolf Bjarne Kvinge bb288e8c60 [tests] Bump mono to get fix for bug #54578 and add test case. (#2026)
https://bugzilla.xamarin.com/show_bug.cgi?id=54578
2017-04-19 09:54:47 -04:00
Zoltan Varga 3334846365 [tests] Fix the test target names in bcl-test/Make.frag. Not used. 2017-04-18 00:03:22 -04:00
Rolf Bjarne Kvinge 30b21dcc0e [xharness] Fix async code to propagate exceptions correctly. (#1991)
This fix will ensure that xharness won't hang when failing to list simulators.
2017-04-12 07:53:30 +02:00
Rolf Bjarne Kvinge 651a9735ff Use Visual Studio instead of Xamarin Studio. (#1972)
* Use Visual Studio instead of Xamarin Studio.

* VS doesn't have mdtool, it has vstool.

Also there's no need to manually invoke the mdtool.exe executable anymore
(which we did because the mdtool executable had a min macOS version of 10.9,
and we used to build tests on older macOS versions [1]), since now we only run
tests on older macOS versions, we don't build those tests there.

[1] a1932b0ccd
2017-04-11 08:13:34 +02:00
Alex Soto 3fe0d2010a [CoreText] CTParagraphStyle uses the incorrect float return type. Fixes bug 54148. (#1975)
* [CoreText] Fix bug 54148 - CoreText.CTParagraphStyle does not pick up settings from CTParagraphStyleSettings

https://bugzilla.xamarin.com/show_bug.cgi?id=54148

CTParagraphStyle float properties have the incorrect float return type,
the headers state this API's returns CGFloats (aka nfloat) instead of floats
this used to work ok fetching them due to there is no difference in size
for 32 bits devices but once 64 bit devices appeared the API began to fail

The actual method that fetches the values `CTParagraphStyleGetValueForSpecifier`
asks for the size of the returned data and we used to give the size of a float
which is incorrect in 64 bits devices and the API call just correctly returned
false because it could not write back the value to us.

Added tests for the full properties available on CTParagraphStyle

* Add comment about the weird Dispose method implementation in CreateFromSettings
2017-04-10 08:24:25 +02:00
Alex Soto 2a85ec1674 [mtouch] Remove workaround for bug 43462, this fixes slow builds (bug 52545) (#1976)
https://bugzilla.xamarin.com/show_bug.cgi?id=52545

Some projects took a lot of time to build with the workaround for
bug 43462 but now that it is fixed we can remove it and stop the slowness
2017-04-10 08:20:13 +02:00
Chris Hamons 0d4243d793 [macos] Fix XM projects with p/invokes into non-system frameworks (#1968)
- Broken by d20ccf5bc6
2017-04-07 11:19:39 +02:00
Rolf Bjarne Kvinge 0a89324b16 [mtouch] Copy aot data to the app even for assemblies that aren't copied. Fixes #54499. (#1964)
We want to copy the aot data for both the 32-bit and the 64-bit versions of an
assembly even if the 32-bit and 64-bit versions of the assembly are identical.

https://bugzilla.xamarin.com/show_bug.cgi?id=54499
2017-04-06 14:29:38 +02:00
Chris Hamons d20ccf5bc6 [macos] Rework framework/weak_framework handling in mmp (#1953)
- Before this mmp was not adding -framework, -weak_framework consistently on non-static registrar use cases
- GatherFrameworks was previously not ported from mtouch, and did not work as DeploymentTarget was unset in mmp
- Added verbose prints so users can determine why various framework linkages are added
- Fixed an issue where duplicate were being added due to HandleFramework shoving args by hand
- Tested with auto test and https://github.com/chamons/xm-version-regression-test manual test
2017-04-05 14:38:40 -05:00
Sebastien Pouliot dbb41ee852 [tests][linkall] Make sure the compiler won't remove a field that triggers the inclusion of OpenTK-1.dll. Fixes #54466 (#1961)
Roslyn, when building in release, can remove unused fields. That broke
a test that ensure OpenTK types got preserved correctly (because the
assembly is not needed/included without that reference)

https://bugzilla.xamarin.com/show_bug.cgi?id=54466
2017-04-05 11:52:27 -05:00
Sebastien Pouliot bb0ea60a95 [tests] Remove OptimizeGeneratedCodeTest.IntPtrSizeOptimization. Fixes #54408 (#1959)
This optimization is now limited to Xamairn.iOS.dll. 3rd parties .dll
size savings were not large enough to justify two different (32/64)
assemblies in the application bundle.

It's likely this change that resulted in incorrect fixes like:

-                       if (classic_or_sim || single_arch) {
+                       if (IsMainExecutableDual ())

which reversed the condition and later
580f502777
which disabled DEBUG - but we don't have IL on release so it became
never executed.

reference:
https://bugzilla.xamarin.com/show_bug.cgi?id=54408
2017-04-04 10:06:52 -05:00
Rolf Bjarne Kvinge 7617df6643 [tests] Fix MSBuild test invocation on wrench. (#1955) 2017-04-03 16:11:05 +02:00
Rolf Bjarne Kvinge 1105ee6136 [tests][mtouch] Fix MT0091 test after error text change. (#1956)
Also fix the test to not depend on having a specific version of an older Xcode
installed, but instead use any old Xcode.
2017-04-03 16:10:42 +02:00
Rolf Bjarne Kvinge 8248a91fed [tests] Fix msbuild-mac project to use a project reference to GuiUnit. (#1950)
xbuild will automatically find and build project references, while directly
referencing the assembly won't.
2017-03-31 11:19:00 +02:00
Chris Hamons 1ec3849617 [macos] Fix msbuild issues with shprojj/projitem library (#1936)
- In some build cases this chunk of code:

    <ItemGroup Condition=" '$(NoCompilerStandardLib)' == 'true' and '$(NoStdLib)' != 'true' ">
          <!-- Note that unlike VB, C# does not automatically locate System.dll as a "standard library"
               instead the reference is always passed from the project. Also, for mscorlib.dll
               we need to provide the explicit location in order to maintain the correct behaviour
     -->
        <_ExplicitReference Include="$(FrameworkPathOverride)\mscorlib.dll" />
    </ItemGroup>

would trigger and force us to use mscorlib from system mono. That does not work well.
- By setting FrameworkPathOverride, we can get the right mscorlib
- However, that ItemGroup happens outside of a target, so we must move our setting to match for it to take effect
2017-03-30 15:04:21 -05:00
Rolf Bjarne Kvinge e19426e073 [tests] Don't create test packages by default. (#1941)
* [tests] Don't create test packages by default.

Don't create test packages by default, instead add a new target to create test
packages. This new target is called on wrench, which means the packages will
still be created when needed, but they won't be built locally in every build
(and if a packaged test fails to build, it won't fail the entire build).

* [tests] Use a project reference instead of assembly reference for GuiUnit.exe

Use a project reference instead of assembly reference for GuiUnit.exe, so that
the GuiUnit reference is automatically built if necessary.

This also makes it required to build a sln for Classic (since mdtool can't
find referenced projects from a csproj).
2017-03-30 18:01:15 +02:00
Rolf Bjarne Kvinge fc28b434c2 [monotouch-test] Fix SystemSoundTest.FromFile's audio file to not take 23s. Fixes #54236. (#1942)
In a6b9c28975 I fixed SystemSoundTest.FromFile
to not crash randomly, and at the same time I added an assert to ensure that
the playback completion handler is called properly, with a 10s timeout.

Which won't work, because the audio file is 23s long.

There's no need for a 23s audio file, so the fix is simple: cut the audio file
to 0.3s instead.

https://bugzilla.xamarin.com/show_bug.cgi?id=54236
2017-03-30 14:33:36 +02:00
Rolf Bjarne Kvinge 6f2a93e8bb [tests] Change ProjectGuid of a few projects to make sure they're unique. (#1943) 2017-03-30 14:33:26 +02:00
Marek Safar 834d169706 Merge branch 'master' into mono-2017-02 2017-03-29 19:20:35 +02:00
Rolf Bjarne Kvinge 3427fb224d [ObjCRuntime] Add assembly registration event. (#1933)
Add an assembly registration event, that allows apps to opt out of
Xamarin.Mac's default behavior to recursively load every assembly referenced
by the entry assembly.

This is only for Xamarin.Mac, since it does not make sense to have this API in
Xamarin.iOS because assemblies are statically registered at build time.
2017-03-29 17:25:28 +02:00
Marek Safar 95b8f2559f Remove Mono.Dynamic.Interpreter from mtouch tests 2017-03-29 16:23:28 +02:00
Alex Soto ed505623be [tests] Fix RequiredMethodAsync test (#1931)
When merging https://github.com/xamarin/xamarin-macios/pull/1913 I
forgot to fix RequiredMethodAsync test, we now expect one instance of
a RequiredMethodAsync as an extension method
2017-03-29 11:12:56 +02:00
Sebastien Pouliot 0dfcb1f09f Merge branch 'master' into mono-2017-02 2017-03-28 21:31:33 -05:00
Sebastien Pouliot abaced76e3 Merge pull request #1923 from spouliot/xcode83-master
Merge xcode8.3 in master
2017-03-28 21:27:18 -05:00
Chris Hamons 3d32ca0c16 [macos] Remove ugly ObjC spam in clang invocation (#1927) 2017-03-28 18:16:51 -05:00
Sebastien Pouliot 18cee459d6 [tests][monotouch] Stop guessing values for CreateCylinder
It's different on all platforms/SDK versions so it's pointless to use
it inside tests.
2017-03-28 18:15:02 -05:00
Sebastien Pouliot 7f650d08c3 [tests] Disable INIntentResolutionResultTests.cs on XM (it's not ready) 2017-03-28 16:31:49 -05:00
Alex Soto 8ef77344bc [Intents] Updated to Xcode 8.3 Beta1 and Beta2 (#1686)
Added more types to INIntentResolutionResultTests

Partial Test log:

[Runner executing:	Run Everything]
[MonoTouch Version:	10.3.99]
[Assembly:	Xamarin.WatchOS.dll (32 bits)]
[GC:	sgen]
[Apple Watch:	watchOS v3.2]
[Device Name:	iMacAlex]
[Device Locale:	en_US]
[Device Date/Time:	2/13/2017 11:45:10 PM]
[Bundle:	com.xamarin.monotouch-test.watchkitapp.watchkitextension]

 monotouchtest.dll

INIntentResolutionResultTests
	[PASS] INIntentResolutionResultTests.INBillPayeeResolutionResultPropertyTest
	[PASS] INIntentResolutionResultTests.INBillTypeResolutionResultPropertyTest
	[PASS] INIntentResolutionResultTests.INBooleanResolutionResultPropertyTest
	[PASS] INIntentResolutionResultTests.INCallRecordTypeResolutionResultPropertyTest
	[PASS] INIntentResolutionResultTests.INCarAirCirculationModeResolutionResultPropertyTest
	[PASS] INIntentResolutionResultTests.INCarAudioSourceResolutionResultPropertyTest
	[PASS] INIntentResolutionResultTests.INCarDefrosterResolutionResultPropertyTest
	[PASS] INIntentResolutionResultTests.INCarSeatResolutionResultPropertyTest
	[PASS] INIntentResolutionResultTests.INCarSignalOptionsResolutionResultPropertyTest
	[PASS] INIntentResolutionResultTests.INCurrencyAmountResolutionResultPropertyTest
	[PASS] INIntentResolutionResultTests.INDateComponentsRangeResolutionResultPropertyTest
	[PASS] INIntentResolutionResultTests.INDateComponentsResolutionResultPropertyTest
	[PASS] INIntentResolutionResultTests.INDoubleResolutionResultPropertyTest
	[PASS] INIntentResolutionResultTests.INIntegerResolutionResultPropertyTest
	[PASS] INIntentResolutionResultTests.INIntentResolutionResultIsAbstractTest
	[PASS] INIntentResolutionResultTests.INMessageAttributeOptionsResolutionResultPropertyTest
	[PASS] INIntentResolutionResultTests.INMessageAttributeResolutionResultPropertyTest
	[PASS] INIntentResolutionResultTests.INPaymentAccountResolutionResultPropertyTest
	[PASS] INIntentResolutionResultTests.INPaymentAmountResolutionResultPropertyTest
	[PASS] INIntentResolutionResultTests.INPaymentStatusResolutionResultPropertyTest
	[PASS] INIntentResolutionResultTests.INPersonResolutionResultPropertyTest
	[PASS] INIntentResolutionResultTests.INPlacemarkResolutionResultPropertyTest
	[PASS] INIntentResolutionResultTests.INRadioTypeResolutionResultPropertyTest
	[PASS] INIntentResolutionResultTests.INRelativeReferenceResolutionResultPropertyTest
	[PASS] INIntentResolutionResultTests.INRelativeSettingResolutionResultPropertyTest
	[PASS] INIntentResolutionResultTests.INSpeakableStringResolutionResultPropertyTest
	[PASS] INIntentResolutionResultTests.INStringResolutionResultPropertyTest
	[PASS] INIntentResolutionResultTests.INTemperatureResolutionResultPropertyTest
	[PASS] INIntentResolutionResultTests.INWorkoutGoalUnitTypeResolutionResultPropertyTest
	[PASS] INIntentResolutionResultTests.INWorkoutLocationTypeResolutionResultPropertyTest
INIntentResolutionResultTests : 20 ms

* [Intent] Workaround for introspection tests

Right now introspection tests fail randomly on two test targets
iOSApiCtorInitTest and iOSApiSelectorTest so we are temporary
removing them from the test suite with the hope  to have them
fixed on the next beta
2017-03-28 14:40:10 -05:00
Vincent Dondain d819d25bff [modelio] Add missing MDLMesh constructors and fix xtro (#1826)
Fixes bug #52575: Missing ModelIO API
(https://bugzilla.xamarin.com/show_bug.cgi?id=52575)

We turn the MDLMesh constructors into static ones because we don't want to lose the shape name.
Also, the signatures of these constructors differ so it would not be possible to use an enum to differentiate the shapes.
2017-03-28 10:08:12 -05:00
Sebastien Pouliot 9686e6464b [tests][xtro] Some fixes, mostly data, so [ios|tvos|watchos].unclassified are empty (#1766)
Also reduce a bit the size of common.unclassified
2017-03-28 10:07:54 -05:00
Manuel de la Pena 8c94c974df [AVFoundation] Fix some minor issues with the Xcode 8.3 bindings. (#1757) 2017-03-28 10:01:04 -05:00
Manuel de la Pena e6130b9735 [AVFoundation] Update bindings for Xcode 8.3 (#1713)
* has some remaining issues that will be fixed in a different PR
2017-03-28 09:56:48 -05:00
Alex Soto c8e4135faa [Intents] Update to Xcode 8.3 Beta 3 (#1741) 2017-03-28 09:53:32 -05:00
Sebastien Pouliot 74fe26f901 [tests][xtro] Add optional generation of bindings for API in xtro's Makefile (#1732) 2017-03-28 09:46:11 -05:00
Sebastien Pouliot cb576d53a9 Revert "[tests] Adjust monotouch-test not to crash on an Apple bug. Fixes #52162 (#1699)"
This reverts commit b502bd71a1.
2017-03-28 09:45:24 -05:00
Vincent Dondain dd54bc4509 [spritekit] Update for Xcode 8.3 beta 1 - part 3 (#1705)
- Fixes bug #52568: Missing SpriteKit API
(https://bugzilla.xamarin.com/show_bug.cgi?id=52568)

xtro revealed that some selectors were still missing after the "part 2" fix.

* [spritekit] Add missing selectors and clean up common.pending

Fixes bug #34946: [spritekit] Missing selectors
(https://bugzilla.xamarin.com/show_bug.cgi?id=34946)

Also as per https://github.com/xamarin/xamarin-macios/pull/1705#pullrequestreview-22328496
we find that there's more value in exposing those static methods (SKUniform::uniformWithName:*) than hiding them.

https://bugzilla.xamarin.com/show_bug.cgi?id=37727 was already fixed but we didn't remove
the added selectors from common.pending

The following selectors were already bound:
!missing-selector! +SKActions::falloffTo:duration: not bound
!missing-selector! +SKVideoNode::videoNodeWithFileNamed: not bound
!missing-selector! +SKVideoNode::videoNodeWithURL: not bound
2017-03-28 09:43:54 -05:00
Vincent Dondain 13972a104b [opengles] Add version check to EAGLContext.PresentRenderBufferTest (#1706)
Fix bug #52456: [iOS]EAGLContextTest.PresentRenderBufferTest failed on lower versions of iOS
(https://bugzilla.xamarin.com/show_bug.cgi?id=52456)
2017-03-28 09:42:24 -05:00
Sebastien Pouliot f261d901b1 [tests] Adjust monotouch-test not to crash on an Apple bug. Fixes #52162 (#1699)
iOS 10.3 simulator (i386 only) will crash executing CTLineTests.
EnumerateCaretOffsets test case.

This does not happen on 64 bits (simulator) or on device builds,
including 32 bits builds. Running iOS 10.1 simulator (with Xcode 8.3)
also runs without problems.

reference:
https://bugzilla.xamarin.com/show_bug.cgi?id=52162
2017-03-28 09:38:18 -05:00
Sebastien Pouliot bcf27ce090 [security] Add more SecCertificate* API from beta1. Fixes #52505 (#1695)
They were thought to be macOS only but xtro corrected me, they are
new in iOS 10.3 even if some existed previously.

references (xtro):
!missing-pinvoke! SecCertificateCopyCommonName is not bound
!missing-pinvoke! SecCertificateCopyEmailAddresses is not bound
!missing-pinvoke! SecCertificateCopyNormalizedIssuerSequence is not bound
!missing-pinvoke! SecCertificateCopyNormalizedSubjectSequence is not bound
!missing-pinvoke! SecCertificateCopyPublicKey is not bound
!missing-pinvoke! SecCertificateCopySerialNumber is not bound

reference:
https://bugzilla.xamarin.com/show_bug.cgi?id=52505
2017-03-28 09:34:52 -05:00
Vincent Dondain 6d7efb1405 [modelio] Fix common.unclassified for recent Xcode8.3 changes (#1692) 2017-03-28 09:31:10 -05:00
Sebastien Pouliot 375fd87f85 [tests][xtro] Run xtro comparison against the locally built assemblies, not the one installed on the system (#1691) 2017-03-28 09:30:55 -05:00
Sebastien Pouliot 25481f5af5 [security] Add new API for beta 1 (#1682)
There's a lot of noise from the header diff, e.g. tabs changed to spaces,
but very few actual changes.

Note that there's more macOS specific code to review but this PR
handles iOS, tvOS and watchOS changes.
2017-03-28 09:30:12 -05:00
Alex Soto 3a1276a992 [VideoToolbox] Updated to Xcode 8.3 Beta 1
* Updated API to reflect Xcode 8.3 beta 1 changes
* This commit also fixes availability metadata to avoid duplicating it
  by moving member availability metadata into its container class where
  possible.
* Enables VideoToolbox tests for tvOS.
2017-03-28 09:29:36 -05:00
Sebastien Pouliot 63c98bcbde [metal] Add new MTL* API from Xcode 8.3 beta1 (#1666)
Covers iOS, tvOS and macOS (no Metal on watch yet)

Most new members are _marked_ as @required (but are not really) by
Apple. We cannot make them `abstract` as it would be a breaking change.
2017-03-28 09:28:53 -05:00
Sebastien Pouliot b05b55a8ed [tvos][mediaplayer] Update xtro definitions (#1654)
The new field and both selectors are not really part of tvOS.

The field is not used anywhere (from available API).

The selectors are on a category on a type that is not part of tvOS.
Sadly they do not get annotated directly and require external data.
2017-03-28 09:28:40 -05:00
Sebastien Pouliot 53645cc336 [tvos][storekit] Adjust StoreKit beta 1 bindings for tvOS (#1646) 2017-03-28 09:26:23 -05:00
Vincent Dondain b15d2e256b [mediaplayer] Update for iOS 10.3 beta 1 (#1627)
* introspection-ios

MPMusicPlayerControllerMutableQueue and MPMusicPlayerControllerQueue's headers show no trace of NSCoding, NSSecureCoding or NSMutableCopying therefore we're skipping them.
2017-03-28 09:24:06 -05:00
Vincent Dondain b7dd01c770 [modelio] Update for iOS 10.3 beta 1 (#1601) 2017-03-28 09:22:27 -05:00
Sebastien Pouliot f4fccb09d7 [tvos][videotoolbox] Enable VideoToolbox.framework on tvOS (#1626)
This is just a build enablement to see xtro results. API adjustments,
including availability attributes, remains to be done.
2017-03-28 09:22:10 -05:00
Alex Soto f7b72669ec [PassKit] Update to iOS 10.3 beta 1 2017-03-28 09:16:49 -05:00
Sebastien Pouliot 2ee5201b84 [tests][monotouch] Generalize some tests to be independent of iOS version. Fixes #51801 (#1598)
The exact values are not what we need to test for and varies with
different OS versions - making tests fails for no good reason (i.e.
they are not canary used to detect changes)

reference:
https://bugzilla.xamarin.com/show_bug.cgi?id=51801
2017-03-28 09:16:08 -05:00
Alex Soto 4d9774eeb1 [CoreVideo] Update to iOS 10.3 beta 1 2017-03-28 09:13:31 -05:00
Vincent Dondain f3cd4a50d4 [opengles] Update to iOS 10.3 beta 1 (#1576) 2017-03-28 09:12:08 -05:00
Rolf Bjarne Kvinge 69e99dee6c [tests] Use the iPhone 6 simulator instead of the iPhone 5s simulator for 64-bit testing. (#1920)
Apparently Xcode 8.3 does not like the iPhone 5s simulator, and deletes it.

Every time Xcode is updated.

Which is slightly annoying when it affects the bots, since then iPhone 5s have
to be re-created on every bot.

So succumb to the pressure, and switch to using the iPhone 6 simulator instead.
2017-03-28 14:38:09 +02:00
Alex Soto 28ad23d142 [generator] Remove [Async] members from [Model] classes, fixes bug 53076.
https://bugzilla.xamarin.com/show_bug.cgi?id=53076

When [Async] was used on a member of a [Model][Protocol][Basetype]
interface the ModelClass ended up with additional FooAsync methods that
are not really part of the Model.

This commit removed any instances of FooAsync members from model classes
and also fixes any breaking changes in the currently bound classes.

Added test case using Model.

build diff:
https://gist.github.com/dalexsoto/75cb8424f2462bd6b513049f00bba6a8
2017-03-25 00:35:36 -06:00
Alex Soto 340ade8c68 [generator] Turn [Async] methods inside [Protocol] into extension methods
Partial fix for:
https://bugzilla.xamarin.com/show_bug.cgi?id=53076

We currently generate extension methods for optional members decorated
with [Async] inside a [Protocol] but we ignore the required methods
decorated with [Async]. This commit fixes this issue and we now
generate extension methods for required members.

Lets take the following API definition

```csharp
[Protocol]
interface MyFooProtocol {

	[Abstract]
	[Async]
	[Export ("requiredMethod:completion:")]
	void RequiredMethod (int arg1, Action<NSError> err);

	[Async]
	[Export ("optional:completion:")]
	void OptionalMethod (int arg1, Action<NSError> err);
}
```

This generates:

```csharp
public static partial class MyFooProtocol_Extensions {
	[CompilerGenerated]
	public unsafe static void OptionalMethod (this IMyFooProtocol This, int arg1, [BlockProxy (typeof (ObjCRuntime.Trampolines.NIDActionArity1V0))]global::System.Action<NSError> err)
	{
		if (err == null)
			throw new ArgumentNullException ("err");
		BlockLiteral *block_ptr_err;
		BlockLiteral block_err;
		block_err = new BlockLiteral ();
		block_ptr_err = &block_err;
		block_err.SetupBlock (Trampolines.SDActionArity1V0.Handler, err);

		global::ApiDefinition.Messaging.void_objc_msgSend_int_IntPtr (This.Handle, Selector.GetHandle ("optional:completion:"), arg1, (IntPtr) block_ptr_err);
		block_ptr_err->CleanupBlock ();

	}

	[CompilerGenerated]
	public unsafe static Task OptionalMethodAsync (this IMyFooProtocol This, int arg1)
	{
		var tcs = new TaskCompletionSource<bool> ();
		This.OptionalMethod(arg1, (obj_) => {
			if (obj_ != null)
				tcs.SetException (new NSErrorException(obj_));
			else
				tcs.SetResult (true);
		});
		return tcs.Task;
	}

	[CompilerGenerated]
	public unsafe static Task RequiredMethodAsync (this IMyFooProtocol This, int arg1)
	{
		var tcs = new TaskCompletionSource<bool> ();
		This.RequiredMethod(arg1, (obj_) => {
			if (obj_ != null)
				tcs.SetException (new NSErrorException(obj_));
			else
				tcs.SetResult (true);
		});
		return tcs.Task;
	}

}
```

Adds unit test

Build diff:
https://gist.github.com/dalexsoto/75290d1ffa1fdfb529cc30b9e66de5f2
2017-03-25 00:25:45 -06:00
Alex Soto 155e414e9c [generator] Disable CS0219 when using AsyncAttribute to avoid warning
Currently we get a CS2019 warning whenever we use AsyncAttribute
because we ignore the `result` variable on methods whose return
type is != `void` which is the expected behaviour.

This is specially more annoying on third party bindings,
the generated code did not disable this warning so you get
an "unfixable" warning on the generated code and the user
has no way to fix this on their own.

We now disable and restore CS2019 in the generated code as needed.
Nobody likes warnings that are not their fault.

Added unit test.

Build diff:

https://gist.github.com/dalexsoto/6f57d3f84b039b9fda863e2f8cfcf365
2017-03-24 21:08:40 -06:00
Alex Soto 577d0119df [generator] Remove Async members from internal BaseWrapper derived types
Currently we generate FooAsync members inside internal BaseWrapper
derived types used by protocol support. This generated Async members
are useles so we remove them to avoid extra metadata.

Old generated code

```csharp
internal sealed class MyFooDelegateWrapper : BaseWrapper, IMyFooDelegate {
	[Preserve (Conditional = true)]
	public MyFooDelegateWrapper (IntPtr handle, bool owns)
		: base (handle, owns)
	{
	}

	[Export ("stringMethod:completion:")]
	[CompilerGenerated]
	public unsafe void StringMethod (int arg1, [BlockProxy (typeof (ObjCRuntime.Trampolines.NIDActionArity1V0))]global::System.Action<NSError> err)
	{
		if (err == null)
			throw new ArgumentNullException ("err");
		BlockLiteral *block_ptr_err;
		BlockLiteral block_err;
		block_err = new BlockLiteral ();
		block_ptr_err = &block_err;
		block_err.SetupBlock (Trampolines.SDActionArity1V0.Handler, err);

		global::ApiDefinition.Messaging.void_objc_msgSend_int_IntPtr (this.Handle, Selector.GetHandle ("stringMethod:completion:"), arg1, (IntPtr) block_ptr_err);
		block_ptr_err->CleanupBlock ();

	}

	[CompilerGenerated]
	public unsafe Task StringMethodAsync (int arg1)
	{
		var tcs = new TaskCompletionSource<bool> ();
		StringMethod(arg1, (obj_) => {
			if (obj_ != null)
				tcs.SetException (new NSErrorException(obj_));
			else
				tcs.SetResult (true);
		});
		return tcs.Task;
	}

}
```

new generated code:

```csharp
internal sealed class MyFooDelegateWrapper : BaseWrapper, IMyFooDelegate {
	[Preserve (Conditional = true)]
	public MyFooDelegateWrapper (IntPtr handle, bool owns)
		: base (handle, owns)
	{
	}

	[Export ("stringMethod:completion:")]
	[CompilerGenerated]
	public unsafe void StringMethod (int arg1, [BlockProxy (typeof (ObjCRuntime.Trampolines.NIDActionArity1V0))]global::System.Action<NSError> err)
	{
		if (err == null)
			throw new ArgumentNullException ("err");
		BlockLiteral *block_ptr_err;
		BlockLiteral block_err;
		block_err = new BlockLiteral ();
		block_ptr_err = &block_err;
		block_err.SetupBlock (Trampolines.SDActionArity1V0.Handler, err);

		global::ApiDefinition.Messaging.void_objc_msgSend_int_IntPtr (this.Handle, Selector.GetHandle ("stringMethod:completion:"), arg1, (IntPtr) block_ptr_err);
		block_ptr_err->CleanupBlock ();

	}
}
```

Added unit test.

build diff for this change:

https://gist.github.com/dalexsoto/eeaefc9d86e37b0c5ce5fe6d5d091383
2017-03-24 17:40:55 -06:00
Rolf Bjarne Kvinge 26aa29ebd0 Merge remote-tracking branch 'origin/master' into mono-2017-02 2017-03-24 18:09:24 +01:00