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

236 Коммитов

Автор SHA1 Сообщение Дата
Simon Rozsival 7a45bad062 Update test 2023-11-24 14:51:40 +01:00
GitHub Actions Autoformatter 7a39369644 Auto-format source code 2023-11-23 14:19:08 +00:00
Simon Rozsival 635ef072c9 Change the transformation of Preserve attribute into DynamicDependency 2023-11-23 14:08:31 +01:00
Rolf Bjarne Kvinge ad7996ee7b
Add the .NET TFM as a constant to the generated SdkVersions.cs from our Makefile variables. (#19401)
This way we can avoid hardcoding the TFM in a few more places.
2023-11-08 13:36:50 +01:00
Rolf Bjarne Kvinge 79ff82d046 [net8.0-xcode15] Merge net8.0 into net8.0-xcode15. 2023-09-18 18:28:24 +02:00
Rolf Bjarne Kvinge f88dc4406d [net8.0] Merge main into net8.0. 2023-09-14 07:23:52 +02:00
Rolf Bjarne Kvinge 059975888c
[tests] Move a calendar test from being macOS-specific to run on all platforms. Fixes #12468. (#18971)
By moving the test from a macOS-specific location to a general location, it
becomes obvious that the test behaves the same on all platforms (which the
issue was about: it looked like we had different behavior on macOS vs the
other platforms, and the issue requested validation that this was correct - by
running the test on all platforms, with no platform-specific code, it
demonstrates that there's no macOS-specific behavior).

Fixes https://github.com/xamarin/xamarin-macios/issues/12468.
2023-09-12 09:53:46 +02:00
Manuel de la Pena 558e45f9b8 [Linker] Fix regression tests for xcode 15. 2023-08-04 11:47:29 -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
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 94a56f9a05 Add more debug code. 2023-06-07 08:04:47 +02: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 1a182ec08d [tests] Improve assert message for easier test failure diagnostics. 2023-06-06 18:24:48 +02:00
Rolf Bjarne Kvinge b8c7dc7dc3 [net8.0] Merge main into net8.0. 2023-05-11 11:54:37 +02:00
Rolf Bjarne Kvinge 69eb2755b5
[tests] Ignore a network failure condition on bots in the LinkSdk.AsyncTests.Bug12221 test. (#18252) 2023-05-11 07:28:38 +02:00
Rolf Bjarne Kvinge 36af029204
Change all null checking expressions to use 'is' and 'is not'. (#18176)
Change all null checking expressions to use 'is null' and 'is not null'
instead of '== null' and '!= null'.

This was mostly done with sed, so code can probably be improved in many
other ways with manual inspection, but that will come over time.

Also add code to the autoformat script to automatically fix these issues in the future.
2023-05-05 17:52:19 +02:00
dotnet-maestro[bot] a7de036e62
[net8.0] Update dependencies from dotnet/installer (#17888)
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.3.23171.4 to 8.0.0-preview.4.23176.4 (parent: Microsoft.Dotnet.Sdk.Internal)
  - **Microsoft.AspNetCore.App.Ref**: from 8.0.0-preview.4.23171.7 to 8.0.0-preview.4.23176.6 (parent: Microsoft.Dotnet.Sdk.Internal)
  - **Microsoft.NETCore.App.Ref**: from 8.0.0-preview.3.23171.4 to 8.0.0-preview.4.23176.4 (parent: Microsoft.Dotnet.Sdk.Internal)
  - **Microsoft.NET.Workload.Emscripten.Current.Manifest-8.0.100.Transport**: from 8.0.0-preview.3.23167.1 to 8.0.0-preview.4.23170.1 (parent: Microsoft.NETCore.App.Ref)
  - **Microsoft.NETCore.App.Ref**: from 8.0.0-preview.3.23171.4 to 8.0.0-preview.4.23176.4 (parent: Microsoft.Dotnet.Sdk.Internal)

## From https://github.com/dotnet/installer
- **Subscription**: 9a2944cb-7dee-4bf2-a65c-08dabd10ae64
- **Build**: 20230328.2
- **Date Produced**: March 28, 2023 10:27:20 AM UTC
- **Commit**: 69e28735b98581f2ee0825953de83a8581df7563
- **Branch**: refs/heads/main

- **Updates**:
  - **Microsoft.Dotnet.Sdk.Internal**: [from 8.0.100-preview.4.23172.3 to 8.0.100-preview.4.23178.2][21]
  - **Microsoft.NET.ILLink.Tasks**: [from 8.0.0-preview.3.23171.4 to 8.0.0-preview.4.23176.4][22]
  - **Microsoft.AspNetCore.App.Ref**: [from 8.0.0-preview.4.23171.7 to 8.0.0-preview.4.23176.6][23]
  - **Microsoft.NETCore.App.Ref**: [from 8.0.0-preview.3.23171.4 to 8.0.0-preview.4.23176.4][22]
  - **Microsoft.NET.Workload.Emscripten.Current.Manifest-8.0.100.Transport**: [from 8.0.0-preview.3.23167.1 to 8.0.0-preview.4.23170.1][24]
  - **Microsoft.NETCore.App.Ref**: [from 8.0.0-preview.3.23171.4 to 8.0.0-preview.4.23176.4][22]

[21]: 27622e3898...69e28735b9
[22]: edb161ab06...8d5f520838
[23]: 16907a1efa...c2350729d0
[24]: 25d9f7a5e3...a464820353
2023-04-12 09:38:36 +02:00
Rolf Bjarne Kvinge a54ab5c42a
[tools/tests] Fix bug in 'link all' test and the resulting regression that showed up in code. (#18016)
There's a 'link all' test that's verifying that the IntroducedAttribute is
linked away. It does so by verifying that the linked app doesn't have a
'IntroducedAttribute' type - but the test was constructing the fully qualified
type name to look for incorrectly:

    ObjCRuntime.IntroducedAttribute, , Microsoft.iOS

Note the double comma: that meant we wouldn't find the type, even if it wasn't linked away.

The fix is easy (use a single comma), with one caveat (don't use a constant
string, because the linker sees the reference to
"ObjCRuntime.IntroducedAttribute" and _helpfully_ preserves it, exactly what
we don't want), but it revealed that the tested behavior regressed: a fully
linked app wouldn't link away the IntroducedAttribute.

So a fix is also needed: properly remove TVAttribute, WatchAttribute and
MacCatalystAttribute, which are subclasses of IntroducedAttribute (and what
would make the linker keep IntroducedAttribute).

Interestingly this showed up because of a bug in the runtime, where parsing
the invalid assembly name would now throw an exception
(https://github.com/dotnet/runtime/issues/84118).
2023-04-11 20:12:35 +02:00
Rolf Bjarne Kvinge c54f623141 [tests] Remove 32-bit architectures and logic from project files.
Additionally remove a lot of 64-bit-specific configurations
(Debug64/Release64) as well, and just make the default configurations
(Debug/Release) be 64-bit.
2023-02-02 16:30:29 +01:00
Rolf Bjarne Kvinge 94a3903df7 [tests] Bump min OS versions in all tests. 2023-02-02 16:30:28 +01:00
Rolf Bjarne Kvinge 50b6eda7c1 Merge main into net8.0. 2023-01-24 15:03:03 +01:00
Rolf Bjarne Kvinge 4453d773ce
[tests] Unify code related to how to load test assemblies. (#17111)
Unify a lot of code related to how to load test assemblies.

This resulted in adding a couple of test assemblies to monotouch-test when executed on macOS (this was a bug), and this also required adapting some of those tests to work correctly on macOS.
2023-01-13 22:20:47 +01:00
Rolf Bjarne Kvinge 9cdb2042ce Merge main into net8.0. 2022-12-12 18:01:02 +01:00
Rolf Bjarne Kvinge dc37be300e
Remove bitcode-related code, since bitcode is dead. (#16986) 2022-12-12 15:25:37 +01:00
Rolf Bjarne Kvinge 90c4972db1 Merge main into net8.0. 2022-12-07 08:07:44 +01:00
Rolf Bjarne Kvinge 407b4c4ac6
[tests] Add logic to detect when macOS and Mac Catalyst test apps don't launch properly. Fixes #xamarin/maccore@2414. (#16946)
Implement a launch timeout for macOS and Mac Catalyst apps where if a certain
environment variable (LAUNCH_SENTINEL_FILE) is set, the app will create that
file at launch. The code launching the test app will wait 10 seconds and check
if the file is there: if it's not, something went wrong, in which case the app
should be terminated and launched again.

This necessitated re-implementing the launch script in C#, since it got quite
complicated to implement in bash.

This fixes an issue with Mac Catalyst apps where something would go wrong
during the app launch and nothing would happen (but the app wouldn't be
deadlocked, it would just sit there, doing nothing).

The TestRuntime.cs and ApplePlatform.cs had to be added to a few test projects
to make this compile, which required a few fixes in these files for building
with legacy Xamarin.Mac.

Fixes https://github.com/xamarin/maccore/issues/2414.
2022-12-06 13:11:36 +01:00
Rolf Bjarne Kvinge 1c80823582
[autoformat] Add all of tests/. (#16857) 2022-12-05 08:23:34 +01:00
Rolf Bjarne Kvinge 62a4038187 Merge main into net8.0. 2022-12-01 17:23:19 +01:00
Rolf Bjarne Kvinge d627b203eb
[tests] Create a shared AppDelegate class and use it everywhere. (#16877)
Create a shared AppDelegate class, which contains all the identical
AppDelegate code for all test projects. This reduces a lot of code duplication.
2022-11-28 18:17:49 +01:00
Rolf Bjarne Kvinge ce1a2a7036
[tests] Improve AsyncTests.Bug12221 to not fail on 403 errors on the bots. (#16815)
Fixes:

    [FAIL] Bug12221 : System.AggregateException : One or more errors occurred. (Response status code does not indicate success: 403 (Forbidden).)
    ----> System.Net.Http.HttpRequestException : Response status code does not indicate success: 403 (Forbidden).
          at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean )
          at System.Threading.Tasks.Task.Wait(Int32 , CancellationToken )
          at System.Threading.Tasks.Task.Wait()
          at LinkSdk.AsyncTests.Bug12221() in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/linker/ios/link sdk/AsyncTest.cs:line 25
          at System.Reflection.MethodInvoker.InterpretedInvoke(Object , Span`1 , BindingFlags )
       --HttpRequestException
          at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
          at System.Net.Http.HttpClient.GetStringAsyncCore(HttpRequestMessage , CancellationToken )
          at LinkSdk.AsyncTests.<>c.<<LoadCategories>b__0_0>d.MoveNext() in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/linker/ios/link sdk/AsyncTest.cs:line 16

One important detail is the change from calling 'Wait ()' to calling
'GetAwaiter ().GetResult ()': this is to avoid the AggregateException in the
stack trace above.

Fixes https://github.com/xamarin/maccore/issues/2570.
2022-11-21 09:37:31 +01:00
Rolf Bjarne Kvinge bdbe76d897
Merge main into net8.0. (#16718) 2022-11-14 09:11:08 +01:00
Rolf Bjarne Kvinge 53a4970d7a
[link sdk] Update the SpecialFolders tests according to changes in .NET 8. (#16703)
Fixes this test:

    SpecialFolder: MyVideos
        Expected: False
        But was: True
2022-11-11 13:43:02 +01:00
Rolf Bjarne Kvinge 34995569fc
[tests] Fix conditional logic for .NET 7+. (#16704)
Fixes this test in .NET 8:

    AesCreate: System.Security.Cryptography.Algorithms,
        Expected: String starting with "System.Security.Cryptography.Algorithms, "
        But was: "System.Security.Cryptography, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
2022-11-11 09:48:33 +01:00
Rolf Bjarne Kvinge 9d306f3862 Merge main into net7.0. 2022-10-10 13:01:32 +02:00
Rolf Bjarne Kvinge 2a4eaea5a7
[tests] Enable tests for interfaces being linked away. Fixes #9566. (#16279)
Fixes https://github.com/xamarin/xamarin-macios/issues/9566.
2022-10-07 13:10:03 +02:00
Rolf Bjarne Kvinge 91a568784c
Merge main into net7.0. (#15826) 2022-09-01 15:29:44 +02:00
Rolf Bjarne Kvinge 2ddb7a6d68
[dotnet] Make relase builds for desktop universal by default. Fixes #15620. (#15769) 2022-08-31 16:45:10 +02:00
Rolf Bjarne Kvinge 4922bf4570 Merge remote-tracking branch 'origin/main' into bump-main-in-net7.0-2022-08-31 2022-08-31 13:45:17 +02:00
Rolf Bjarne Kvinge 5e8d70f95e
[tests] Improve detection of bad CI networks. (#15516) 2022-08-29 15:42:40 +02:00
dotnet-maestro[bot] 62055c56fb
[net7.0] Update dependencies from dotnet/installer (#15657)
* Update dependencies from https://github.com/dotnet/installer build 20220807.1

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-rc.1.22405.9 -> To Version 7.0.100-rc.1.22407.1

* Re-generate global.json

* Update dependencies from https://github.com/dotnet/installer build 20220808.5

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-rc.1.22405.9 -> To Version 7.0.100-rc.1.22408.5

* Re-generate global.json

* Update dependencies from https://github.com/dotnet/installer build 20220809.23

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-rc.1.22405.9 -> To Version 7.0.100-rc.1.22409.23

* Re-generate global.json

* Update dependencies from https://github.com/dotnet/installer build 20220810.15

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-rc.1.22405.9 -> To Version 7.0.100-rc.1.22410.15

* Re-generate global.json

* Update dependencies from https://github.com/dotnet/installer build 20220812.1

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-rc.1.22405.9 -> To Version 7.0.100-rc.1.22412.1

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.NETCore.App.Ref,Microsoft.AspNetCore.App.Ref
 From Version 7.0.100-1.22377.1 -> To Version 7.0.100-1.22411.2 (parent: Microsoft.Dotnet.Sdk.Internal

* Re-generate global.json

* Update dependencies from https://github.com/dotnet/installer build 20220813.1

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-rc.1.22405.9 -> To Version 7.0.100-rc.1.22413.1

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.NETCore.App.Ref,Microsoft.AspNetCore.App.Ref
 From Version 7.0.100-1.22377.1 -> To Version 7.0.100-1.22412.1 (parent: Microsoft.Dotnet.Sdk.Internal

* Re-generate global.json

* Update dependencies from https://github.com/dotnet/installer build 20220814.7

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-rc.1.22405.9 -> To Version 7.0.100-rc.1.22414.7

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.NETCore.App.Ref,Microsoft.AspNetCore.App.Ref
 From Version 7.0.100-1.22377.1 -> To Version 7.0.100-1.22412.1 (parent: Microsoft.Dotnet.Sdk.Internal

* Re-generate global.json

* Update dependencies from https://github.com/dotnet/installer build 20220816.2

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-rc.1.22405.9 -> To Version 7.0.100-rc.1.22416.2

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.NETCore.App.Ref,Microsoft.AspNetCore.App.Ref
 From Version 7.0.100-1.22377.1 -> To Version 7.0.100-1.22415.1 (parent: Microsoft.Dotnet.Sdk.Internal

* Re-generate global.json

* Update dependencies from https://github.com/dotnet/installer build 20220817.1

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-rc.1.22405.9 -> To Version 7.0.100-rc.2.22417.1

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.NETCore.App.Ref,Microsoft.AspNetCore.App.Ref
 From Version 7.0.100-1.22377.1 -> To Version 7.0.100-1.22415.4 (parent: Microsoft.Dotnet.Sdk.Internal

* Re-generate global.json

* [dotnet] Include the 'marshal-ilgen' component. Fixes #15668.

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

* [dotnet] Enable serialization discovery in the linker. Fixes #15676.

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

* [tests] Make the dont link tests actually not link for macOS.

* [tests] The 'trimmode copy' test needs an adjustment after recent linker changes.

* [dotnet] Don't set a default 'TrimMode' value.

We already compute a TrimMode value depending on other properties
(MtouchLink/LinkMode - or a default value if those aren't set), and the logic
to compute the default value is not executed if we set a TrimMode default (because
TrimMode overrides any MtouchLink/LinkMode values).

* [tests] Workaround a bug in 'dotnet build'.

Workaround a bug in 'dotnet build' where escaping semicolons interferes with
our ability to pass RuntimeIdentifiers to the build on the command line.

* [dotnet] Update expected bundle contents according to updated runtime.

* [tests] Update expected error message texts.

* Bump to RC 2.

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: GitHub Actions <github-actions@xamarin.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2022-08-19 12:53:56 +02:00
Rolf Bjarne Kvinge d167ae86b8 Merge remote-tracking branch 'origin/main' into net7.0 2022-06-03 13:39:55 +02:00
Rolf Bjarne Kvinge a1e32e39dd
[tests] Remove ignore because corresponding bug has been fixed. (#15182) 2022-06-03 10:40:22 +02:00
Rolf Bjarne Kvinge f5dfe434bd Merge remote-tracking branch 'origin/main' into net7.0 2022-05-19 23:20:20 +02:00
Rolf Bjarne Kvinge 46b393ac5e
[tests] Adjust a few linker tests to cope with unreliable networks. (#15018)
* Handle 502 and 503 errors in the TrustUsingOldPolicy and TrustUsingNewCallback tests. Fixes:

    [FAIL] TrustUsingOldPolicy : System.Net.WebException : The remote server returned an error: (503) Service Unavailable.
    [FAIL] TrustUsingNewCallback : System.Net.WebException : The remote server returned an error: (503) Service Unavailable.

* Add more http and https urls to try (and don't use microsoft.com). Hopefully fixes:

    [FAIL] WebClient_SSL_Leak : At least one url should work

This is a follow-up to #14943.
2022-05-16 11:41:13 +02:00
Rolf Bjarne Kvinge 706663845d
[tests] Adjust a few tests to try network requests multiple times. (#14943)
* A few tests seem to be failing rather consistently with network errors.
  Rewrite these tests to try multiple urls before failing (we'll be assuming
  that if one of the urls succeed, the other failures were network related).

* Rename the LinkAnyTest.WebClientTest to LinkAnyTest.WebClientTest_Http to
  follow it's original intent, and make it test http instead of https.

* Remove unnecessary assertion from SSL_IP_5706. This is tested in plenty of other places.
2022-05-13 08:50:28 +02:00
Rolf Bjarne Kvinge 8cf02316ca
[tests] Unignore test that's now fixed in .NET. (#14937) 2022-05-10 09:34:21 +02:00