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

1449 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 32ea9bd930
[tests] Fix compiler warning. (#3375)
This file is included in several projects, some projects use property, some
don't (and report the warning). There's no harm in not setting this property
(it's expected), ignore the warning.
2018-02-01 19:07:23 +01:00
Rolf Bjarne Kvinge 83c8ba688a
[tests] Enable LLVM for all Release|Device configurations. (#3376)
This won't affect device tests on the bots (because those already set LLVM
manually when testing Release), but it becomes less confusing when trying to
reproduce any problems locally, since now the project configuration on disk
matches the tested configuration.
2018-02-01 17:59:40 +01:00
Rolf Bjarne Kvinge c3560bf726
[mmptest] Fix compiler warning by not including code we get from a reference. (#3366)
Fixes this:

    tests/common/mac/ProjectTestHelpers.cs(154,22): warning CS0436: The type 'StringUtils' in 'tests/mmptest/../../tools/common/StringUtils.cs' conflicts with the imported type 'StringUtils' in 'mmp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'tests/mmptest/../../tools/common/StringUtils.cs'.
    tests/common/Configuration.cs(162,53): warning CS0436: The type 'StringUtils' in 'tests/mmptest/../../tools/common/StringUtils.cs' conflicts with the imported type 'StringUtils' in 'mmp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'tests/mmptest/../../tools/common/StringUtils.cs'.
2018-02-01 07:35:35 +01:00
Rolf Bjarne Kvinge 83b81ca9f4
[Foundation] Simplify NSValue code to use [No*] instead of ifdefs. (#3364)
* [Foundation] Simplify NSValue code to use [No*] instead of ifdefs.

Also enable the MKCoordinateSpan and CLLocationCoordinate2D values for NSValue
in macOS, since they're now available (since macOS 10.9).

    Type Changed: Foundation.NSValue

    Added properties:

        public virtual MapKit.MKCoordinateSpan CoordinateSpanValue { get; }
        public virtual CoreLocation.CLLocationCoordinate2D CoordinateValue { get; }

* [Foundation] Mark the new NSValue selectors as 64-bit only.
2018-02-01 07:31:52 +01:00
Rolf Bjarne Kvinge 6fc7b1ea89
[tests] Run dont link, link all and link sdk tests in both Debug and Release in the simulator. Fixes #53181. (#3363)
* [xharness] Add support for running XI projects with different platform configurations.

* [xharness] Run dont link, link all and link sdk tests in both Debug and Release in the simulator. Fixes #53181.

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

* [tests] Fix dont link to always optimize C# code in release mode.

* [tests] No need to weak link GameController anymore in dont link.

This was removed long ago from the Debug configurations, so remove it from the
Release configuration as well.
2018-01-31 14:56:22 +01:00
Rolf Bjarne Kvinge b632c2348e
[xharness] Don't discriminate iPods, they can be useful too. (#3355) 2018-01-30 17:11:04 +01:00
Rolf Bjarne Kvinge f786a88636
[tests] Make linker-ios tests look like they're from this century. (#3356) 2018-01-30 17:10:54 +01:00
Rolf Bjarne Kvinge 018f715344
[xharness] Ask mono to not attach gdb/ldb when XM tests crash. (#3307)
* [xharness] Ask mono to not attach gdb/ldb when XM tests crash.

Attaching gdb/ldb usually hangs, thus causing the test run to time out instead
of finishing early (due to the crash).

Also bump the timeout for finding crash reports to 60 seconds when the tests
crash, since macOS can be quite slow to create the crash report.

* [xharness] Timestamp mac logs to aid diagnostics.
2018-01-29 11:27:43 +01:00
Rolf Bjarne Kvinge a3b425bf97
[AVFoundation] Remove AVCaptureDataOutputSynchronizer[Delegate] from macOS. (#3336)
This class and protocol were incorrectly added to our macOS bindings.

The catch is that we can't remove them because it would break backwards
compatibility, so mark them for removal in XAMCORE_4_0.
2018-01-29 07:39:06 +01:00
Rolf Bjarne Kvinge b2bcad7a94
Add a BindingImpl attribute and use to to teach the linker look for it to search for optimizable code. (#3299)
* [ObjCRuntime] Add a BindingImplAttribute.

* [linker] Make ProviderToString an extension method on ICustomAttributeProvider to make it more discoverable.

* [generator] Use [BindingImpl] instead of [CompilerGenerated].

The entire diff is big (89MB), so it can't be gisted. However, most of it is
either removal of `using System.Runtime.CompilerServices;` or the change from
`[CompilerGenerated]` to `[BindingImpl (...)]` like this:
https://gist.github.com/rolfbjarne/8bfda3ed37b956d0342a1c1e9b079244

If I remove those parts of the diff, there's nothing significant left:
https://gist.github.com/rolfbjarne/4156164d6bdb1376366200394eb8a091

* [linker] Teach the linker about the new [BindingImpl] attribute.

In addition to the existing logic where the linker would optimize some
[CompilerGenerated] code (sometimes with additional requirements), it will now
also optimize all [BindingImpl (Optimizable)] code (without any additional
requirements).

* [tests] Add tests to make sure [BindingImpl (Optimizable)] works as expected.

* [linker] Check for [BindingImpl] before [CompilerGenerated] and stop checking for [CompilerGenerated] in XAMCORE_4_0.

Check for [BindingImpl] before checking for [CompilerGenerated], since the
former is more common.

Also stop checking for [CompilerGenerated] (at least to mean that code is
optimizable) in our next non-compatible evolutionary leap (XAMCORE_4_0):

* [introspection] Impl a better typo check.
2018-01-26 18:38:23 +01:00
Rolf Bjarne Kvinge 7d0c4d5b09
[tests] Skip High Sierra image filters in Classic tests. Fixes #622. (#3308)
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-01-26 07:46:54 +01:00
Rolf Bjarne Kvinge 61d3d399c8
[xharness] Don't try to parse inexistent or empty files. (#3306) 2018-01-26 07:39:05 +01:00
Rolf Bjarne Kvinge 8fb757fec6
[tests] Allow 11 frameworks in linked XM apps. Fixes maccore GH #615. (#3302)
Fixes this test failure:

    1) Failed : Xamarin.MMP.Tests.MMPTests.UnifiedWithLinking_ShouldHaveFewFrameworkClangLines
      Found more framework entries in clang invocation then expected - Foundation AppKit QuartzCore CoreData Quartz CoreFoundation CoreServices Security Carbon CloudKit
    		xcrun -sdk macosx clang -mmacosx-version-min=10.7 -arch x86_64 -fobjc-runtime=macosx -Wno-unguarded-availability-new -ObjC -framework Foundation -framework AppKit -framework QuartzCore -framework CoreData -framework Quartz -framework CoreFoundation -framework CoreServices -framework Security -framework Carbon -weak_framework CloudKit -u _xamarin_timezone_get_data -u _xamarin_get_block_descriptor /work/maccore/master/xamarin-macios/_mac-build/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/lib/libxammac.a -o /work/maccore/master/xamarin-macios/tests/mmptest/bin/Debug/tmp-test-dir/Xamarin.MMP.Tests.MMPTests.RunMMPTest/bin/Debug/UnifiedExample.app/Contents/MacOS/UnifiedExample -D_THREAD_SAFE -I/work/maccore/master/xamarin-macios/_mac-build/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/lib/pkgconfig/../../include/mono-2.0   /work/maccore/master/xamarin-macios/_mac-build/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/lib/pkgconfig/../../lib/libmonosgen-2.0.a -liconv -x objective-c++ -I/work/maccore/master/xamarin-macios/_mac-build/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/include /work/maccore/master/xamarin-macios/tests/mmptest/bin/Debug/tmp-test-dir/Xamarin.MMP.Tests.MMPTests.RunMMPTest/obj/Debug/mmp-cache/registrar.m -fno-caret-diagnostics -fno-diagnostics-fixit-info -isysroot /Applications/Xcode92.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk /work/maccore/master/xamarin-macios/tests/mmptest/bin/Debug/tmp-test-dir/Xamarin.MMP.Tests.MMPTests.RunMMPTest/obj/Debug/mmp-cache/main.m
      Expected: less than 10
      But was:  10

This regressed in 4da8016db4, where new API is
partially unremovable by the linker, and as such causes XM to link with more
frameworks at build time.

This is expected, so change the test to accept more frameworks (11).

Fixes https://github.com/xamarin/maccore/issues/615.
2018-01-25 17:59:19 +01:00
Rolf Bjarne Kvinge 3910c7943a
[tests] Fix apitest to ignore CoreSpotlight on 32-bit since it's 64-bit only. (#3300)
Fixes this test failure on High Sierra:

    Xamarin.Mac.Tests.EveryFrameworkSmokeTests.ExpectedLibrariesAreLoaded: CoreSpotlightLibrary (/System/Library/Frameworks/CoreSpotlight.framework/CoreSpotlight) failed to load but this was not expected
2018-01-25 17:55:51 +01:00
Manuel de la Pena b35b479cea
[Harness] Add the System.IdentityModel bcl tests. (#3295) 2018-01-25 10:19:41 +01:00
Manuel de la Pena 35806edb5a
[Harness] Add System.ServiceModel tests to the bcl tests. (#3238)
* [Harness] Add System.ServiceModel tests from the bcl.
2018-01-24 12:56:20 +01:00
Rolf Bjarne Kvinge 03d78d13f3
[tests][mtouch] Simplify code to fetch symbols from a binary (nm). (#3286)
Simplify/refactor code to fetch symbols from a binary to reuse an existing
function instead of manually calling `nm` every time.
2018-01-24 00:31:32 +01:00
Rolf Bjarne Kvinge 77aac2ceef
[tests] Package linker tests too for the packaged XM tests. (#3287)
Make sure to package the linker tests when packaging XM tests (this broke
recently because the dontlink tests were moved).

Fixes this problem when running the packaged tests:

    make[2]: linker-mac/dont link/bin/x86/Debug/dont link.app/Contents/MacOS/dont link: No such file or directory
    make[2]: *** [exec-mac-classic-dont link] Error 1
    make[2]: linker-mac/dont link/bin/x86/Debug-unified/dont link.app/Contents/MacOS/dont link: No such file or directory
    make[2]: *** [exec-mac-unified-dont link] Error 1
    make[2]: linker-mac/dont link/bin/x86/Debug-unifiedXM45/dont link.app/Contents/MacOS/dont link: No such file or directory
    make[2]: *** [exec-mac-unifiedXM45-dont link] Error 1
    make[2]: linker-mac/dont link/bin/x86/Debug-unified-32/dont link.app/Contents/MacOS/dont link: No such file or directory
    make[2]: *** [exec-mac-unified32-dont link] Error 1
    make[2]: linker-mac/dont link/bin/x86/Debug-unifiedXM45-32/dont link.app/Contents/MacOS/dont link: No such file or directory
    make[2]: *** [exec-mac-unifiedXM4532-dont link] Error 1
    exec-mac-classic-dont\ link failed
    exec-mac-unified-dont\ link failed
    exec-mac-unifiedXM45-dont\ link failed
    exec-mac-unified32-dont\ link failed
    exec-mac-unifiedXM4532-dont\ link failed
    make[1]: *** [exec-mac-dontlink] Error 1
2018-01-23 23:47:53 +01:00
Sebastien Pouliot ca06526793
[tests][monotouch] Remove the ignore on MPVolumeView added in xcode9 beta 3 - it seems to work fine now (#3284) 2018-01-23 08:27:18 -05:00
Rolf Bjarne Kvinge af03020eef
[mtouch/mmp] Give users more control over optimizations, and share more code between mtouch and mmp. (#3242)
* [mtouch/mmp] Give users more control over optimizations, and share more code between mtouch and mmp.

1. Add an --optimize flag to mtouch/mmp that allows users to select which
   optimizations to apply (or not). This makes it easier to add future
   optimizations, and allow users to disable any optimization that causes
   problems without having to disable many other features.

2. Share as much optimization code as possible between mtouch and mmp. This
   immediately gives a benefit to mmp, which has three new optimizations only
   mtouch had: NSObject.IsDirectBinding inlining, IntPtr.Size inlining and
   dead code elimination.

   This results in ~6kb of disk space saved for a linked Xamarin.Mac app:

   * link sdk: [Debug][1], [Release][2]
   * link all: [Debug][3], [Release][4]

Testing also verifies that monotouchtest ([Debug][5], [Release][6]) has not
changed size at all, which means that no default optimizations have changed
inadvertedly.

[1]: https://gist.github.com/rolfbjarne/6b731e3b5ca6170355662e6505c3d492#link-sdk-mac--debug
[2]: https://gist.github.com/rolfbjarne/6b731e3b5ca6170355662e6505c3d492#link-sdk-mac--release
[3]: https://gist.github.com/rolfbjarne/6b731e3b5ca6170355662e6505c3d492#link-all-mac--debug
[4]: https://gist.github.com/rolfbjarne/6b731e3b5ca6170355662e6505c3d492#link-all-mac--release
[5]: https://gist.github.com/rolfbjarne/6b731e3b5ca6170355662e6505c3d492#monotouchtest-iphonedebug64
[6]: https://gist.github.com/rolfbjarne/6b731e3b5ca6170355662e6505c3d492#monotouchtest-iphonerelease64

* [tools] Don't enable the IsDirectBinding optimization by default for Xamarin.Mac apps, it's not safe.

* Fix whitespace issues.

* [doc] Document optimizations.

* Officially support optimizations by adding them to the Versions.plist.

* [linker] Improve IntPtr.Size inliner + dead code eliminatior and add tests.

* Properly handle operands for the ldc_i4_s instruction (they're sbyte).
* Fix less-than condition to actually do a less-than comparison.
* Make sure to look up the bitness in the Target, not the Application, since
  the Application's value will be incorrect when building fat apps (both
  Is32Build and Is64Build will be true).
* Remove unnecessary checks for the IntPtr.Size inliner: this optimization
  does not depend on other instructions than the IntPtr.get_Size call, so
  remove the checks that verify surrounding instructions. This makes the
  IntPtr.Size inliner kick in in more scenarios (such as the new tests).
* Add tests.

* [tests] Add mmp tests for optimizations.

* [tests] Fix XM optimization tests.

* [tests] Fix test build error.
2018-01-23 11:33:48 +01:00
Rolf Bjarne Kvinge dadf5ca6e6
[mtouch] Make sure the xamarin_localized_string_format* functions are available in simlauncher. Fixes #3265. (#3269)
* [mtouch] Make sure the xamarin_localized_string_format* functions are available in simlauncher. Fixes #3265.

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

* [mtouch] Add test for simlauncher symbols, add add more missing symbols.
2018-01-22 14:21:24 +01:00
Rolf Bjarne Kvinge 64e85fac75
[xharness] Fixup paths in the Exclude attribute of Include nodes in csprojs as well. (#3267)
Fixes this rather puzzling build problem when building monotouch-test using xharness:

    obj/iPhoneSimulator/Debug-unified/Xamarin.iOS,Version=v1.0.AssemblyAttribute.cs(2,12): error CS0579: Duplicate 'global::System.Runtime.Versioning.TargetFrameworkAttribute' attribute

It happens only on Wrench (where it consistently fails), but it didn't happen
in the PR when this broke, nor could I reproduce it locally at first.

Initial investigation proved frustrating (searching for the file name
`Xamarin.iOS,Version=v1.0.AssemblyAttribute.cs` in the build log confirmed
that it was included multiple times on Wrench, but not locally), but after a
while I realized that there were multiple files with the same file name in the
build log:

     /Users/builder/data/lanes/1381/daf07005/source/xamarin-macios/tests/monotouch-test/obj/iPhone/Release64-unified/Xamarin.iOS,Version=v1.0.AssemblyAttribute.cs
     obj/iPhoneSimulator/Debug-unified/Xamarin.iOS,Version=v1.0.AssemblyAttribute.cs

One full path, and one relative, and one is obviously wrong.

Even more so once I realized that the full path's Platform/Configuration
(`iPhone/Release64-unified`) doesn't match the relative path's
Platform/Configuration (`iPhoneSimulator/Debug-unified`).

It's not even a test configuration we execute on Wrench, so how come the file
got there in the first place?

But it made it possible to reproduce locally: I just had to build monotouch-
test for device first, using tests.sln. Then I could reproduce the build error
when executing monotouch-test from xharness, since now I had the extraneous
file on my file system.

xharness will clone project files (to avoid parallel issues when building
multiple projects in parallel, all projects are built in their own
directories), and it turns out we didn't properly fixup all paths.

In particular the following:

    <Compile Include="**\*.cs" Exclude="obj\**">
      <Link>%(RecursiveDir)%(Filename).cs</Link>
    </Compile>

would be transformed into:

    <Compile Include="\Users\builder\data\lanes\1381\daf07005\source\xamarin-macios\tests\monotouch-test\**\*.cs" Exclude="obj\**">
      <Link>%(RecursiveDir)%(Filename).cs</Link>
    </Compile>

which meant that we'd include all files recursively in the monotouch-test
directory, excluding files from the project file's obj sub directory. And
since the project file was cloned, it would be in a different directory, and
thus not able to exclude files from the original monotouch-test/obj directory.

And with this knowledge the simple oneliner to fix it was trivial.

One mystery remained though: how was the extraneous
`Xamarin.iOS,Version=v1.0.AssemblyAttribute.cs` file generated when we don't
execute device tests on Wrench? After a while I remembered that the MTouch
tests build monotouch-test for device, even though they're not executed.

And this explains why the problem happens on wrench only: Jenkins didn't
execute the MTouch tests.
2018-01-22 10:49:38 +01:00
Sebastien Pouliot f5df902049
[foundation] Add NSBundle.GetLocalizedString returning an NSString. Fixes #41292 (#3266)
The original, now obsoleted, `LocalizedString` API returned a .net
`string` which does not work in most cases.

Different versions of iOS seems to return different (public or internal)
subclasses of `NSString` that are understood by other API (like NSString
`localizedStringWithFormat:`) for further customization.

Our logic to convert NSString to string is correct but it cannot
recreate the custom, required subclass to continue the localization.

So the new API return an `NSString` publicly (which is actually a
subclass) that can do the required job.

Adding a test in monotouch-test is presently blocked by #3265 [2]

[1] https://bugzilla.xamarin.com/show_bug.cgi?id=41292
[2] https://github.com/xamarin/xamarin-macios/issues/3265

* Add tests for new (and old) NSBundle API and adjust old ones since adding a Base.lproj directories changes things

* Add localization to xammac_tests since it shares the same, updated tests
2018-01-20 14:00:01 -05:00
Sebastien Pouliot dc7b19ce15
[tests] Confirm a device/sim support Metal before running MetalPerformanceShaders tests. Fixes #3237 (#3268)
https://github.com/xamarin/xamarin-macios/issues/3237
2018-01-19 11:21:21 -05:00
Rolf Bjarne Kvinge daf0700543
[xharness] No need to try to run (or even show) non-executable projects. (#3264) 2018-01-19 07:08:13 +01:00
Rolf Bjarne Kvinge 86a51076ed
[xharness] Adjust colors a bit. (#3263)
When determining the color for a collection of tests, first check if the
execution result is identical for all tests in the collection, in which case
just use the corresponding color for a single test.
2018-01-19 07:06:50 +01:00
Vincent Dondain 4da8016db4
[xtro] Report missing-protocol-conformance when protocols are defined… (#3187)
- Fixes bug #59272: [xtro] Report !missing-protocol-conformance! when protocols are defined in categories
(https://bugzilla.xamarin.com/show_bug.cgi?id=59272)
- Implemented missing protocol conformances based on tool's new data.
- Remove Internal check from VisitObjCCategoryDecl and VisitObjCInterfaceDecl
- Ignore previewItemTitle failure (normal since it's optional)
- Only skip UIStateRestoring for subclasses of UIViewController
- Ignore UIStateRestoring test on watchOS (UIViewController not available)
- Remove protocol conformances that generated wrong availability attributes (https://github.com/xamarin/xamarin-macios/issues/3213)
- Avoid new virtual or virtual when adding protocol conformance (https://github.com/xamarin/xamarin-macios/issues/3217)
2018-01-18 13:41:09 -05:00
Rolf Bjarne Kvinge 75e851fdda
[install-source] Add console runner from Nuget and fix xharness to restore nugets before attempting to build. (#3251)
xharness needs a solution in order to ask for a nuget restore, so make sure to
provide the path to the solution.

This fixes a build issue where the install source tests would fail to build
due to picking up the system's nunit.framework.dll because the nuget one
wasn't found/restored:

    MonoPathManglerTest.cs(8,3): error CS0619: 'TestFixtureAttribute' is obsolete: 'The NUnit framework shipped with Mono is deprecated and will be removed in a future release. It was based on NUnit 2.4 which is long outdated. Please move to the NUnit NuGet package or some other form of acquiring NUnit.'
    XamarinSourcesPathManglerTest.cs(8,3): error CS0619: 'TestFixtureAttribute' is obsolete: 'The NUnit framework shipped with Mono is deprecated and will be removed in a future release. It was based on NUnit 2.4 which is long outdated. Please move to the NUnit NuGet package or some other form of acquiring NUnit.'
    OpenTKManglerTest.cs(8,3): error CS0619: 'TestFixtureAttribute' is obsolete: 'The NUnit framework shipped with Mono is deprecated and will be removed in a future release. It was based on NUnit 2.4 which is long outdated. Please move to the NUnit NuGet package or some other form of acquiring NUnit.'
    PathManclerFactoryTests.cs(8,3): error CS0619: 'TestFixtureAttribute' is obsolete: 'The NUnit framework shipped with Mono is deprecated and will be removed in a future release. It was based on NUnit 2.4 which is long outdated. Please move to the NUnit NuGet package or some other form of acquiring NUnit.'
    OpenTKManglerTest.cs(29,4): error CS0616: 'TestCase' is not an attribute class
    OpenTKManglerTest.cs(30,4): error CS0616: 'TestCase' is not an attribute class
    MonoPathManglerTest.cs(29,4): error CS0616: 'TestCase' is not an attribute class
    MonoPathManglerTest.cs(30,4): error CS0616: 'TestCase' is not an attribute class
    MonoPathManglerTest.cs(31,4): error CS0616: 'TestCase' is not an attribute class
    XamarinSourcesPathManglerTest.cs(33,4): error CS0616: 'TestCase' is not an attribute class
    XamarinSourcesPathManglerTest.cs(35,4): error CS0616: 'TestCase' is not an attribute class
    XamarinSourcesPathManglerTest.cs(37,4): error CS0616: 'TestCase' is not an attribute class
    OpenTKManglerTest.cs(36,4): error CS0616: 'TestCase' is not an attribute class
    OpenTKManglerTest.cs(37,4): error CS0616: 'TestCase' is not an attribute class
    MonoPathManglerTest.cs(37,4): error CS0616: 'TestCase' is not an attribute class
    MonoPathManglerTest.cs(38,4): error CS0616: 'TestCase' is not an attribute class
    MonoPathManglerTest.cs(39,4): error CS0616: 'TestCase' is not an attribute class
    XamarinSourcesPathManglerTest.cs(47,4): error CS0616: 'TestCase' is not an attribute class
2018-01-18 16:58:56 +01:00
Rolf Bjarne Kvinge eefdd17e15
[xharness] Fix Makefile generation of grouped targets with spaces. (#3250)
These targets will already be properly escaped (using backslash), so adding
quotes will cause make to treat the backslashes literally (and break).

Fixes an issue with package-tests:

    $ make package-tests
    [...]
    build-mac-classic-dont\ link failed
    build-mac-unified-dont\ link failed
    build-mac-unifiedXM45-dont\ link failed
    build-mac-unified32-dont\ link failed
    build-mac-unifiedXM4532-dont\ link failed
    build-mac-unified-link\ all failed
    build-mac-unified-link\ sdk failed
    make[4]: *** [build-mac] Error 1
    make[3]: *** [mac-test-package.zip] Error 2
    make[2]: *** [package-tests] Error 2
2018-01-18 09:08:20 +01:00
Rolf Bjarne Kvinge 034ce91212
[xharness] Add project configuration to run Jenkins-style tests. (#3249) 2018-01-18 07:16:24 +01:00
Rolf Bjarne Kvinge dee0fd984a
[xharness] Run monotouch-test both with and without the static registrar in the simulator. (#3236)
* [xharness] Run monotouch-test both with and without the static registrar in the simulator.

This way we catch (some) problems with the static registrar without having to run on device.

* [xharness] Add comments to explain extra test configurations.

* [xharness] Fix how projects are cloned.

Fix how projects are cloned so that xharness doesn't end up confused when
multiple test tasks share the same build task.

Previously xharness would iterate over all test tasks and modifying their
build tasks, now it will create the build tasks correctly in the first place.
2018-01-18 07:14:07 +01:00
Rolf Bjarne Kvinge 580ad2b826
[ImageKit] Fix a few protocols to be informal. (#3235)
* [ImageKit] Fix a few protocols to be informal.

Both of these protocols have been informal (categories) since their
introduction in macOS 10.5 (and they've not been made real protocols either).

    $ git grep interface.*IKImageBrowserDataSource
    MacOSX10.5.sdk/System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/ImageKit.framework/Versions/A/Headers/IKImageBrowserView.h:@interface NSObject (IKImageBrowserDataSource)
    MacOSX10.6.sdk/System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/ImageKit.framework/Versions/A/Headers/IKImageBrowserView.h:@interface NSObject (IKImageBrowserDataSource)
    MacOSX10.7.sdk/System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/ImageKit.framework/Versions/A/Headers/IKImageBrowserView.h:@interface NSObject (IKImageBrowserDataSource)
    MacOSX10.8.sdk/System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/ImageKit.framework/Versions/A/Headers/IKImageBrowserView.h:@interface NSObject (IKImageBrowserDataSource)
    MacOSX10.9.sdk/System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/ImageKit.framework/Versions/A/Headers/IKImageBrowserView.h:@interface NSObject (IKImageBrowserDataSource)
    MacOSX10.10.sdk/System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/ImageKit.framework/Versions/A/Headers/IKImageBrowserView.h:@interface NSObject (IKImageBrowserDataSource)
    MacOSX10.11.sdk/System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/ImageKit.framework/Versions/A/Headers/IKImageBrowserView.h:@interface NSObject (IKImageBrowserDataSource)
    MacOSX10.12.sdk/System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/ImageKit.framework/Versions/A/Headers/IKImageBrowserView.h:@interface NSObject (IKImageBrowserDataSource)
    MacOSX10.13.sdk/System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/ImageKit.framework/Versions/A/Headers/IKImageBrowserView.h:@interface NSObject (IKImageBrowserDataSource)

    $ git grep interface.*IKImageBrowserItem
    MacOSX10.5.sdk/System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/ImageKit.framework/Versions/A/Headers/IKImageBrowserView.h:@interface NSObject (IKImageBrowserItem)
    MacOSX10.6.sdk/System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/ImageKit.framework/Versions/A/Headers/IKImageBrowserView.h:@interface NSObject (IKImageBrowserItem)
    MacOSX10.7.sdk/System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/ImageKit.framework/Versions/A/Headers/IKImageBrowserView.h:@interface NSObject (IKImageBrowserItem)
    MacOSX10.8.sdk/System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/ImageKit.framework/Versions/A/Headers/IKImageBrowserView.h:@interface NSObject (IKImageBrowserItem)
    MacOSX10.9.sdk/System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/ImageKit.framework/Versions/A/Headers/IKImageBrowserView.h:@interface NSObject (IKImageBrowserItem)
    MacOSX10.10.sdk/System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/ImageKit.framework/Versions/A/Headers/IKImageBrowserView.h:@interface NSObject (IKImageBrowserItem)
    MacOSX10.11.sdk/System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/ImageKit.framework/Versions/A/Headers/IKImageBrowserView.h:@interface NSObject (IKImageBrowserItem)
    MacOSX10.12.sdk/System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/ImageKit.framework/Versions/A/Headers/IKImageBrowserView.h:@interface NSObject (IKImageBrowserItem)
    MacOSX10.13.sdk/System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/ImageKit.framework/Versions/A/Headers/IKImageBrowserView.h:@interface NSObject (IKImageBrowserItem)

* [xtro] Update ignored data.
2018-01-16 23:32:37 +01:00
Rolf Bjarne Kvinge b699a0b29c
[tests] Create 'link all' and 'link sdk' tests for XM. (#3234)
* [tests] Add 'link all' test for XM.

* [tests] Add 'link sdk' test for XM.

* [tests] Move dontlink-mac tests to linker-mac directory to have the same directory layout as linker-ios.
2018-01-16 19:15:59 +01:00
Sebastien Pouliot 761a382f01
[macos][mediatoolbox] Add a macOS specific API for XM (#3220)
- added unit test (not much to test)
- xtro data updated
2018-01-16 08:42:11 -05:00
Alex Soto 76dcf100b3 [generator] Support [Async] inside categories, fixes bugzilla #57531 (#3229)
https://bugzilla.xamarin.com/show_bug.cgi?id=57531

Adds support for [Async] inside categories.
2018-01-16 08:41:25 -05:00
Manuel de la Pena a52748277d [CoreGraphics] Fix issue with the MakeMutable in CGPath where ref count was leaking. (#3228) 2018-01-15 16:35:05 -05:00
Rolf Bjarne Kvinge 7079a0581f
[tests] Disable some old-style tests on wrench, long live the new-style tests. (#3226)
These were accidentally not disabled when we started running tests on Wrench
like we do on Jenkins.

So disable them, to avoid duplicate work on Wrench.
2018-01-15 18:53:52 +01:00
Sebastien Pouliot 1c3c899933
[foundation] Reduce duplication inside NSData.FromString methods (#3221)
and ensure the temporary `NSString` instance is disposed asap.

Found will debugging something else. Unit tests added to confirm there
is no behavior change when the API are used.
2018-01-15 09:08:17 -05:00
Sebastien Pouliot 3a851e2a63
[mtouch][mmp] Report invalid debug symbols files. Fixes #3200 (#3203)
* [mtouch][mmp] Report invalid debug symbols files. Fixes #3200

Try to read the assembly with symbols and, if that fails, warn and
fallback to loading them without symbols.

This fixes cases were it's not easy to update or delete (e.g. nuget)
bad symbols files - so this cannot be an error without causing a lot
of pain.

However it needs to be reported, otherwise it wont be fixed (by the
publisher) and it can limit the debugability of the application and
the usefulness of the stacktraces.

Finally merge most of the resolver's code between mtouch and mmp so
we don't have to fix such issue twice anymore.

note: this needs to be slightly updated once we get a version of cecil
that can give us a more precise error message.

Also bring Rolf's tests from
https://github.com/xamarin/xamarin-macios/pull/3079

reference:
https://github.com/xamarin/xamarin-macios/issues/3200
2018-01-12 17:39:38 -05:00
Sebastien Pouliot 3a6d87940a
[coreanimation] Add [Protocol] to CAAnimationDelegate (#3204)
This now formal `CAAnimationDelegate` protocol had to be reverted [1]
because we did not support `FormalSince` at the time - and this broke the
static registrar when used with older SDK. Support was added in [2] but
did not include `CAAnimationDelegate` (but `CALayerDelegate` was fixed).

Because this was not a protocol the `Delegate` property expose it as a
`CAAnimationDelegate`, the concrete/model type, and not an interface.

The workaround so `ICAAnimationDelegate` can be used, thru the
`WeakDelegate`, requires to manually re-bind some API because the
generator won't allow this anymore (it's bad to expose a [Model]
when a [Protocol] exists).

xtro data updated

[1] https://github.com/xamarin/xamarin-macios/pull/698
[2] https://github.com/xamarin/xamarin-macios/pull/2130
2018-01-12 13:56:00 -05:00
Rolf Bjarne Kvinge d059dfce56
[xharness] Run mtouch and mmp tests when there are MSBuild changes. (#3209)
In particular the mmp tests build a lot of project files, which means they can
find issues whenever something in the MSBuild logic changes, so run them.

They would have caught https://github.com/xamarin/maccore/issues/612 for instance.
2018-01-12 17:05:54 +01:00
Rolf Bjarne Kvinge 8c4a6ce1f4
[xharness] Don't hardcode the project configuration in the generated Makefile. (#3208)
Fixes this:

    $ make run-mac-xammac_tests CONFIG=Release
    [... building release configuration ...]
    make[2]: xammac_tests/bin/x86/Debug/xammac_tests.app/Contents/MacOS/xammac_tests: No such file or directory
    make[2]: *** [exec-mac-unified-xammac_tests] Error 1
    make[1]: *** [run-mac-unified-xammac_tests] Error 2
    run-mac-unified-xammac_tests failed
2018-01-12 17:05:40 +01:00
Alex Soto 879a61faa7
[SceneKit] Add AddAnimation overload that takes a SCNAnimation (#3192)
Fixes xamarin/xamarin-macios#3166

Apple broke `addAnimation:forKey:` API by changing `CAAnimation` parameter into a
`ISCNAnimationProtocol` that was introduced in Xcode 9 (iOS 11 and company).

We can't break the existing API but we can add an extension method that
reuses the `CAAnimation` overload but takes a `SCNAnimation` and we
turn the `SCNAnimation` into a `CAAnimation` behind the scenes.

For XAMCORE_4_0 we corrected the protocol signature to take `ISCNAnimationProtocol` so there won't be a need for the extension method anymore.
2018-01-12 09:11:46 -06:00
Sebastien Pouliot 07c24949c0
[tests][macos] Enable more tests to be executed on macOS (XM) (#3191)
Largely related to somewhat recent frameworks/API additions to XM

ExternalAccessory was added to macOS 10.13 (Xcode9) and can't be run before that (including on the jenkins sierra bots). Also enable that test on tvOS (which added support in Xcode8)
2018-01-10 20:58:49 -05:00
Sebastien Pouliot b3b967e985
[macos][gameplaykit] Add missing 'unapplyGameModelUpdate:' API for XM (#3190)
xtro data updated
2018-01-10 11:31:35 -05:00
Sebastien Pouliot f9ceb5c39d
[metalperformanceshaders] Fix MPSImageLanczosScale base class change (#3170)
Sadly this creates a breaking change since the `ScaleTransform`
property was re-introduced with an incorrect signature in the new
base class `MPSImageScale`

Unless someone has an idea how to avoid it (I don't see an option)
then we'll have to document it in the 15.7 release notes.

Also add missing _SetScaleTransform call and related unit tests
2018-01-09 12:03:18 -05:00
Sebastien Pouliot caa1e702a9
[macos][photos] Add some missing error codes and constants for XM (#3181)
xtro data updated
2018-01-09 09:17:42 -05:00
Jeffrey Stedfast cfdf59dce4 [msbuild] Tweak the codesign logic for iOS Simulator builds (#3114)
Don't *always* codesign, especially for iOS8 which seems to break.

iOS Simulator builds should only be codesigned if they require
Entitlements (signified by RequireProvisionProfile).
2018-01-08 14:32:00 -05:00
Jeffrey Stedfast 316948e5d0 [msbuild] Repack all iOS Task assemblies into Xamarin.iOS.Tasks.dll (#3168) 2018-01-08 14:29:52 -05:00
Sebastien Pouliot 8db4cee7f2
[tests][xtro] Don't generate empty (0 length) files (#3169)
Empty results/files are common when things goes well - but are just
noisy, never helpful.
2018-01-08 11:54:59 -05:00