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

6417 Коммитов

Автор SHA1 Сообщение Дата
Alex Soto 928048d681 Merge remote-tracking branch 'xamarin/main' into net8.0-merge-main 2023-07-22 21:44:02 -04:00
JonnHard d1d3dcdf68
Add getFileProviderConnectionWithCompletionHandler signature to start… (#18533)
… supporting XPC on File Provider instance

File Provider Service can act as an standalone XPC that you can
establish the connection with.
To open up the capability this new signature has to be exposed

---------

Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
Co-authored-by: Alex Soto <alex@alexsoto.me>
2023-07-20 10:39:08 -04:00
Rolf Bjarne Kvinge e2c673972b [net8.0] Merge main into net8.0. 2023-06-29 17:05:54 +02:00
Rolf Bjarne Kvinge 64b4a5909a
[tests] Automatic network failure detection in tests. (#18439)
Detect if a url we use in our tests actually works, and if not, save the
results and ignore any subsequent test that tries to use that url.

---------

Co-authored-by: Haritha Mohan <harithamohan@microsoft.com>
2023-06-29 07:48:53 +02:00
Meri Khamoyan 3f6d43c756
[iOS] HybridGlobalization set flag in SDK (#18498)
Add HybridGlobalization flag in SDK and load icudt_hybrid.dat file when
HybridGlobalization is on.

Contributes to https://github.com/dotnet/runtime/issues/80689
2023-06-28 10:25:24 +02:00
Rolf Bjarne Kvinge 7f910487f5
[msbuild/dotnet] Handle dylibs that don't start with 'lib' better. Fixes #15044. (#18496)
For a given dylib named '/path/to/libMyLibrary.dylib', we pass this to the native linker:

    -L/path/to -lMyLibrary

however, that doesn't work unless the dylib's name starts with 'lib'.

So detect this, and if the dylib doesn't start with 'lib' (say it's just
'MyLibrary.dylib'), then just pass the path to the dylib as-is to the native
linker:

	/path/to/MyLibrary.dylib

Fixes https://github.com/xamarin/xamarin-macios/issues/15044.
2023-06-27 07:55:04 +02:00
Rolf Bjarne Kvinge 15b7907eab [net8.0] Merge main into net8.0. 2023-06-23 17:03:50 +02:00
Rolf Bjarne Kvinge 94cdec2f53 [xharness] Disable NativeAOT test variations for Mac Catalyst for now, we need a few upstream fixes. 2023-06-22 08:44:47 +02:00
Rolf Bjarne Kvinge e31b0a6dc4 [xharness] Disable NativeAOT test variations for macOS for now, we're waiting for a dotnet/runtime fix. 2023-06-22 08:44:47 +02:00
Rolf Bjarne Kvinge 8ac35baf44 [tests] Disable the NUnitLite and Touch.Unit references for the .NET 7 tests.
We had to bump NUnitLite and Touch.Unit's TargetFramework properties to
net8.0-* (otherwise projects using NativeAOT fails if these projects are
referenced), which means they can't be used from .NET 7 (aka our .NET 7
tests).

So just don't reference NUnitLite and Touch.Unit in this test.
2023-06-22 08:44:47 +02:00
Rolf Bjarne Kvinge c49888bee1 [tests] Adjust ConfigTest to cope with different behavior when using NativeAOT. 2023-06-22 08:44:47 +02:00
Rolf Bjarne Kvinge 7d65804e32 [dotnet/tests] Only use NativeAOT when publishing.
This matches how NativeAOT works for other platforms.
2023-06-22 08:44:47 +02:00
Rolf Bjarne Kvinge 0adbf77643 [tests] Fix computing when the dynamic registrar is used. 2023-06-22 08:44:47 +02:00
Rolf Bjarne Kvinge 890d3cadf6 [tests] Adjust asserts since some collection assert doesn't work with NativeAOT.
Rewrite a few asserts, since NUnitLite isn't actually trimmer-safe, and some collection
asserts don't work with NativeAOT.
2023-06-21 20:49:53 +02:00
Rolf Bjarne Kvinge 5b8d60bbe3 [tests] Adjust RegistrarTest to always expected the dynamic registrar to be removed for NativeAOT 2023-06-21 20:49:53 +02:00
Rolf Bjarne Kvinge 31052141e7 [tests] Detect NativeAOT correctly in the Symbols test 2023-06-21 20:49:52 +02:00
Rolf Bjarne Kvinge 7f15d8625e [xharness] Add a NativeAOT variation of monotouch-test. 2023-06-21 20:49:50 +02:00
EmilienDup 7cea2a8c3a
NSUrlSessionHandler should propagate network exceptions (#18459)
fixes #18458
2023-06-20 07:27:46 +02:00
Rolf Bjarne Kvinge a192eed02b [net8.0] Merge main into net8.0. 2023-06-19 23:23:04 +02:00
Rolf Bjarne Kvinge aab0ed1362
[AVFoundation] Fix a few issues with the AVAssetImageGenerator bindings. Partial fix for #18452. (#18460)
* The 'copyCGImageAtTime:actualTime:error:' selector is deprecated, so
replicate that.
* Bind the 'generateCGImageAsynchronouslyForTime:completionHandler:'
selector.

Fixes parts 1 and 2 of https://github.com/xamarin/xamarin-macios/issues/18452.
2023-06-19 19:16:29 +02:00
Rolf Bjarne Kvinge 959bb55d86
[tests] Fix formatting issues. (#18453) 2023-06-16 13:58:49 +02:00
Rolf Bjarne Kvinge 7df3eb1520
[dotnet] Add targets to compute mlaunch arguments for installing and launching mobile apps. Fixes #18359. (#18446)
Add public targets to compute the mlaunch command lines for installing
and launching mobile apps.

These new targets are:

* ComputeMlaunchInstallArguments
* ComputeMlaunchRunArguments

As part of this change, also create a few new public properties:

* MlaunchPath
* MlaunchRunArguments
* MlaunchInstallArguments
* MlaunchRunScript
* MlaunchInstallScript

If the *Script variables are set, the corresponding target will create a
script file with the path to mlaunch + the corresponding arguments.

Otherwise, it's also possible to get the arguments directly from the
build log.

Fixes https://github.com/xamarin/xamarin-macios/issues/18359.
2023-06-15 07:21:09 +02:00
dotnet-maestro[bot] ab01ac85ad
[net8.0] Update dependencies from dotnet/installer (#18385)
This pull request updates the following dependencies

## Coherency Updates

The following updates ensure that dependencies with a *CoherentParentDependency*
attribute were produced in a build used as input to the parent dependency's build.
See [Dependency Description Format](https://github.com/dotnet/arcade/blob/master/Documentation/DependencyDescriptionFormat.md#dependency-description-overview)

- **Coherency Updates**:
  - **Microsoft.NET.ILLink.Tasks**: from 8.0.0-preview.5.23272.14 to 8.0.0-preview.6.23307.4 (parent: Microsoft.Dotnet.Sdk.Internal)
  - **Microsoft.AspNetCore.App.Ref**: from 8.0.0-preview.5.23273.2 to 8.0.0-preview.6.23307.4 (parent: Microsoft.Dotnet.Sdk.Internal)
  - **Microsoft.NETCore.App.Ref**: from 8.0.0-preview.5.23272.14 to 8.0.0-preview.6.23307.4 (parent: Microsoft.Dotnet.Sdk.Internal)
  - **Microsoft.NET.Workload.Emscripten.Current.Manifest-8.0.100.Transport**: from 8.0.0-preview.5.23265.1 to 8.0.0-preview.6.23301.1 (parent: Microsoft.NETCore.App.Ref)
  - **Microsoft.NETCore.App.Ref**: from 8.0.0-preview.5.23272.14 to 8.0.0-preview.6.23307.4 (parent: Microsoft.Dotnet.Sdk.Internal)
  - **Microsoft.DotNet.Cecil**: from 0.11.4-alpha.23265.2 to 0.11.4-alpha.23301.1 (parent: Microsoft.NETCore.App.Ref)

## From https://github.com/dotnet/installer

- **Subscription**: f9b68d84-9c90-4bd0-5499-08db4112d57e
- **Build**: 20230607.25
- **Date Produced**: June 8, 2023 2:41:52 AM UTC
- **Commit**: f98e016a226c7637e13fb75bd6dc4949df58f7da
- **Branch**: refs/heads/main

- **Updates**:
  - **Microsoft.Dotnet.Sdk.Internal**: [from 8.0.100-preview.6.23279.5 to 8.0.100-preview.6.23307.25][35]
  - **Microsoft.NET.ILLink.Tasks**: [from 8.0.0-preview.5.23272.14 to 8.0.0-preview.6.23307.4][36]
  - **Microsoft.AspNetCore.App.Ref**: [from 8.0.0-preview.5.23273.2 to 8.0.0-preview.6.23307.4][37]
  - **Microsoft.NETCore.App.Ref**: [from 8.0.0-preview.5.23272.14 to 8.0.0-preview.6.23307.4][36]
  - **Microsoft.NET.Workload.Emscripten.Current.Manifest-8.0.100.Transport**: [from 8.0.0-preview.5.23265.1 to 8.0.0-preview.6.23301.1][38]
  - **Microsoft.NETCore.App.Ref**: [from 8.0.0-preview.5.23272.14 to 8.0.0-preview.6.23307.4][36]
  - **Microsoft.DotNet.Cecil**: [from 0.11.4-alpha.23265.2 to 0.11.4-alpha.23301.1][39]

[35]: 2de0392d49...f98e016a22
[36]: 8163d1643a...54dab738de
[37]: 39564d529f...8dea0b8d3b
[38]: 7a90ec9edc...63af043d58
[39]: f283c62293...ea84c8236c
2023-06-09 08:14:57 +02:00
Rolf Bjarne Kvinge 6f1c0ea534 [net8.0] Merge main into net8.0. 2023-06-08 13:32:48 +02:00
Rolf Bjarne Kvinge ea8a0c5fe7 Only print debug spew if the test fails. 2023-06-07 18:35:30 +02:00
Rolf Bjarne Kvinge 30fb5dfb42 Add some bot exclusions. 2023-06-07 15:10:34 +02:00
Rolf Bjarne Kvinge 9e2143032f
Use Enum.GetValues<T> instead of Enum.GetValues in numerous places for .NET. (#18382)
NativeAOT warns about Enum.GetValues and suggests using Enum.GetValues<T>
instead, so do just that.
2023-06-07 08:47:55 +02:00
Rolf Bjarne Kvinge 94a56f9a05 Add more debug code. 2023-06-07 08:04:47 +02:00
Haritha Mohan 4bbd7df8f5
[dotnet] Enable runtime identifiers to be overriden at build time (#18396)
Fixes #17707
The error target for when there is a conflict of interest in defining
both the runtime identifier and runtime identifiers is called during the
multi-rid builds, but not sure if the placement is the most ideal..

---------

Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
Co-authored-by: Alex Soto <alex@alexsoto.me>
2023-06-06 13:49:29 -07:00
Rolf Bjarne Kvinge 7a1c7a82c9 Add debug code. 2023-06-06 21:54:12 +02:00
Rolf Bjarne Kvinge b59587a0cd
[tests] Rework TestRuntime.RunAsync. (#18391)
* Move all the RunAsync logic to the TestRuntime class, instead of having some
  in TestRuntime and some in AppDelegate.
* Create a unified Task-based implementation for all platforms, optionally showing
  a UI on the platforms where we can do that.
* Remove all the overloads that took a DateTime timeout, and instead only use a
  TimeSpan timeout. This simplified some of the code.
* The new Task-based implementation will capture any exceptions (and rethrow most
  of them) from the tasks we're waiting for, so no need to do that in each RunAsync
  caller. This simplifies the testing code a lot for some tests.
* Add a new TryRunAsync method that will return (instead of rethrowing) any exceptions.
  This simplifies some of the testing code (which verifies the correct exception,
  or ignores the test in case of some exceptions).
* The new Task-based implementation will bubble up any NUnit exceptions, which
  means that the tasks we're waiting for can call NUnit's Assert and the right thing
  happens (in particular Assert.Ignore will actually ignore the test).
2023-06-06 21:36:49 +02:00
Rolf Bjarne Kvinge 1ca3c6ad8a
[tests] Adjust a few tests to not write a temporary file into the user directory. (#18394)
Fixes:

    MonoTouchFixtures.Foundation.NSFileManagerTest
    	[FAIL] GetSkipBackupAttribute : System.UnauthorizedAccessException : Access to the path '/private/var/mobile/Containers/Data/Application/F9F5B72D-D452-49F9-93AC-5CBB1E60A81C/DoNotBackupMe-NSFileManager-14036' is denied.
      ----> System.IO.IOException : Operation not permitted
    		   at Interop.ThrowExceptionForIoErrno(ErrorInfo , String , Boolean )
    		   at Interop.CheckIo(Error , String , Boolean )
    		   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String , OpenFlags , Int32 , Func`4 )
    		   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String , FileMode , FileAccess , FileShare , FileOptions , Int64 , UnixFileMode , Int64& , UnixFileMode& , Func`4 )
    		   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String , FileMode , FileAccess , FileShare , FileOptions , Int64 , Nullable`1 , Func`4 )
    		   at System.IO.File.OpenHandle(String , FileMode , FileAccess , FileShare , FileOptions , Int64 )
    		   at System.IO.File.WriteToFile(String , FileMode , String , Encoding )
    		   at System.IO.File.WriteAllText(String , String , Encoding )
    		   at System.IO.File.WriteAllText(String , String )
    		   at MonoTouchFixtures.Foundation.NSFileManagerTest.GetSkipBackupAttribute() in xamarin-macios/tests/monotouch-test/Foundation/FileManagerTest.cs:line 98
    		   at System.Reflection.MethodInvoker.InterpretedInvoke(Object , Span`1 , BindingFlags )
    		--IOException
    MonoTouchFixtures.Foundation.UrlTest
    	[FAIL] IsExcludedFromBackupKey : System.UnauthorizedAccessException : Access to the path '/private/var/mobile/Containers/Data/Application/F9F5B72D-D452-49F9-93AC-5CBB1E60A81C/DoNotBackupMe-NSUrl-14036' is denied.
      ----> System.IO.IOException : Operation not permitted
    		   at Interop.ThrowExceptionForIoErrno(ErrorInfo , String , Boolean )
    		   at Interop.CheckIo(Error , String , Boolean )
    		   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String , OpenFlags , Int32 , Func`4 )
    		   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String , FileMode , FileAccess , FileShare , FileOptions , Int64 , UnixFileMode , Int64& , UnixFileMode& , Func`4 )
    		   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String , FileMode , FileAccess , FileShare , FileOptions , Int64 , Nullable`1 , Func`4 )
    		   at System.IO.File.OpenHandle(String , FileMode , FileAccess , FileShare , FileOptions , Int64 )
    		   at System.IO.File.WriteToFile(String , FileMode , String , Encoding )
    		   at System.IO.File.WriteAllText(String , String , Encoding )
    		   at System.IO.File.WriteAllText(String , String )
    		   at MonoTouchFixtures.Foundation.UrlTest.IsExcludedFromBackupKey() in xamarin-macios/tests/monotouch-test/Foundation/UrlTest.cs:line 54
    		   at System.Reflection.MethodInvoker.InterpretedInvoke(Object , Span`1 , BindingFlags )
    		--IOException
2023-06-06 18:28:23 +02:00
Rolf Bjarne Kvinge 1a182ec08d [tests] Improve assert message for easier test failure diagnostics. 2023-06-06 18:24:48 +02:00
Rolf Bjarne Kvinge f47040e099 Merge remote-tracking branch 'origin/main' into bump-main-in-net8.0-2023-06-05 2023-06-06 18:22:29 +02:00
Rolf Bjarne Kvinge 11e7883da0
[tests] System.Numerics.Vector3.Length is a method, not a property, so treat it as such. (#18401)
Fixes:

    MonoTouchFixtures.Phase.PhaseObjectTest
    	[FAIL] ForwardTest :   length
			Expected: 1
			But was:  <System.Func`1[System.Single]>
    	[FAIL] RigthTest :   length
			Expected: 1
			But was:  <System.Func`1[System.Single]>
    	[FAIL] UpTest :   length
			Expected: 1
			But was:  <System.Func`1[System.Single]>
2023-06-05 15:46:33 +02:00
Rolf Bjarne Kvinge e6e25497a0 [net8.0] Merge main into net8.0. 2023-06-05 10:54:13 +02:00
Rolf Bjarne Kvinge 8d3a1aff7e
[tests] Fix warnings in tests/bgen/bgen-tests.csproj and enforce no more nullability warnings. (#18400) 2023-06-05 10:42:33 +02:00
Rolf Bjarne Kvinge 481ce215c9
[tests] Update the Xcode version check for Xcode 13.3. (#18390)
Fixes:

    MonoTouchFixtures.AVFoundation.CaptureMetadataOutputTest
    	[PASS] Defaults
    	[PASS] Flags
    	[FAIL] MetadataObjectTypesTest : System.NotImplementedException : The method or operation is not implemented.
    		   at TestRuntime.CheckXcodeVersion(Int32 major, Int32 minor, Int32 build) in xamarin-macios/tests/common/TestRuntime.cs:line 483
    		   at MonoTouchFixtures.AVFoundation.CaptureMetadataOutputTest.MetadataObjectTypesTest() in xamarin-macios/tests/monotouch-test/AVFoundation/CaptureMetadataOutputTest.cs:line 131
    		   at System.Reflection.MethodInvoker.InterpretedInvoke(Object , Span`1 , BindingFlags )
2023-06-05 10:27:32 +02:00
Rolf Bjarne Kvinge d33a5d812d
[tests] Use the NetworkResources class for urls instead of hardcoding them. (#18374) 2023-06-02 15:27:41 +02:00
Rolf Bjarne Kvinge a43b664584
[Foundation] Several fixes to NSFileManager. (#18371)
* Enable nullability.
* Add API that was previously iOS-specific to all platforms.
2023-06-02 15:19:42 +02:00
Rolf Bjarne Kvinge 7198886910
[tests] Give the CGImagePropertiesGPSTest some latitude with the coordinates. (#18375)
Seems like the actual values on device might be ever so slightly off.
2023-06-02 14:35:51 +02:00
Rolf Bjarne Kvinge 9e14229176
[tests] Adjust BundleTest to not use Assembly.Location, since it doesn't work in NativeAOT. (#18376) 2023-06-02 14:35:01 +02:00
Rolf Bjarne Kvinge fad26bcc3e
[tests] Adjust BundleTest to cope with a differently named app. (#18392)
It seems the actual app name might be "PublicStaging.app" on device now.

Fixes:

    MonoTouchFixtures.CoreFoundation.BundleTest
        [FAIL] TestExecutableUrl :
            Expected: String containing "monotouchtest.app/monotouchtest"
            But was:  "file:///private/var/containers/Bundle/Application/4B2AD441-C411-42D4-ACCB-4E964A905A17/PublicStaging.app/monotouchtest"
        [FAIL] TestResourcesDirectoryUrl :
            Expected: String containing "monotouchtest.app/"
            But was:  "file:///private/var/containers/Bundle/Application/4B2AD441-C411-42D4-ACCB-4E964A905A17/PublicStaging.app/"
        [FAIL] TestSupportFilesDirectoryUrl :
            Expected: String containing "monotouchtest.app/"
            But was:  "file:///private/var/containers/Bundle/Application/4B2AD441-C411-42D4-ACCB-4E964A905A17/PublicStaging.app/"
         [FAIL] TestUrl :
            Expected: String containing "monotouchtest.app/"
            But was:  "file:///private/var/containers/Bundle/Application/4B2AD441-C411-42D4-ACCB-4E964A905A17/PublicStaging.app/"
2023-06-02 14:32:05 +02:00
Rolf Bjarne Kvinge d98be15ea7
[tests] Fix typo in method name. (#18393) 2023-06-02 14:31:41 +02:00
Steve Hawley 91daf664c4
[dotnet] Add to optimizations (#18387)
add redirect-class-handles to test output along with options

---------

Co-authored-by: Alex Soto <alex@soto.dev>
2023-06-01 22:04:33 -04:00
Rolf Bjarne Kvinge b4f7daac08
[tests] Ignore the NWParametersTest.SetPrivacyContextText, it crashes everywhere. (#18383) 2023-06-01 12:03:56 +02:00
Rolf Bjarne Kvinge 92da968558 [net8.0] Merge main into net8.0. 2023-05-30 08:51:24 +02:00
Rolf Bjarne Kvinge 12be89c189
[CoreFoundation] Add a few missing APIs to CFRunLoop and enable nullability. (#18322) 2023-05-30 08:50:42 +02:00
Rolf Bjarne Kvinge d931a9f7ac Merge remote-tracking branch 'origin/main' into bump-main-in-net8.0-2023-05-26 2023-05-26 18:25:37 +02:00
Rolf Bjarne Kvinge 3dd412daa6
[tests] Adjust ImageCaptioningTest to clean up after itself and support concurrent execution. (#18329)
* This test creates a file in the temp directory, so make sure the file name
  is unique enough to not clash with any other test runs running concurrently.

Fixes this problem:

> SetCaption: System.IO.IOException : IO_SharingViolation_File, /var/folders/r7/kvhxkfw54qlc5y72d620783h0000gn/T/basn3p08.png


* Also delete the temporary file at the end of the test.

This PR is best viewed by ignoring whitespace, since it indents a big chunk of
code.
2023-05-25 10:50:08 +02:00