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

4323 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 7f46564727
[link sdk] Tweak test to work when running as an extension. (#3764)
Also improve corresponding asserts to show the actual/expected values.
2018-03-16 23:03:35 +01:00
Rolf Bjarne Kvinge 5272ede1b9
[generator/registrar] Add support for blocks in static protocol members. Fixes #41226. (#3763)
Add support for blocks in static protocol members by adding another field to
the [ProtocolMember] attribute that specifies the block proxy type.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=41226.
2018-03-16 23:01:56 +01:00
Alex Soto da6db5f660
[monotouch-tests] Adds mono's WeakAttribute tests (#3739) (#3760)
* [monotouch-tests] Adds mono's WeakAttribute tests

* Embrace watchOS

Unfortunately this revealed that WeakAttribute is not working for watchOS

* Port mono's WeakAttribute test to our test runner

Test Ported:
5bdaef7e5f/mono/tests/weak-fields.cs

* Fix object leaks and implement suggested approach from 4b9ade0c59

* Remove debug spew and fix formating on header
2018-03-16 08:22:05 -06:00
Chris Hamons 09c162dc23
Reorganize MMP tests (#3759)
* Move tests out of MMPTests meta-class that were split into other files already
* Move smoke tests out of MMPTest.cs
* Reorganize MMP registrar tests
* Move assembly references tests out
2018-03-16 08:53:53 -05:00
Manuel de la Pena cf3648e33f
[Foundation] Ensure that we retain the needed data in the NSUrlSessionHandler (#3731)
* Do not release the NSData because buffers are reused between requests.
* Remove unneeded dipose override.
2018-03-16 10:51:40 +01:00
Sebastien Pouliot 9c58c4513a
[jenkins] Clean keystore on bots before running tests (#3754)
Because if invalid data gets into the store then some unit tests
will always fail on that particular bot.

Fix https://github.com/xamarin/maccore/issues/640
2018-03-15 12:25:53 -05:00
mdbech 81c9b49641 [security] Adding new SecAccessControlCreateFlags (#3735)
- Add new `BiometryAny` and `BiometryCurrentSet` enum values.
- Add `[Advice]` attribute on old values with message suggesting the use of "biometric" values.
- Add comments explaining why we didn't use newer availability attributes on new APIs.
2018-03-15 10:35:23 -04:00
Rolf Bjarne Kvinge 379a4fb2f5
[mtouch] Don't build libmonotouch-fixes.dylib anymore, it's not used. (#3745)
* [mtouch] Don't build libmonotouch-fixes.dylib anymore, it's not used.

We haven't used libmonotouch-fixes.dylib for over a year (and it stopped
working before that), so this seems safe to remove.

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

* [mtouch] Keep the monotouch-fixes.c code, since it's still used in 64-bit simulator.
2018-03-15 15:14:44 +01:00
Chris Hamons c761782049 Fix XM xcode9.3 package version (#3748) 2018-03-15 08:27:00 -05:00
Sebastien Pouliot 1b3672e2e3
[tests][mac] Fix random failure in KeyTest.RoundtripRSAMinPKCS1 (#3737)
The behaviour is not consistent on macOS (like it is on iOS)

Fixes https://github.com/xamarin/maccore/issues/671
2018-03-14 08:00:06 -05:00
Rolf Bjarne Kvinge 7b405cb9f5 Bump mono to get fix for mono/mono#7302. (#3729)
Commit list for mono/mono:

* mono/mono@5dae72b19b Update source file location from commit d4816ef1abcfc5b3dea41a87fe5a7a4c4a3781ed
* mono/mono@4050681098 [tests] Disable delegate-15.exe in the full-aot profile. (#7529) (#7564)
* mono/mono@ef8ab4986a Fix the clearing of bits in the gc descriptor bitmap when using weak fields. Fixes #7378.

Diff: 266326d7c2...5dae72b19b
2018-03-13 08:12:17 -05:00
Sebastien Pouliot a74184175b
[tests] macOS NSSpellChecker randomly [dis]approve of 'Ident' (#3728)
Fix https://github.com/xamarin/maccore/issues/661
2018-03-13 08:10:16 -05:00
Rolf Bjarne Kvinge 2fe44b9890
[ObjCRuntime] Don't double-retain blocks. (#3717)
* [ObjCRuntime] Don't double-retain blocks.

First there was darkness; no blocks were retained.

Then came the light; and all blocks were retained [1]

Forever.

But all that once is, must one day not be,
and thus the light gave way to darkness,
and blocks were only retained as long as need be [2].

But before there was a balance, there was a crossroad.

In some places the light shone forever,
and all blocks were retained.

In other places there was a balance,
and the light shone only as long as needed.

A desire to unify arose.

Alas, it could not be.

It was a bright and sunny day

When a merge failed [3].

And all blocks were retained. Twice.

Once [here][4] and once [there][5].

For many years we could not see.

Until a dark and rainy night,
when an awareness arose.

And the desire to unify the balance could finally be fulfilled.

[1]: 6efca92acb
[2]: a22f877539
[3]: befa0477cf
[4]: 5158a3c001/src/ObjCRuntime/Runtime.cs (L858)
[5]: 5158a3c001/runtime/runtime.m (L2091)

* [tests] Fix test builds.

* [monotouch-test] RegistrarTest.BlockCollection: allocate more and wait longer for the GC.

Allocate more objects and wait longer for the GC to run.

Hopefully fixes this problem:

    	[FAIL] RegistrarTest.BlockCollection :   freed blocks
      Expected: greater than 0
      But was:  0

The blocks are freed if we just wait long enough... The problem is that we
don't want to wait very long (makes the tests slow to run), so try to speed
things up by allocating more.
2018-03-13 12:30:32 +01:00
Rolf Bjarne Kvinge c4ddd4da1e
[monotouch-test] Adjust a few tests to cope with optimizations. (#3720)
This fixes the following test failures when building for debug with all optimizations enabled:

    DispatchTests
    	[FAIL] DispatchTests.EverAfter :   thread check hit
      Expected: same as <UIKit.UIKitThreadAccessException>
      But was:  <System.ArgumentNullException>

    		  at MonoTouchFixtures.CoreFoundation.DispatchTests.EverAfter () [0x000e1] in /Users/xamarinqa/vsts/_work/52/s/tests/monotouch-test/CoreFoundation/DispatchTests.cs:259
    		  at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke(System.Reflection.MonoMethod,object,object[],System.Exception&)
    	[FAIL] DispatchTests.MainQueueDispatch :   thread check hit
      Expected: same as <UIKit.UIKitThreadAccessException>
      But was:  <System.ArgumentNullException>

    		  at MonoTouchFixtures.CoreFoundation.DispatchTests.MainQueueDispatch () [0x000d1] in /Users/xamarinqa/vsts/_work/52/s/tests/monotouch-test/CoreFoundation/DispatchTests.cs:111
    		  at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke(System.Reflection.MonoMethod,object,object[],System.Exception&)
2018-03-13 10:41:38 +01:00
Chris Hamons 8d57e6bcf3 Revert "[macOS][msbuild] Fix binding projects under Full to resolve to correct libs (#3672)" (#3727)
This reverts commit d5b50765f5.
2018-03-13 10:38:14 +01:00
Jeffrey Stedfast be4754e9f5
[msbuild] Correctly determine whenther Xamarin.Mac builds require a provisioning profile (#3710)
Fixes issue #3674

The problem is that the Xamarin.Mac targets did not set the
RequireProvisioningProfile property on the DetectSigningIdentity
task which meant that it defaulted to 'false'.

When that property is 'false', the DetectSigningIdentity logic
would shortcut to not doing a provisioning profile lookup.

This was therefor causing the build to not use a provisioning
profile which caused the build to improperly codesign the app
bundle.
2018-03-12 14:30:46 -04:00
Vincent Dondain 5158a3c001 [xharness] Don't count the skipped tests as failed (#3660)
Currently we consider the failed **and** the skipped tests as failures which is confusing. The tests didn't all "fail" because some were just not ran.

This PR updates the summary message to be a little more clear.
2018-03-09 14:55:42 -05:00
Sebastien Pouliot 3979d081b4
Merge pull request #3712 from spouliot/backport-test-fixes-d15-6
[tests] Backport test fixes so bots don't report them on every backports
2018-03-09 14:54:16 -05:00
Chris Hamons d5b50765f5
[macOS][msbuild] Fix binding projects under Full to resolve to correct libs (#3672)
- Fixes https://github.com/xamarin/xamarin-macios/issues/3608
- Refactor and clean up msbuild to be more consistent between binding and "normal" workloads
- Comment on the inconsistencies that are too large to fix in one PR
- Write some actual tests for binding projects to detect regressions
- Due to lack of redirect support these tests are only xbuild current, but I ran tests with msbuild to validate locally
2018-03-09 13:02:46 -06:00
Alex Soto 60a81256b9 [Backport][monotouch-test] Stop MidiThruConnectionTests.FindTest from randomly failing (#3703)
Fixes xamarin/maccore#658

When a MidiThruConnection is created but for some reason is not disposed
the system keeps it alive even between app/simulator restarts, if you want
to clean the connections you must reset contents and settings from simulator.
Which is a bit harder when the issues happens on the macOS.
2018-03-09 13:06:09 -05:00
Rolf Bjarne Kvinge c9e257922c [tests] Fix NSDataTest.Https to use a site with a valid and complete certificate chain. Fixes #644. (#3549)
Fixes https://github.com/xamarin/maccore/issues/644.
2018-03-09 13:05:18 -05:00
Sebastien Pouliot 109cf736a8 [tests] Skip High Sierra image filters in Classic tests. Fixes #622. (#3308) (#3671)
Skip High Sierra image filters in Classic introspection tests, since the
Classic bindings won't be updated.

https://github.com/xamarin/maccore/issues/622
2018-03-09 13:04:43 -05:00
Brendan Zagaeski 71902a15bf Bump mono to get fix for mono/mono#7472. (#3701)
Fixes https://github.com/mono/mono/issues/7472.

Commit list for mono/mono:

* mono/mono@145ca6391f [d15-6-2017-10] Only null check target for delegate if method is not static. (#7477)
* mono/mono@835a98d855 Bump bockbuild to get curl error changes
* mono/mono@bbd88d02b2 Bump bockbuild for mono/bockbuild#62 (#7208)
* mono/mono@1eac626536 Pass TRUE for 'repeat' of send variants. This matches behavior of receive variants. Fixes blocking send call where Win32 returns WSAEWOULDBLOCK.
* mono/mono@33652b57eb Bump bockbuild to get new gtk+ repo location
* mono/mono@3f39812cb9 [2017-10] [reference-assemblies] Fix public key for some newer v4.7.1 facades (#6864)

Diff: da1e498884...145ca6391f
2018-03-09 13:02:05 -05:00
Rolf Bjarne Kvinge b242afc8aa
[mtouch] When loading cached linked results, we need to propagate the 'RemoveDynamicRegistrar' value to code-sharing extensions. (#3708) 2018-03-09 17:24:47 +01:00
Rolf Bjarne Kvinge 50a35d2a88
Bump mono to get fix for mono/mono#7364. (#3706)
Commit list for mono/mono:

* mono/mono@266326d7c2 Move the check for open constructed types later in mono_jit_compile_method_with_opt (), this function can receive gshared methods in llvmonly mode. (#7505)
* mono/mono@89cc3619d5 Use runtime template for iOS
* mono/mono@05453b1c80 Use runtime template for Android
* mono/mono@0938bbc98c Create common runtime compilation template
* mono/mono@c06eb62b14 Have RELEASE be empty when CONFIGURATION != 'release'
* mono/mono@0fb02c88cd Move common targets
* mono/mono@d4aa545f56 [metadata] An array is not an IEnumerator`1
* mono/mono@ff7f5576d2 [test] An array is not an IEnumerator`1
* mono/mono@d5d67eab6a [metadata] Add IEnumerator`1 to MonoDefaults struct
* mono/mono@15d76bf5e2 Revert "[profiler] Correctly encode counter type/unit/variance values."
* mono/mono@f3ac8fdeb3 Fix for gcc 4.4; nominal support for older. attribute(deprecated(message)) was introduced in gcc 4.5. attribute(deprecated) was introduced in gcc 4.0? pragma GCC diagnostic 4.2? https://github.com/mono/mono/issues/7408 (#7436)
* mono/mono@1f48672a90 Fixes decoding of CMS/PKCS #7 messages with an explicit cryptographic object identifier

Diff: becded2606...266326d7c2
2018-03-09 15:30:30 +01:00
Alex Soto 06d390ce3e [Backport][monotouch-test] Stop MidiThruConnectionTests.FindTest from randomly failing (#3703)
Fixes xamarin/maccore#658

When a MidiThruConnection is created but for some reason is not disposed
the system keeps it alive even between app/simulator restarts, if you want
to clean the connections you must reset contents and settings from simulator.
Which is a bit harder when the issues happens on the macOS.
2018-03-09 08:12:18 -05:00
Brendan Zagaeski 0feae1cba0 Bump XI to 11.8.1 (and XM to 4.2.1) (#3704)
This updates the revision number in preparation for the next servicing
release from the `d15-6` branch.
2018-03-09 08:07:54 -05:00
Alex Soto fc5f57ed8c
[monotouch-test] Enchance MidiThruConnectionTests.FindTest from #3696 comments (#3700) 2018-03-08 12:51:21 -06:00
Rolf Bjarne Kvinge 8faec078d0
Fix maccore bump hash. (#3699)
Commit list for xamarin/maccore:

* xamarin/maccore@4505cd6f02 Bump maciostools to get mlaunch fixes. (#667)
* xamarin/maccore@4b0ac89faa Merge pull request #668 from xamarin/ts-closures
* xamarin/maccore@243e063b43 Changed unit tests to use [TestCase()] - thanks, Chris!
* xamarin/maccore@2cd35b93f1 Added support for non-escaping closures.

Diff: 689fae7440...4505cd6f02
2018-03-08 17:30:19 +01:00
Rolf Bjarne Kvinge 31a37a0407
Bump maccore to get mlaunch fix. (#3697)
Commit list for xamarin/maccore:

* xamarin/maccore@aa77d5e811 Bump maciostools to get mlaunch fixes.
* xamarin/maccore@0d74e34e16 Merge pull request #659 from xamarin/ts-swift4mangling
* xamarin/maccore@5135e9dd60 Reformatted an exception, switched to Ordinal string comparisons where it makes sense (everywhere, as it turns out).
* xamarin/maccore@40d676bf96 Updates for PR: formatting, names, obsolete comments addressed.
* xamarin/maccore@9751df85ca Updated for swift4 support - major changes include new name demangling, new demangled name -> SwiftType conversion, updated pinvokes, ABI changes.

Diff: 689fae7440...aa77d5e811
2018-03-08 17:15:09 +01:00
Chris Hamons c1a42fe3d0
Update CODEOWNERS files (#3455) (#3694) 2018-03-08 09:33:54 -06:00
Chris Hamons 2444f23e13
Update CODEOWNERS files (#3455) (#3695) 2018-03-08 09:33:45 -06:00
Alex Soto 4d51294bdf [monotouch-test] Stop MidiThruConnectionTests.FindTest from randomly failing (#3696)
Fixes xamarin/maccore#658

When a MidiThruConnection is created but for some reason is not disposed
the system keeps it alive even between app/simulator restarts, if you want
to clean the connections you must reset contents and settings from simulator.

In order to avoid this test from failing randomly and since the intent of the
test is to check if `MidiThruConnection.Find` works we change the assert to
`>= 2` since this is at least the number of connections we expect.
2018-03-08 07:33:13 +01:00
Alex Soto 8ba51035d1
[MetalPerformanceShaders] Make macOS intro happy (#3692)
Xcode 9.3 removed both selectors from MPSCnnBinaryKernel, reported radar https://trello.com/c/7EAM0qk1
but apple says this was intentional.

Since this API is not final we need to review it as part of
https://github.com/xamarin/xamarin-macios/issues/3553
2018-03-07 17:49:11 -06:00
Jeffrey Stedfast b0145de9c7 [msbuild] Always codesign libraries and frameworks (#3354)
Fixes issue #3289
2018-03-07 16:40:36 -05:00
Rolf Bjarne Kvinge bb2041e5ce
[tests] Don't try to compile the Main function in F# extensions. (#3683)
The F# compiler complains that:

    /Users/xamarinqa/vsts/_work/52/s/tests/fsharp/Main.fs(13,9): error FS0433: A function labeled with the 'EntryPointAttribute' attribute must be the last declaration in the last file in the compilation sequence.

Main.fs is the last file in the project file, but the MSBuild tasks adds
another one at the end:

    obj/iPhone/Debug64-today-extension/Xamarin.iOS,Version=v1.0.AssemblyAttribute.fs

because we're building a library (in which case the MSBuild tasks assume that
there won't be any Main functions in the project, and as such it's safe to
append files to compile).

Work around this by excluding the Main function from F# extensions, it's not
needed anyway.
2018-03-07 22:13:13 +01:00
Chris Hamons 2ebfda5476
Fix missing [NullAllowed] on NSWindow.FieldEditor
- https://github.com/xamarin/xamarin-macios/issues/3686
2018-03-07 14:37:21 -06:00
Alex Soto 9776d0ebdf
[Contacts] Update to Xcode 9.3 Beta 4 (#3678)
* [Contacts] Update to Xcode 9.3 Beta 4

* Fix typo, misspelling of accessible.
2018-03-07 08:42:41 -06:00
Alex Soto 17a81e9d4e
[ARkit] Update to Xcode 9.3 Beta 4 (#3680) 2018-03-07 08:41:25 -06:00
Alex Soto 05997e38cd [MetalPerformanceShaders] Update xtro up to Xcode 9.3 Beta 4 (#3679)
We will bind it later, see:
https://github.com/xamarin/xamarin-macios/issues/3553
2018-03-07 08:53:33 -05:00
Rolf Bjarne Kvinge 636b2547c5
[xharness] Detect launch failures better and report them as such. (#3682) 2018-03-07 14:48:24 +01:00
Eberhard Beilharz 78583313eb Fix download path for mono (#3681) 2018-03-07 14:46:59 +01:00
mdbech 933ab0d70a [security] Strongly typed key generation (#3502)
* [security] Modifying structure of bindings

Added strong dictionary for key generation according to
https://developer.apple.com/documentation/security/certificate_key_and_trust_services/keys/key_generation_attributes
in preparation making a strongly typed key generation possible.

* Making strong dictionary and composite of other strong dictionaries.

* Implementing access control as property type of SecPublicPrivateKeyAttrs.

* Adding new overload for SecKey.CreateRandomKey.

* Moving TokenID to strongly typed property.

* Fix coding style + use nameof

* Fixing Xcode version assertion of key generation tests.

* Fixing errors in test case.

* Fixing whitespace issue.

* Resolving inheritance issue

Removing inheritance between SecKeyGenerationParameters and
SecPublicPrivateKeyAttrs and instead add the necessary properties
to SecKeyGenerationParameters. Adds redundant code, but I don't
see a way around it.

* Moving test case to appropriate test class.

* Creating necessary strong dictionaries for key generation.

* [formatting] Mono coding guidelines

Make sure you're following http://www.mono-project.com/community/contributing/coding-guidelines/
In VSMac: Preferences > Source Code > Code Formatting > C# source code > Policy Mono.

* Remove [Advice] that are specific to GenerateKeyPair

`SecKeyGenerationParameters` and `SecKeyParameters` cannot be used for `GenerateKeyPair`.

* Clarify 'ArgumentException' for invalid 'SecKeyType'

* Fixed CreateRandomKeyTest

- Renamed CreateRandomKeyWithParametersTests to CreateRandomKeyTest.
- Add messages to all asserts.

```
keyGenerationParameters = new SecKeyGenerationParameters ();
keyGenerationParameters.KeyType = SecKeyType.Invalid;
Assert.Throws<ArgumentException> (() => { SecKey.CreateRandomKey (keyGenerationParameters, out _); }, "CreateRandomKey - invalid key type");
```
- ^ didn't work because `SecKeyGenerationParameters`'s setter protects against invalid. There's no constant for invalid so null is returned.

```
Assert.That (SecKey.CreateRandomKey (keyGenerationParameters, out _), Is.EqualTo (SecStatusCode.Param), "CreateRandomKey - Param issue, invalid RSA key size");
```
- ^ `SecKey.CreateRandomKey` doesn't return a `SecStatusCode` like `GenerateKeyPair`.

* Fixes based on spouliot's input.

* Mono styling fix.
2018-03-06 15:25:50 -05:00
Sebastien Pouliot 189075bb3e
[tests] Skip High Sierra image filters in Classic tests. Fixes #622. (#3308) (#3671)
Skip High Sierra image filters in Classic introspection tests, since the
Classic bindings won't be updated.

https://github.com/xamarin/maccore/issues/622
2018-03-06 15:16:19 -05:00
Rolf Bjarne Kvinge 796a2ae71c
Bump mono to get fix for xamarin/maccore#629. (#3669)
Fixes https://github.com/xamarin/maccore/issues/629.

Commit list for mono/mono:

* mono/mono@becded2606 [2017-12] [corlib] Ignore TimeZoneTest.TestCtors on iOS under certain conditions due to an Apple bug. (#7427)
* mono/mono@d21cb0853b Don't throw NotImplementedException in Dispose()
* mono/mono@f7f359a2dd IOS SDK fixes. (#7417)
* mono/mono@607cbde47a Reenable HttpRequestIgnoreBadCookies in monotouch. (#7392)
* mono/mono@85fb6bce10 [appdomain] Fix path clobbering when trying to shadow copy siblings
* mono/mono@78136c4a90 Use attribute(deprecated) instead of attribute(error). (#7370)
* mono/mono@b4c45099fb [sdks] Add watch device build.
* mono/mono@70837feda9 [sdks] Add watch simulator build.
* mono/mono@c2728d29f7 [sdks] Add tv simulator build.
* mono/mono@54b2e194f3 [runtime] Don't assert in mono_class_is_assignable_from on iface gtd
* mono/mono@10f1f84138 [test] System.Type.IsAssignableFrom of gtd array special interfaces.
* mono/mono@e1ff841329 [ci] Consistently use CI_TAGS instead of label (#6782)
* mono/mono@46912f8f80 Fix errors in cpu-s390x.md which are exposed by the new genmdesc. (#7323)
* mono/mono@3f4f070d3d disable test_42_arm64_dyncall_vtypebyval

Diff: 331f927bfe...becded2606
2018-03-06 17:43:04 +01:00
Sebastien Pouliot fc346b7cde
Bump Xcode to beta 4 (#3667) 2018-03-06 10:25:40 -05:00
Sebastien Pouliot f44c371d71
Merge pull request #3663 from spouliot/xcode93-15-6-merge
Merge d15-6 into xcode9.3
2018-03-06 07:57:02 -05:00
Sebastien Pouliot 9f3f7bf4ed Fix merge 2018-03-05 23:40:02 -05:00
Sebastien Pouliot 29676a3662 Merge 15.6 into xcode9.3 2018-03-05 17:16:28 -05:00
Vincent Dondain 97ef51bf8b
[msbuild] Use a response file in 'MTouchTaskBase' (#3635)
The main cause of the warning: "warning MSB6002: The command-line for the 'MTouch' task is too long" was the number of references that can be passed to `mtouch`.
Now all the arguments are written in a response file which in turn is passed to `mtouch`.

- Fixes bug #56501: MSB6002 command-line for MTouch task is too long, > 32000 characters
(https://bugzilla.xamarin.com/show_bug.cgi?id=56501)
- The response file is created in the device specific folder, as `response-file.rsp`. It is re-created every time.
- Added an msbuild test to ensure the response file is created by `GenerateCommandLineCommands` and that it includes all the references.
- Introduce `AddLine` and `AddQuotedLine` which we use to populate the response file (and go to the next line).
- Move to C# 7 syntax for string replacement.
- Update all tests in `MTouchTaskTests` to use the response file since the arguments are no longer passed directly to `mtouch`.
- Update MT0018's documentation for response files.
2018-03-05 11:59:53 -05:00