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

8024 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 862d200a18
[mtouch] Fix filename casing for Errors.resx. (#8247)
So that the name on disk matches the casing in the csproj.
2020-03-31 17:53:12 +02:00
Alexis Christoforides 4b94e3073b
Wrap mono_gc_init_finalizer_thread() call with now-needed coop GC state transition. (#8242)
Starting with https://github.com/mono/mono/pull/16907 , the Mono runtime ends in GC-Safe state (mode) after mono_jit_init_version() is called. The monotouch code did not expect that, and calls mono_gc_init_finalizer_thread() which also tries to enter GC-safe mode.

Should fix https://github.com/mono/mono/issues/19372
2020-03-31 09:28:02 +02:00
Manuel de la Pena f383593924
[Harness] Merge the Generator and the Factory in a same object and rename namespace. (#8222)
The Generator and the Factory classes are a xamarin-macios thing.
Initially, they were separated because the code that generated the bcl
tests was not inside xharness. That is not longer the case. We can merge
both classes, generalize the namespace and be more prepared to move out
of the xamarin-macios repo.
2020-03-30 23:23:33 -04:00
Manuel de la Pena 63fcc22bad
[Harness] Make sure we do not copy/generate the app sources more than once. (#8243)
Threading is hard, even with async. We reached a situation in which the
src code of the test applications from the template was being generated
more than once. Ideally, we could have a nice solution with
AsyncLazy<bool> and use the lazy async to copy the code, but it was
moved to netcore 5. The fix is a little uglier but valid, lock and
enure we only generate it once. Please note that you CANNOT use a lock
statement inside a async method.

Fixes: https://github.com/xamarin/xamarin-macios/issues/8240
2020-03-30 21:20:37 -04:00
Sebastien Pouliot 046daad997
[generator] Remove unneeded null checks in event args (#8241)
The calls to `Runtime.GetNSObject<T>` and `NSArray.ArrayFromHandle<T>`
already do the null / `IntPtr.Zero` check.

This generates a bit less code (always a good thing) and reduce the
number of nullability warnings.

Also use `Array.Empty<T>` instead of allocating empty arrays.

before
```
$ grep -r "new " src/build/  | grep "\[0]"
src/build//ios/native/ObjCRuntime/EventArgs.g.cs:					return new string [0];
src/build//ios/native/ObjCRuntime/EventArgs.g.cs:					return new MPTimedMetadata [0];
src/build//ios/native/ObjCRuntime/EventArgs.g.cs:					return new string [0];
src/build//ios/native/ObjCRuntime/EventArgs.g.cs:					return new string [0];
src/build//ios/native/AuthenticationServices/ASAuthorizationProviderAuthorizationOperation.g.cs:		static IntPtr[] values = new IntPtr [0];
src/build//mac/full/ObjCRuntime/EventArgs.g.cs:					return new string [0];
src/build//mac/full/AppKit/NSTextField.g.cs:				return new string[0];
src/build//mac/full/AuthenticationServices/ASAuthorizationProviderAuthorizationOperation.g.cs:		static IntPtr[] values = new IntPtr [0];
src/build//mac/mobile/ObjCRuntime/EventArgs.g.cs:					return new string [0];
src/build//mac/mobile/AppKit/NSTextField.g.cs:				return new string[0];
src/build//mac/mobile/AuthenticationServices/ASAuthorizationProviderAuthorizationOperation.g.cs:		static IntPtr[] values = new IntPtr [0];
src/build//tvos/tvos/ObjCRuntime/EventArgs.g.cs:					return new string [0];
src/build//tvos/tvos/AVFoundation/AVMetadataObjectType.g.cs:		static IntPtr[] values = new IntPtr [0];
src/build//watch/watch/ObjCRuntime/EventArgs.g.cs:					return new string [0];
src/build//watch/watch/AVFoundation/AVMetadataObjectType.g.cs:		static IntPtr[] values = new IntPtr [0];
```

after
```
grep -r "new " src/build/  | grep "\[0]"
src/build//ios/native/AuthenticationServices/ASAuthorizationProviderAuthorizationOperation.g.cs:		static IntPtr[] values = new IntPtr [0];
src/build//mac/full/AppKit/NSTextField.g.cs:				return new string[0];
src/build//mac/full/AuthenticationServices/ASAuthorizationProviderAuthorizationOperation.g.cs:		static IntPtr[] values = new IntPtr [0];
src/build//mac/mobile/AppKit/NSTextField.g.cs:				return new string[0];
src/build//mac/mobile/AuthenticationServices/ASAuthorizationProviderAuthorizationOperation.g.cs:		static IntPtr[] values = new IntPtr [0];
src/build//tvos/tvos/AVFoundation/AVMetadataObjectType.g.cs:		static IntPtr[] values = new IntPtr [0];
src/build//watch/watch/AVFoundation/AVMetadataObjectType.g.cs:		static IntPtr[] values = new IntPtr [0];
```

and the remaining are not related to the same generator code.
2020-03-30 20:29:04 -04:00
monojenkins 7ebaaf4ae0
[siminstaller] Update parsing xml because Apple changed their schema. (#8231)
Apparently file sizes can be real numbers now, because in the manifest of
downloadable simulators there's one entry where the fileSize is a real:

			<key>fileSize</key>
			<real>2049324382</real>

when every other file size in the manifest is an integer.

So handle real file sizes too, and fix file size parsing to not throw
exceptions if the number can't be parsed. Maybe we'll get imaginary file sizes
too one day...

Fixes this exception:

    Unhandled Exception:
    System.NullReferenceException: Object reference not set to an instance of an object
      at xsiminstaller.MainClass.Main (System.String[] args) [0x00617] in /Users/rolf/work/maccore/d16-6/xamarin-macios/tools/siminstaller/Program.cs:194

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2020-03-30 16:50:03 -04:00
Sebastien Pouliot 16ce9c671b
[generator] Remove unreachable code (#8237)
An earlier `wrap != null` condition ends with a `return` so any check or
code assuming `wrap == null` must always be executed, while any `wrap != null`
will never be.
2020-03-30 15:43:29 -04:00
Manuel de la Pena bdce02622f
[Harness] Remove the BCLTestProjectInfo class. (#8221)
Remove two classes that are not really needed and a method. We moved to
named tuples to make things simpler. Unfortunally C# does not support:

```csharp
using MyNamedTuple = (string Name, double value, bool answer);
```

But we have to live with this. Makes the namespace simpler and removes
confusion with the already present project classes that are more widely
used.

* [Harness] Remove the BCLTestProjectInfo class.

The class is not really needed. Move to a tuple, make the definition of
the group test project nicer since the dictionary initiallization makes
it cleaner.
2020-03-30 15:20:50 -04:00
Chris Hamons 22fb31bef6
[macOS] Add various Photo extensions that were missed (#8236)
- https://github.com/xamarin/xamarin-macios/issues/8225
2020-03-30 13:22:56 -05:00
Manuel de la Pena 728442e01f
[Harness] If empty nodes are found, do not crash. (#8201)
Looks like we have cases in which we get empty nodes when listing
devices, which makes the parsing of the nodes fail and crash.

Move the code to a diff method, try to parse the data, if there is an
exception (missing data) return null. If null is returned, do not add
it.

Fixes: https://github.com/xamarin/xamarin-macios/issues/8160
2020-03-30 10:41:38 -04:00
Sebastien Pouliot f1508bff64
[tests][bcl] Ignore some known failures on arm/32 bits (#8216) 2020-03-30 08:26:36 -04:00
Manuel de la Pena 0ffd4faa64
[Harness] Add a new known failure to help the mionitoring person. (#8227)
Looks like mono is not investing much time at the moment fixing
https://github.com/mono/mono/issues/18560

The above error happens always on 32b device tests. Added a new known
failure for the monitoring to use in their task so that they do not have
to goole the issue and they know that is knonw already.
2020-03-30 07:29:52 -04:00
Manuel de la Pena b371133216
[Harness] Verify that issue #8214 is fixed. (#8229)
Added a test in the xml parser that verifies that the parsing of the xml
is correct and that the correct number of failures is reported in the
human readable form.

fixes: https://github.com/xamarin/xamarin-macios/issues/8214
2020-03-30 07:29:22 -04:00
Manuel de la Pena 3623d7a72f
[Harness] Remove not needed classes from the BCLTestImporter. (#8218)
Remove two classes that are not really needed and a method. We moved to
named tuples to make things simpler. Unfortunally C# does not support:

```csharp
using MyNamedTuple = (string Name, double value, bool answer);
```

But we have to live with this. Makes the namespace simpler and removes
confusion with the already present project classes that are more widely
used.
2020-03-30 07:26:15 -04:00
Manuel de la Pena 5230620392
[Mono] Bump mono to 2020-02 becc5fb to match android (#8219)
Commits:

* mono/mono@beccf5ba43: [2020-02] Use GArray instead of GList when getting custom attributes from an image (#19102)
  * mono/mono@5bea89d861: [llvm] Disable running the llvm verifier by default, it was enabled by mistake, and it takes a long time. (#19332)
  * mono/mono@4b0424cd68: [2020- 02][debugger] Implementing step through multithreaded code. (#19343)
  * mono/mono@2444b38b3c: [2020-02] [dim] Class overriding interface method that was already override by another interface (#19121)
  * mono/mono@93a2f4ea39: Fix suspend_policy that will be sent to debugger-libs, because on debugger-libs we want to resume the VM only when it's suspended, but we were sending the wrong suspend_policy in the case of EVENT_KIND_VM_START and mono is started with suspend=y. (#19330)
  * mono/mono@0565f6e2c0: Do not access unloading domains in debugger (case 1013579) (#19322)
  * mono/mono@b7196c45e8: [jit] Initialize correct class for tls fields (#19300) (#19313)
  * mono/mono@88c1989895: [2020-02] [merp] Add breadcrumb for StackHash (#19242)
  * mono/mono@d2be7389b1: [2020-02] [corlib] Suppress finalization of underlying console FileStreams (#19164)

Full diff: a7e29665d2...beccf5ba43
2020-03-30 07:24:52 -04:00
Přemek Vysoký 7d47b073cf
[Harness] Remove AppRunner references from TestReporter (#8212) 2020-03-29 12:02:03 -04:00
Sebastien Pouliot 29a530c0f3
[corenfc] Add missing enum members in NFCTagType (#8213)
Fix https://github.com/xamarin/xamarin-macios/issues/8210
2020-03-27 16:20:55 -04:00
Přemek Vysoký 6209719f51
[Harness] Remove Harness as a dependency (#8203) 2020-03-27 12:41:31 -04:00
Alex Soto dddcba9dc4
Merge pull request #8207 from dalexsoto/master-xcode11.4
[xcode11.4] Merge d16-5-xcode11.4 into master
2020-03-27 10:58:32 -04:00
Přemek Vysoký 46a2d96c55
[Harness] Fix XHarness unit tests (#8208)
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2020-03-27 09:46:54 -04:00
Alex Soto 54194e71f1
Apply suggestions from code review 2020-03-27 09:34:08 -04:00
Rolf Bjarne Kvinge b55b8e8e0b
[mmp] Remove MonoMacPreserveCode, it's not needed anymore. (#8204)
It's preserving code for NativeImplementationBuilder, which we removed many,
many years ago.
2020-03-27 11:26:29 +01:00
Alex Soto 3ff3e07ebe Merge remote-tracking branch 'xamarin/d16-5-xcode11.4' 2020-03-26 19:59:14 -04:00
Chris Hamons 53964c0af0
[mac] Add NSScrollView.WillStartLiveScrollNotification (#8205)
- https://github.com/xamarin/xamarin-macios/issues/7712
2020-03-26 16:15:50 -05:00
Přemek Vysoký a48667b761
[Harness] Remove TextWriter dependency, refactor Logging (#8184) 2020-03-26 09:59:43 -04:00
Přemek Vysoký 3f3c9af198
Fix BUILD_REVISION env argument (#8197)
Fixes #8185 and some other minor things problems in AppRunner
2020-03-25 12:38:10 -04:00
Manuel de la Pena a59d519775
[BCL] Ignore a failing test on devices. (#8195)
Ignore a failing test on devices. Related mono issue: https://github.com/mono/mono/issues/19308

Mono has to fix the issue, so we ignore in the meantime.



Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2020-03-25 11:24:07 -04:00
Přemek Vysoký d98c515a4c
[Harness] Add strongly typed mlaunch args and escape them (#8167)
Co-authored-by: Premek Vysoky <prvysoky@microsoft.com>
2020-03-25 10:59:29 -04:00
Alex Soto aa73e41254
[xcode11.4][UIKit] Update bindings to Xcode 11.4 Final (#8192)
* [UIKit] Update bindings to Xcode 11.4 Final

* Apply feedback
2020-03-25 10:52:11 -04:00
Manuel de la Pena 13e199a685
[Bump Mono] Bump mono to match android to a7e29665 (#8186)
Commits:

* [mono] Enter GC Unsafe mode in some string allocation functions (#19262) f0784b26dd
* Bump boringssl submodule c51a2eba84
* Bump nunitlite to get mono/NUnitLite#26 a7e29665d2

Full diff: d90665a422..a7e29665d2
2020-03-25 08:59:41 -04:00
Manuel de la Pena 0324fbab34
[Harness] Refactor, simplify and fix issues in the result parsing. (#8183)
Refactor result parsing and test it. Make sure that all the possible
corner cases are taken into account. The changes are as follow:

1. Move all the logic to a new class, which will take care of the reustl
parsing.
2. Simplify the parsing method by splitting the noise code to other
functions. There is no need to parse several files in the same method.
3. Add tests that make sure that the correct result is returned when:
  a. The app cannot launch.
  b. The app timesout.
  c. The app crashes.
2020-03-25 02:44:47 -04:00
Alex Soto 96e806c6e2
[FileProvider] Update bindings to Xcode 11.4 Beta 3 (#8075) (#8194) 2020-03-25 00:32:30 -04:00
Sebastien Pouliot aa5e17dfc5
[xcode11.4][intentsui] Add missing [DesignatedInitializer] (#8191) 2020-03-25 00:31:15 -04:00
Sebastien Pouliot 064886a09f
[xcode11.4][arkit] Add final bindings (ARKit 3.5) (#8190) 2020-03-24 22:29:32 -04:00
Alex Soto e8e78ff86e
[d16-5-xcode11.4] Initial bump to Xcode 11.4 Final (#8189) 2020-03-24 20:46:37 -04:00
Sebastien Pouliot e5e93f6c53
Revert "[tests] Adjust expected result of looking for 'mono_native_initialize'. Fixes xamarin/maccore#1809. (#6806)" (#8182)
This reverts commit e4a926e8f2.
2020-03-24 17:36:29 -04:00
Rolf Bjarne Kvinge a0aa48465b
Fix generator diff after .NET modifications. (#8180)
* Some files were renamed after the .NET support was implemented, so the list
  of files to ignore for the diff had to be updated.
* Update .gitignore.
2020-03-24 15:52:03 +01:00
Přemek Vysoký 6a58674960
Extract AppBundleInformationParser (#8174) 2020-03-24 10:02:22 +01:00
Sebastien Pouliot e9ff1f854d
It seems 'initWithRequest:cachedResponse:client:' is not called on 10.9 (#8173) 2020-03-23 20:55:51 -04:00
Rolf Bjarne Kvinge 3a30097d3a
[mtouch/mmp] Add better diagnostics if xcrun returns invalid data. (#8166) 2020-03-23 12:29:23 +01:00
Sebastien Pouliot 9f1ecfa85f
[tests][monotouch-test] Update UrlProtocolTest (#8168)
The _nice_ thing about `NSURLProtocol` is that it does not force the use
of the network - but we inflicted this upon us on tests.

So this updates the test to avoid the network, which should make it
more reliable and not so much influenced by the URL used or the OS
versions where it's executed.

This does not cover as much callback as before. However this it does
test that the NSUrlProtocol is registered correctly (what we care) and
the rest is largely only related the the OS (which is not the target
of our unit tests).

Hopefully fix https://github.com/xamarin/maccore/issues/1956
2020-03-20 21:52:43 -04:00
Waleed Chaudhry 09d0061317
[msbuild] Remove comment tags to fix translations out of sync issue (#8157) 2020-03-20 17:33:40 -04:00
Rolf Bjarne Kvinge d0b170bf8f
[d16-5-xcode11.4][mtouch/mmp] Only use stdout from xcrun as the path of the file that was found. Fixes #8147. (#8150) (#8164)
xcrun can print stuff to stderr even if it succeeds and prints what it found
to stdout, which means we have to separate stdout and stderr when capturing
xcrun's output.

This also means that we need a few changes to our RunCommand API:

* Add support for capturing stdout and stderr separately by providing
  different callbacks/StringBuilder instances.
* Use overloads instead of default arguments, because with default arguments
  we end up with ambiguous matches in a lot of places with the new overloads.

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

Backport of #8150.
2020-03-20 19:44:58 +01:00
Rolf Bjarne Kvinge dccf99a0ca
[tests] Work around xamarin/maccore#2177 by building test-libraries as part of the build. (#8163)
This is not a complete solution, because it doesn't work when running device
tests, because then we don't build locally. On the other hand, that bug has
never been a problem for device bots, so hopefully that won't change in the
future.

Ref: https://github.com/xamarin/maccore/issues/2177
2020-03-20 19:39:31 +01:00
Přemek Vysoký 29e978e0be
[Harness] Add AppRunner.RunAsync unit tests (#8159)
Co-authored-by: Premek Vysoky <prvysoky@microsoft.com>
2020-03-20 14:18:28 -04:00
Rolf Bjarne Kvinge c6e9932be9
[mtouch/mmp] Only use stdout from xcrun as the path of the file that was found. Fixes #8147. (#8150)
* [mtouch/mmp] Only use stdout from xcrun as the path of the file that was found. Fixes #8147.

xcrun can print stuff to stderr even if it succeeds and prints what it found
to stdout, which means we have to separate stdout and stderr when capturing
xcrun's output.

This also means that we need a few changes to our RunCommand API:

* Add support for capturing stdout and stderr separately by providing
  different callbacks/StringBuilder instances.
* Use overloads instead of default arguments, because with default arguments
  we end up with ambiguous matches in a lot of places with the new overloads.

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

* [tests] Fix mmptest build.

* [mtouch/mmp] Fix process log output.
2020-03-20 17:46:43 +01:00
Jo Shields b23c379dd8
Bump to mono:2020-02 (#7795)
Bump mono to 2020-02 head to be in sync with Android.

Co-authored-by: Imran Hameed <imhameed@microsoft.com>
Co-authored-by: Sebastien Pouliot <sebastien.pouliot@microsoft.com>
Co-authored-by: Ankit Jain <radical@gmail.com>
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
Co-authored-by: Sebastien Pouliot <sebastien.pouliot@gmail.com>
2020-03-20 10:38:47 -04:00
Přemek Vysoký ec420e6740
[Harness] Make CrashSnapshotReporter injectable and add unit tests (#8129)
* Move AppInstallMonitorLog

* Move Helpers.GenerateStableGuid

* Move DirectoryUtilities

* Move DirectoryUtilities.RootDirectory

* Add CrashSnapshot ctor

* refactor CrashReportSnapshot

* Add WrenchLog

* Move stuff out of Harness

* Remove RootDirectory

* Revert RootDirectory

* Remove Initialize() calls

* Make CrashReportSnapshot injectable

* Remove Harness dependency from CrashReportSnapshot

* Add device snapshot tests

* Trim down IHarness and make properties of Harness readonly

* Memoize xcoderoot

* Use MlaunchArguments

* Add MlaunchArguments docs

* Add CrashReportSnapshot docs

* Rename method

* Rename class

* Refactor CrashSnapshotReporter

* Inject AppRunner

* Indent parameters

* Indent parameters

* Fix unit tests

* Fix gathering crash logs

* Add crash logs to output

* Fix getting xcode root

* Fix alignment

Co-authored-by: Premek Vysoky <prvysoky@microsoft.com>
2020-03-20 11:42:43 +01:00
Rolf Bjarne Kvinge fcbb90982f
[tests] Remove test that used Xamarin.Mac/Classic. (#8151)
This test need substantial updates to work with Xamarin.Mac/Unified, and
there's very little gain in doing so, so just remove it.
2020-03-20 11:26:58 +01:00
Manuel de la Pena 79a089cd0d
[Harness] Generalize XmlResultParser. (#8156)
First step to try and clean up the psring of results and ensure that we
are doing the correct thing. We have several issue there. We want to
move all the complicated logic out of AppRunner and test the different
outputs and the full result matrix.

This commit first allows to use an instance class for the parsing, later
we will move things out. Step by step
2020-03-19 17:42:51 -04:00