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

10 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 8060e2f6d3
[tests] Use the correct OS version for Mac Catalyst. (#14143)
This fixes the CheckManagedFilters tests on Mac Catalyst on older macOS versions:

    [FAIL] CheckManagedFilters :   Managed filters not found for CIAreaMinMax, CIAreaMinMaxRed, CIAttributedTextImageGenerator, CIBarcodeGenerator, CIBicubicScaleTransform, CIBlendWithBlueMask, CIBlendWithRedMask, CIBokehBlur, CICameraCalibrationLensCorrection, CIColorCubesMixedWithMask, CIColorCurves, CICoreMLModelFilter, CIDepthBlurEffect, CIDepthToDisparity, CIDisparityToDepth, CIDither, CIDocumentEnhancer, CIEdgePreserveUpsampleFilter, CIGaborGradients, CIGuidedFilter, CIKeystoneCorrectionCombined, CIKeystoneCorrectionHorizontal, CIKeystoneCorrectionVertical, CIKMeans, CILabDeltaE, CIMeshGenerator, CIMix, CIMorphologyGradient, CIMorphologyMaximum, CIMorphologyMinimum, CIMorphologyRectangleMaximum, CIMorphologyRectangleMinimum, CIPaletteCentroid, CIPalettize, CIPerspectiveRotate, CIRoundedRectangleGenerator, CISaliencyMapFilter, CISampleNearest, CITextImageGenerator
      Expected: 0
      But was:  39
2022-02-16 20:11:57 +01:00
Rolf Bjarne Kvinge fcaf5f3c9f
[tests] Fix checking availability for .NET. (#13470)
Change the logic to detect if an API is available to:

* First check if there are any applicable UnavailableOSPlatform attributes,
  and only if an applicable attribute is found, then state that the API is
  unavailable (we can't ascertain that an API is available from an
  UnavailableOSPlatform attribute, only that it's unavailable).
* Once we know there are no applicable UnavailableOSPlatform attributes, we go
  on to check for applicable SupportedOSPlatform attributes, and if one is
  found, then we can say whether the API is available or not.
* If neither attributes were found, and we're building for Mac Catalyst, then
  repeat the two above checks for iOS instead.
* If still nothing, then assume the API is available (while incorrect, it's
  how our attributes are currently implemented).

This fixes introspection showing numerous test failures on older OS versions,
because we were detecting availability wrong - we were assuming that if
there's an UnavailableOSPlatform attribute whose version didn't match the OS
version, that the API was available (test case that proves this logic is
incorrect: OS version = 1.0, API introduced in 2.0, API unavailable in 3.0
- we'd detect that OS version 1.0 < unavailable in 3.0, and say "yay, we're
not unavailable, so we must be available!").
2021-12-01 17:29:20 +01:00
Rolf Bjarne Kvinge 5329b19f62
[introspection] Migrate .NET code to use the new .NET-style availability attributes. (#13363)
* [tools] Extract the logic to parse OSPlatformAttribute platform names to a separate file/class.

* [introspection] Migrate .NET code to use the new .NET-style availability attributes.

This also means using the 'ApplePlatform' enum instead of the 'PlatformName'
enum, because the latter will be removed in .NET.

* [FileProvider] Exclude some deprecated API from .NET.

* [AVFoundation] Adjust availability attribute for AVCaptureStillImageOutput.HighResolutionStillImageOutputEnabled.

* Update tests.
2021-11-22 20:54:07 +01:00
Rolf Bjarne Kvinge 617b88e270
[introspection] Share the logic for .NET between all platforms. (#12409)
* Share the logic for .NET between all platforms.
* This means adding a macOS variation of introspection for .NET.
* A few fixes to make sure the macOS variation passes:
    * Make NSTabViewController.SegmentedControl fully unavailable (it's never
      been in any stable version of Xcode).
    * Treat API with an Obsolete attribute as API with an Obsoleted attribute
      with regards to availability.
    * Ignore OSPlatform attributes we don't understand.
    * Ignore the ApiAvailabilityTest.LegacyAttributes test on macOS as well.
2021-08-13 09:32:56 +02:00
Sebastien Pouliot 05aa0c8aa8
[tests][introspection] Report error if no version is present in [SupportedOSPlatformAttribute] (#11193)
Otherwise a `[SupportedOSPlatformAttribute ("ios12,3")]` (should be a
dot, not a comma) would throw a `NullReferenceException` making it
harder to track down the error
2021-04-12 14:56:06 -04:00
Sebastien Pouliot 4e48aa2ae1
[generator][dotnet] Add support for `[Uns|S]upportedOSPlatformAttribute` (#10580)
This moves our current/legacy attributes to the ones added in dotnet 5 [1].

Short Forms (only in bindings)

| Old                                   | New                                 |
|---------------------------------------|-------------------------------------|
| [iOS (7,0)]                           | [SupportedOSPlatform ("ios7.0")]    |
| [NoIOS]                               | [UnsupportedOSPlatform ("ios")]     |

Long Forms

| Old                                   | New                                 |
|---------------------------------------|-------------------------------------|
| [Introduced (PlatformName.iOS, 7,0)]  | [SupportedOSPlatform ("ios7.0")]    |
| [Obsoleted (PlatformName.iOS, 12,1)]  | [Obsolete (...)]                    |
| [Deprecated (PlatformName.iOS, 14,3)] | [UnsupportedOSPlatform ("ios14.3")] |
| [Unavailable (PlatformName.iOS)]      | [UnsupportedOSPlatform ("ios")]     |

Other changes

* `[SupportedOSPlatform]` and `[UnsupportedOSPlatform]` are not allowed on `interface` [2] which means they cannot be used for protocols. This is currently handled by inlining the existing attributes on all members.
* `[ObsoletedInOSPlatform]` was removed in net5 RC. This PR is now mapping the existing attributes to `[Obsolote]`, however multiple ones cannot be added so they need to be platform specific.

Remaining work (manual bindings update) tracked in https://github.com/xamarin/xamarin-macios/issues/11055

References

* [1] https://github.com/xamarin/xamarin-macios/issues/10170
* [2] https://github.com/dotnet/runtime/issues/47599
* [3] https://github.com/dotnet/runtime/issues/47601
2021-04-10 11:09:14 -04:00
Alex Soto 06185ea8fc [monotouch-tests] Import some fixes from xamarin/xamarin-macios#10587 2021-04-06 22:59:51 -04:00
Rolf Bjarne Kvinge 2b2f1d08dc
[tests] Remove Classic code from all tests. (#8702) 2020-05-28 16:35:09 +02: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
Chris Hamons 04e7b77f1a Remove duplication found in tests and unify namespaces of common code (#250)
* Remove duplication found in tests and unify namespaces of common code

* Stub out dontlink-mac since introspection took over
2016-06-21 15:46:07 -08:00