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

6470 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge a073c81c45
[AppKit] Implement [NSView sortSubviewsUsingFunction:context:] (#6485)
Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/941421.
2019-07-04 07:30:44 +02:00
Rolf Bjarne Kvinge 50f74bd916
[tests] Provision dotnet for the sample tests. Fixes xamarin/maccore#1811. (#6473)
Also synchronize configuration file creation to not run into threading issues.

Fixes https://github.com/xamarin/maccore/issues/1811.
2019-07-03 12:41:33 +02:00
Jonathan CONTE a2fc99458b [Tests][MapKit/PinAnnotationView] Changed assertion of PinTintColor property to work on other language than English (#6463)
Ensure that assertion is done to a know value to reduce the change of the test failing in case of a device being configured in a diff locale. 

Fixes issue $4114
2019-07-01 23:08:49 +02:00
Jonathan Peppers a51e9f8e88
[xibuild] support for SDK-style projects & Xamarin.Forms test (#6461)
Context: 4ecedac733/src/Shared/BuildEnvironmentHelper.cs (L567-L586)
Context: 1d71d99837/tools/xabuild

When using `xibuild` to build an SDK-style project:

    tools/xibuild/xibuild -- msbuild/tests/MyXamarinFormsApp/MyXamarinFormsAppNS/MyXamarinFormsAppNS.csproj /restore

It was failing with:

    Resolving SDK 'Microsoft.NET.Sdk'...
    Project "msbuild/tests/MyXamarinFormsApp/MyXamarinFormsApp.csproj" is building "msbuild/tests/MyXamarinFormsApp/MyXamarinFormsAppNS/MyXamarinFormsAppNS.csproj" (GetTargetFrameworks target(s)):
    Building with tools version "Current".
    msbuild/tests/MyXamarinFormsApp/MyXamarinFormsAppNS/MyXamarinFormsAppNS.csproj : error MSB4236: The SDK 'Microsoft.NET.Sdk' specified could not be found.

Looking at this code, it looks pretty familiar -- it came from xabuild!

xibuild was currently setting `MSBuildSDKsPath` via a config file:

    <msbuildToolsets default="Current">
      <toolset toolsVersion="Current">
        <property name="MSBuildSDKsPath" value="/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/msbuild/Current/bin/Sdks" />

Reviewing the source code for MSBuild, they don't even look for this
value via MSBuild properties... They just look for Visual Studio
directories and a `MSBuildSDKsPath` environment variable. We don't have
to use this in Xamarin.Android, because we do things a different way.
There was craziness involved to get both Windows & Mac working.

For this to work on Mac, we can just set `MSBuildSDKsPath` when
starting the new MSBuild process.

I cleaned up how `MSBUILD_EXE_PATH` is set so both of these variables
are just set via `ProcessStartInfo.EnvironmentVariables`.

Now I can fully build a Xamarin.Forms project that references a
netstandard library with `xibuild`:

    $ tools/xibuild/xibuild -- msbuild/tests/MyXamarinFormsApp/MyXamarinFormsApp.csproj /restore
    ...
    Build succeeded.
        0 Warning(s)
        0 Error(s)
    Time Elapsed 00:00:15.83

~~ New Tests ~~

I went ahead and added a new Xamarin.Forms project to test and verify
that it builds. It is the Blank Forms app template from latest VS4Mac.

With the changes to `xibuild`, I was able to build with the in-process
MSBuild APIs.
2019-07-01 12:20:32 -05:00
Rolf Bjarne Kvinge 1d13468f21
[xharness] Propagate the BUILD_REVISION variable to test apps to specify if we're in CI or not. Fixes xamarin/maccore#649. (#6467)
We have tests whose behavior changes when executed on CI, and those tests use
the BUILD_REVISION variable to detect where they're being executed. For this
to work we need to propagate the BUILD_REVISION variable to the test
executable.

Hopefully fixes https://github.com/xamarin/maccore/issues/649 now.
2019-07-01 19:02:56 +02:00
Jonathan CONTE 213b66991f [tests/README.md] Fix a typing error (#6464)
* Xamairn -> Xamarin
2019-07-01 11:43:59 +02:00
Manuel de la Pena cdfe6331e3 Bump mono to pick up TZ/DST fixes. (#6456) 2019-06-28 07:38:52 +02:00
Rolf Bjarne Kvinge 22699633ae
[xharness] Don't fail to write report if failing to list referenced assemblies. Fixes xamarin/maccore#1821. (#6448)
Fixes https://github.com/xamarin/maccore/issues/1821.
2019-06-28 07:31:02 +02:00
Manuel de la Pena 8c78006fc9
Bump mono sync android 346da980 (#6436) 2019-06-26 23:09:42 +02:00
Jonathan CONTE 5f8fedb396 [uikit] Add some 'advice' to UISearchController's constructors (#6416)
- Fixes #4114
2019-06-26 12:18:08 -04:00
Rolf Bjarne Kvinge 55887caf89
[GameController] GCGamepad is deprecated in the headers, so mark it as such. Fixes xamarin/maccore#1742. (#6417)
* [GameController] GCGamepad is deprecated in the headers, so mark it as such. Fixes xamarin/maccore#1742.

Fixes https://github.com/xamarin/maccore/issues/1742.

* Add attribute for tvOS too.
2019-06-26 07:38:26 +02:00
Manuel de la Pena 1d541fea71
[XHarness] Re-enable ignored corlib tests. (#6395) 2019-06-24 21:31:34 +02:00
Manuel de la Pena e57e1ff92a
[XHarness] Reneable tests in Mac OS X Full and ignore them in modern. (#6403)
After PR https://github.com/xamarin/xamarin-macios/pull/6291 there are
some tests that can be ran but had to be ignored.

Mono issue: https://github.com/mono/mono/issues/15329
2019-06-24 13:42:10 +02:00
Manuel de la Pena 82a1f814b3
[XHarness] Re-enable ignored test in Mac OS from xammac_net_4_5_System_xunit-test.dll (#6398)
After PR https://github.com/xamarin/xamarin-macios/pull/6291 we can run
the ignored tests.
2019-06-21 19:54:52 +02:00
Rolf Bjarne Kvinge ac5a4b1048
Add a new feature flag that indicates stable support for the Concurrent GC. Partial fix of #5909. (#6394)
Keep the old flag, otherwise the feature will disappear for IDE versions that
only check the old flag.

Partial fix for https://github.com/xamarin/xamarin-macios/issues/5909.
2019-06-21 14:57:59 +02:00
Alex Soto c09dfc0e9a
[Appkit] Add 'NullAllowed' to 'NSSegmentedControl.SetLabel' (#6379)
Fixes #6359
2019-06-21 07:17:02 -04:00
Whitney Schmidt e45c3ba794
bumping maccore (#6390) 2019-06-20 18:01:09 -04:00
Rolf Bjarne Kvinge 57ea8dbb91
[CoreFoundation] Remove StructLayout from the DispatchBlock class. (#6383)
The StructLayout is not needed on our classes, since we should never pass them
directly to P/Invokes (the .Handle property should always be used).

So remove the attribute from the DispatchBlock class. It seems DispatchBlock
was a struct in the initial implementation, then became a class as the pull
request in question evolved, but the StructLayout attribute remained.

Removing it also has another advantage: P/Invokes will throw a marshalling
exception if such a class is passed in (instead of the native function doing
random things because we passed in garbage).
2019-06-20 15:16:18 +02:00
Manuel de la Pena a60f3778c9
[Xharness][32b] Ignore a number of tests that fail on old devices. (#6372)
There are a number of test failures on old devices. The commit does
mainly two things:

1. Add suppor to ignore methods just in the 32b devices.
2. Ignore the failing tests from the BCL Test App 4.

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

Mono related issues:

https://github.com/mono/mono/issues/15261
https://github.com/mono/mono/issues/15262
https://github.com/mono/mono/issues/15263
2019-06-20 11:09:49 +02:00
Manuel de la Pena ec1490cd5e
Bump mono to pick up GC fixes. (#6375) 2019-06-20 10:50:56 +02:00
Manuel de la Pena 4e4eccacc9
[XHarness] Re-enable tests from System-xunit-tests.dll (#6373)
After PR https://github.com/xamarin/xamarin-macios/pull/6291 we can run
the test that blocked the test app.
2019-06-20 00:19:26 +02:00
Martin Baulig 992fc70156 [XHarness]: Convert xUnit / nUnit tests to run async. (#6291)
Make `TestRunner.Run()` async as we cannot sync-block on the UI thread.
2019-06-19 18:03:01 +02:00
Rolf Bjarne Kvinge a036c4ef2b
[tests] Handle Xcodes without proper versions by ignoring them. Fixes xamarin/maccore#1768. (#6364)
This can happen if an Xcode hasn't been completely/successfully installed or
removed.

Fixes https://github.com/xamarin/maccore/issues/1768.
2019-06-19 16:12:00 +02:00
Ankit Jain e271d5e18d Bump VSMac to 8.1.0.2742 to fix msbuild issues (#6279)
* Bump VSMac to 8.1.0.2742 to fix msbuild issues

This is required to get the support for the msbuild `ToolsVersion`
change from `15.0` to `Current`.

* [tests][msbuild] Fix Binding resources test with updated msbuild

Test failure with updated msbuild and vsmac 8.1:

```
Xamarin.iOS.Tasks.NativeReferencesNoEmbedding("iPhone").ShouldNotUnnecessarilyRebuildBindingProject(True)
     Binding project build did not create package?
  Expected: True
  But was:  False

at Xamarin.iOS.Tasks.NativeReferencesNoEmbedding.ShouldNotUnnecessarilyRebuildBindingProject (System.Boolean framework) [0x000a0] in <74b8f7d8a53e40109916d305bb4d7403>:0
at (wrapper managed-to-native) System.Reflection.RuntimeMethodInfo.InternalInvoke(System.Reflection.RuntimeMethodInfo,object,object[],System.Exception&)
at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo cul
ture) [0x0006a] in <0519fa732e8845b6a809ce9180f541db>:0
```

The test builds the project multiple times. Before the 3rd build, the project
file's timestamp is updated and expects that the binding package will be
rebuilt. But it is not, because the target `_CreateBindingResourcePackage`
doesn't depend on that project file. So, add that to the target inputs.

* [nuget] Use xibuild to run nuget

Fix errors seen during `nuget restore` for tests:

```
Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/xammac_tests/xammac_tests.csproj(213,3): error MSB4024: The imported project file "/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Mac/Xamarin.Mac.CSharp.targets" could not be loaded. Could not find file "/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Mac/Xamarin.Mac.CSharp.targets"
```
2019-06-19 07:07:26 +02:00
Rolf Bjarne Kvinge 7b63ee42ff
[CoreGraphics] Fix lifetime of delegates passed to CGPatternCreate. (#6356)
We may get callbacks after the managed CGPattern instance has been
disposed/garbage collected, so make sure our delegates survives that long.

Since the delegates don't need any instance state, just make them static.
2019-06-19 07:04:58 +02:00
Manuel de la Pena 4992af65b6
Bump mono 2019-02 to fdf6490d and sync with android. (#6338) 2019-06-17 21:21:32 +02:00
Manuel de la Pena fb8db95764
[Test][Security] Ensure that test does not fail depending on the device lang. (#6299)
We have a test that depends on the lang of the device. If the device is
not using 'en' set it as inconclusive.

Fixes https://github.com/xamarin/xamarin-macios/issues/6298
2019-06-17 16:21:54 +02:00
Rolf Bjarne Kvinge a568b39807
[system-dependencies] Add support for installing the expected CoreSimulator.framework version. (#6275) 2019-06-13 23:46:16 +02:00
Martin Baulig 9fcfd2fe50
Merge pull request #6277 from baulig/work-streamcontent-ctor
Make NSUrlSessionHandler work with both HttpClient implementations.
2019-06-13 13:12:40 -04:00
Rolf Bjarne Kvinge e0dbde288d
Fix typo in mono URL. (#6280) 2019-06-13 14:38:09 +02:00
Manuel de la Pena 6fd9af50eb
[Xharness] Do use the traits provided by the mono sdk. (#6160)
Rather than hardcoding the tests ignored categories and traits, use the
ones that are provided by the mono sdk for each runner.
2019-06-12 23:51:08 +02:00
Martin Baulig e92a2903ce Make NSUrlSessionHandler work with both HttpClient implementations.
This is not a perfect solution, but the most robust and risk-free approach.

The `NSUrlSessionHandler` implementation depends on Mono-specific behavior, which makes
`SerializeToStreamAsync()` cancellable.  Unfortunately, the CoreFX implementation of
HttpClient does not support this.

By copying Mono's old implementation here, we ensure that we're compatible with both
HttpClient implementations, so when we eventually adopt the CoreFX version in all of
Mono's profiles, we don't regress here.
2019-06-12 15:24:45 -04:00
Marius Ungureanu 253170dfe9 Annotate NullAllowed for ToolTip properties in AppKit (#6119) 2019-06-12 06:13:13 -07:00
Rolf Bjarne Kvinge ed57182937
[system-dependencies] Show a URL to download Mono if Mono needs installing/updating. (#6262) 2019-06-11 19:14:22 +02:00
Alexander Köplinger b05c9cb5ab Fix from-source Mono build not generate proper dependencies (#6225)
The .deps.mk target didn't get generated because its dependency was wrong.

Also do not exclude tests from the dependencies, they should be rebuild when changed too.

Fixes #6224
2019-06-11 19:05:11 +02:00
Manuel de la Pena 46c16eb440
[Tests] Try different urls before failing the test. (#6237)
We do have a test that fails when there are issues accessing the remote
resource. Try different urls to ensure that it is not a network issue with a specific domain.

Fixes: https://github.com/xamarin/maccore/issues/1725
2019-06-11 19:04:42 +02:00
Rolf Bjarne Kvinge f25d5918d0
Bump maccore and macios-binaries to get fix for #6216. (#6229)
maccore diff: 454450958e..4cca112bc1

New commits in xamarin/macios-binaries:

* xamarin/macios-binaries@b474fa2 Bump mlaunch to xamarin/maccore@4cca112bc1 (#20)

macios-binaries diff: 718cef60c9..b474fa2e73

Fixes https://github.com/xamarin/macios-binaries/pull/20.
2019-06-11 11:52:59 +02:00
Sebastien Pouliot b1f7039ecd
Bump VS4M minimum to 8.0.0 (#6238)
This should solve the msbuild failures when recent system mono are used
to build the tests

Fix https://github.com/mono/mono/issues/14875

Also revert MAX_MONO_VERSION change from https://github.com/xamarin/xamarin-macios/pull/6221 since we should be able to use a newer mono with the VS4M bump

And bump the system mono to 6.0.0.286 (which was failing in previous builds)
2019-06-10 18:48:51 -07:00
Sebastien Pouliot c5dcb74d06
[foundation] Fix NSCopying.Copy - the biggest offender of not releasing its return value (#6230) 2019-06-10 14:42:43 -07:00
Manuel de la Pena a938253e5a
Bump Mono to the latests 2019-02 head (#6221) 2019-06-10 20:43:36 +02:00
Manuel de la Pena c9963ba686
[XHanress] Move ignore file to the correct dir. (#6220)
There was a merge issue (two diff PRs landing at diff times) which made
the file to be added to the wrong dir.

Fixes: https://github.com/xamarin/maccore/issues/1689
2019-06-07 13:06:36 +02:00
Vlad Brezae 5f5a584f1e [Tests] [BCL] Avoid converting from IEnumerable to IList (#6211)
Casting is wrong and can throw exception.

Fixes: https://github.com/mono/mono/issues/14729
2019-06-06 20:50:55 +02:00
Manuel de la Pena b9761d9c9e
[XHarness] Point to the correct directory that has the linker config. (#6208)
The path is poiting to the old dir.

Fixes: https://github.com/xamarin/maccore/issues/1690
2019-06-06 12:51:20 +02:00
Ankit Jain 55c4073cb3 [xibuild] Handle "incorrectly" cased msbuild property names (#6202)
msbuild property names are case insensitive. While generating the custom
app.config, in `SetToolsetProperty(..)` we try to update the property if
it already exists. But the name lookup was case sensitive, thus causing
the lookup to fail, resulting in two entries for the same property name
differing only in case. Eg. `MSBuildSDKsPath` vs `MSBuildSdksPath`.

Fixed to ignore case.

Fixes https://github.com/mono/mono/issues/14765 .
2019-06-03 20:47:50 -07:00
Rolf Bjarne Kvinge 7d67e0585c
[tests] Ignore BaseOptimizeGeneratedCodeTest.SetupBlockPerfTest when doing CI. Fixes xamarin/maccore#649. (#6183)
The BaseOptimizeGeneratedCodeTest.SetupBlockPerfTest test is randomly failing
fairly often now, which means it turns CI builds red.

So disable it, but since I don't like disabling tests I've only disabled it
when doing CI. Hopefully we'll find out if there are any regressions when
running tests locally.

Fixes https://github.com/xamarin/maccore/issues/649.
2019-06-03 07:54:30 -07:00
Rolf Bjarne Kvinge 4d8c0df299
[tests] Automatically download mono packages before running device builds. (#6187)
Automatically download mono packages and setup symlinks before running device
builds.

This simplifies the build scripts on Azure Devops slightly.
2019-06-03 07:40:17 -07:00
Rolf Bjarne Kvinge 01e5ec39f7
Merge pull request #6193 from rolfbjarne/maccore-issue-1682-workaround
[xharness] Improve marking and reporting of known failures in tests.
2019-06-03 07:38:09 -07:00
Rolf Bjarne Kvinge 17d73975c8 [xtro] 'raw' files might not exist. (#6191)
If we just fixed all the entries in the corresponding '*.ignore' file, there
won't be a '*.raw' file.
2019-06-01 19:50:11 -04:00
Rolf Bjarne Kvinge 0124e054f8
[sampletester] Use dotnet v2.2.1XX if available. (#6185)
Works around https://github.com/NuGet/Home/issues/7956.
2019-05-31 09:27:32 -07:00
Rolf Bjarne Kvinge 4dec01a585
[sampletester] Bump xamarin-forms-book-samples to the tip of master, where a few fixes have been merged. (#6186) 2019-05-31 09:24:19 -07:00