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

3866 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 77f9a4d733 [tests] Ignore DllImportTest.LackOfCapget in .NET due to an issue in .NET.
System.Net.NetworkInformation.Ping.Send doesn't work.

Ref: https://github.com/dotnet/runtime/issues/41355

Fixes this link sdk test failure:

    LinkSdk.DllImportTest
        [FAIL] LackOfCapget :
            Expected: <System.InvalidOperationException>
            But was:  <System.Net.NetworkInformation.PingException: An exception occurred during a Ping request.
                ---> System.ComponentModel.Win32Exception (2): No such file or directory
                at System.Diagnostics.Process.EnsureInitialized()
                at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
                at System.Diagnostics.Process.Start()
                at System.Net.NetworkInformation.Ping.SendWithPingUtility(IPAddress address, Byte[] buffer, Int32 timeout, PingOptions options)
                at System.Net.NetworkInformation.Ping.SendPingCore(IPAddress address, Byte[] buffer, Int32 timeout, PingOptions options)
                at System.Net.NetworkInformation.Ping.GetAddressAndSend(String hostNameOrAddress, Int32 timeout, Byte[] buffer, PingOptions options)
                --- End of inner exception stack trace ---
                at System.Net.NetworkInformation.Ping.GetAddressAndSend(String hostNameOrAddress, Int32 timeout, Byte[] buffer, PingOptions options)
                at System.Net.NetworkInformation.Ping.Send(String hostNameOrAddress, Int32 timeout, Byte[] buffer, PingOptions options)
                at System.Net.NetworkInformation.Ping.Send(String hostNameOrAddress, Int32 timeout, Byte[] buffer)
                at System.Net.NetworkInformation.Ping.Send(String hostNameOrAddress)
                at LinkSdk.DllImportTest.<>c__DisplayClass3_0.<LackOfCapget>b__0() in /Users/rolf/work/maccore/whatever/xamarin-macios/tests/linker/ios/link sdk/DllImportTest.cs:line 88
                at NUnit.Framework.Assert.Throws(IResolveConstraint expression, TestDelegate code, String message, Object[] args)>
                at LinkSdk.DllImportTest.LackOfCapget() in /Users/rolf/work/maccore/whatever/xamarin-macios/tests/linker/ios/link sdk/DllImportTest.cs:line 88
2020-08-26 09:58:47 +02:00
Rolf Bjarne Kvinge e8c389164d [tests] Disable link sdk tests that require Crypto for .NET.
Fixes these link sdk test failures:

    LinkSdk.CryptoTest
        [FAIL] AesCreate :   System.Core
            Expected: True
            But was:  False
                at LinkSdk.CryptoTest.AesCreate() in [...]/xamarin-macios/tests/linker/ios/link sdk/CryptoTest.cs:line 33

        [FAIL] Chain : System.EntryPointNotFoundException : AppleCryptoNative_SecKeychainCreate assembly:<unknown assembly> type:<unknown type> member:(null)
            at Interop.AppleCrypto.CreateOrOpenKeychain(String keychainPath, Boolean createAllowed)
            at Internal.Cryptography.Pal.StorePal.AppleKeychainStore.CreateOrOpenKeychain(String keychainPath, OpenFlags openFlags)
            at Internal.Cryptography.Pal.StorePal.FromCustomKeychainStore(String storeName, OpenFlags openFlags)
            at Internal.Cryptography.Pal.StorePal.FromSystemStore(String storeName, StoreLocation storeLocation, OpenFlags openFlags)
            at System.Security.Cryptography.X509Certificates.X509Store.Open(OpenFlags flags)
            at LinkSdk.CryptoTest.Chain() in [...]/xamarin-macios/tests/linker/ios/link sdk/CryptoTest.cs:line 149
            at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

        [FAIL] Sha256 : System.EntryPointNotFoundException : AppleCryptoNative_SecCopyErrorMessageString assembly:<unknown assembly> type:<unknown type> member:(null)
            at Interop.AppleCrypto.GetSecErrorString(Int32 osStatus)
            at Interop.AppleCrypto.CreateExceptionForOSStatus(Int32 osStatus)
            at Internal.Cryptography.Pal.X509Pal.AppleX509Pal.GetCertContentType(ReadOnlySpan`1 rawData)
            at System.Security.Cryptography.X509Certificates.X509Certificate2.GetCertContentType(ReadOnlySpan`1 rawData)
            at Internal.Cryptography.Pal.AppleCertificatePal.FromBlob(ReadOnlySpan`1 rawData, SafePasswordHandle password, X509KeyStorageFlags keyStorageFlags)
            at Internal.Cryptography.Pal.CertificatePal.FromBlob(ReadOnlySpan`1 rawData, SafePasswordHandle password, X509KeyStorageFlags keyStorageFlags)
            at System.Security.Cryptography.X509Certificates.X509Certificate..ctor(ReadOnlySpan`1 data)
            at System.Security.Cryptography.X509Certificates.X509Certificate..ctor(Byte[] data)
            at System.Security.Cryptography.X509Certificates.X509Certificate2..ctor(Byte[] rawData)
            at LinkSdk.CryptoTest.Sha256() in [...]/xamarin-macios/tests/linker/ios/link sdk/CryptoTest.cs:line 228
            at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
2020-08-26 09:58:47 +02:00
Rolf Bjarne Kvinge 6a2f1dbc29 [tests] Disable link sdk tests that require Crypto for .NET and which cause the test app to crash
Fixes unhandled exception that makes the app crash:

    Unhandled Exception:
    System.EntryPointNotFoundException: AppleCryptoNative_SecKeychainItemCopyKeychain assembly:<unknown assembly> type:<unknown type> member:(null)
       at Interop.AppleCrypto.SecKeychainItemCopyKeychain(IntPtr item)
       at System.Security.Cryptography.Apple.SafeTemporaryKeychainHandle.UntrackItem(IntPtr keychainItem)
       at System.Security.Cryptography.Apple.SafeKeychainItemHandle.ReleaseHandle()
       at System.Runtime.InteropServices.SafeHandle.InternalRelease(Boolean disposeOrFinalizeOperation)
       at System.Runtime.InteropServices.SafeHandle.Dispose(Boolean disposing)
       at System.Runtime.InteropServices.SafeHandle.Finalize()
2020-08-26 09:58:47 +02:00
Rolf Bjarne Kvinge a44fdae53d [tests] Ignore a link sdk test that calls MulticastDelegate.BeginInvoke.
MulticastDelegate.BeginInvoke isn't supported in .NET.

Ref: https://github.com/dotnet/runtime/issues/16312
2020-08-26 09:58:47 +02:00
Rolf Bjarne Kvinge 3eeb46261a [tests] The HttpWebRequest constructors are not publicly available in .NET 5+, so use WebRequest.CreateHttp instead. 2020-08-26 09:58:47 +02:00
Rolf Bjarne Kvinge 7cf7f2d2d3 [tests] Exclude link sdk tests using API that isn't available anymore in .NET. 2020-08-26 09:58:47 +02:00
Rolf Bjarne Kvinge 7d7208c86d [tests] Exclude link sdk tests in .NET that reference OpenTK-1.0.dll
OpenTK-1.0.dll isn't supported yet.
2020-08-26 09:58:47 +02:00
Rolf Bjarne Kvinge 809a12647f [tests] Port link sdk to .NET 2020-08-26 09:58:47 +02:00
Rolf Bjarne Kvinge 6a1e8acbb0
[tests] Adjust resources test to cope with the fact that only the invariant culture is currently shipping in .NET 5. (#9498)
Ref: https://github.com/xamarin/xamarin-macios/issues/8906

This is the third of three steps to fix this test failure:

    EmbeddedResources.ResourcesTest
        [FAIL] Embedded :   en-AU
            Expected string length 5 but was 7. Strings differ at index 0.
            Expected: "G'day"
            But was:  "Welcome"
            -----------^
                at EmbeddedResources.ResourcesTest.Embedded() in [...]/xamarin-macios/tests/EmbeddedResources/ResourcesTest.cs:line 45
2020-08-26 09:39:52 +02:00
Rolf Bjarne Kvinge ebbd1e6738 [xharness] don't link is now green on .NET! 2020-08-25 18:18:34 +02:00
Rolf Bjarne Kvinge 90aaee0404 [tests] Ignore don't link tests that require globalization support.
.NET doesn't have any globalization support yet.

Ref: https://github.com/xamarin/xamarin-macios/issues/8906

This fixes these tests:

    DontLink.Calendars.CalendarTest
        [FAIL] Hijri :   Calendar
            Expected string length 34 but was 38. Strings differ at index 21.
            Expected: "System.Globalization.HijriCalendar"
            But was:  "System.Globalization.GregorianCalendar"
            --------------------------------^
                at DontLink.Calendars.CalendarTest.Hijri() in [...]/xamarin-macios/tests/linker/ios/dont link/CalendarTest.cs:line 28
        
        [FAIL] ThaiBuddhist :   Calendar
            Expected string length 41 but was 38. Strings differ at index 21.
            Expected: "System.Globalization.ThaiBuddhistCalendar"
            But was:  "System.Globalization.GregorianCalendar"
            --------------------------------^
                at DontLink.Calendars.CalendarTest.ThaiBuddhist() in [...]/xamarin-macios/tests/linker/ios/dont link/CalendarTest.cs:line 35
        
        [FAIL] UmAlQura :   Calendar
            Expected string length 37 but was 38. Strings differ at index 21.
            Expected: "System.Globalization.UmAlQuraCalendar"
            But was:  "System.Globalization.GregorianCalendar"
            --------------------------------^
                at DontLink.Calendars.CalendarTest.UmAlQura() in [...]/xamarin-macios/tests/linker/ios/dont link/CalendarTest.cs:line 21
2020-08-25 18:18:34 +02:00
Rolf Bjarne Kvinge 5f1c5c5e92 [tests] Adjust don't link's TypeDescriptorCanary to take into account that .NET has new converters. 2020-08-25 18:18:34 +02:00
Rolf Bjarne Kvinge be66baad9e [tests] Modify don't link's TypeDescriptorCanary to find System.ComponentModel.ReflectTypeDescriptionProvider in the same assembly BooleanConverter is.
Types have moved around in .NET, and in particular
System.ComponentModel.ReflectTypeDescriptionProvider is not in System where it
once was. So change the logic to look in the same assembly
System.ComponentModel.BooleanConverter is, as opposed to hardcoding 'System'.

This fixes this test:

    DontLink.CommonDontLinkTest
        [FAIL] TypeDescriptorCanary :   type
        Expected: not null
        But was:  null
            at DontLink.CommonDontLinkTest.TypeDescriptorCanary() in [...]/xamarin-macios/tests/linker/CommonDontLinkTest.cs:line 19
2020-08-25 18:18:34 +02:00
Rolf Bjarne Kvinge 87efe8625d [tests] Ignore a don't link test that calls MulticastDelegate.BeginInvoke.
MulticastDelegate.BeginInvoke isn't supported in .NET.

Ref: https://github.com/dotnet/runtime/issues/16312

Fixes this test failure:

    DontLink.DontLinkRegressionTests
    [FAIL] Bug5354 : System.PlatformNotSupportedException : Operation is not supported on this platform.
        at DontLink.DontLinkRegressionTests.Bug5354() in [...]/xamarin-macios/tests/linker/ios/dont link/DontLinkRegressionTests.cs:line 64
        at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
2020-08-25 18:18:34 +02:00
Rolf Bjarne Kvinge 9eab011a4b
[tests] Port dont link to .NET (#9488)
There are a few test failures, so it's ignored by default in xharness for now.
2020-08-25 17:04:01 +02:00
Rolf Bjarne Kvinge f19207d57d
[tests] Update the MT0113_linker test asserting an error message after the message changed. (#9485)
This regressed here: d7ab847697

Fixes this failure:

    Xamarin.MTouch.MT0113_linker:
    The error 'MT0113: Native code sharing has been disabled for the extension 'testServiceExtension' because the managed linker settings are different between the container app (None) and the extension (All).' was not found in the output:
        Message #1 did not match:
            actual: 'Native code sharing has been disabled for the extension 'testServiceExtension' because the managed linker settings are different between the container app (None) and the extension (Full).'
            expected: 'Native code sharing has been disabled for the extension 'testServiceExtension' because the managed linker settings are different between the container app (None) and the extension (All).'
2020-08-25 15:13:04 +02:00
Rolf Bjarne Kvinge ab47edcb27
[dotnet] Implement resource bundling. (#9472)
* Port the BundledResources test to .NET.
* Fix a minor issue in the BundledResources test to make sure it works on macOS.
* Add a unit test to make sure resources are bundled as expected.
* Modify the .NET build logic to bundle/unbundle resources.
2020-08-25 13:14:01 +02:00
Rolf Bjarne Kvinge 40eea04c96
[dotnet] Don't include the F# library in monotouch-test yet, it makes the linker crash. (#9462) 2020-08-24 17:55:42 +02:00
Rolf Bjarne Kvinge 82ad02c616
[dotnet/monotouch-test] Disable tests that require Crypto for .NET. (#9463)
Crypto hasn't been implemented yet in .NET for iOS.

This fixes a crash because these tests cause an unhandled exception on the
finalizer thread (which crashes the process):

    Unhandled Exception:
    System.EntryPointNotFoundException: AppleCryptoNative_SecKeychainItemCopyKeychain assembly:<unknown assembly> type:<unknown type> member:(null)
       at Interop.AppleCrypto.SecKeychainItemCopyKeychain(IntPtr item)
       at System.Security.Cryptography.Apple.SafeTemporaryKeychainHandle.UntrackItem(IntPtr keychainItem)
       at System.Security.Cryptography.Apple.SafeKeychainItemHandle.ReleaseHandle()
       at System.Runtime.InteropServices.SafeHandle.InternalRelease(Boolean disposeOrFinalizeOperation)
       at System.Runtime.InteropServices.SafeHandle.Dispose(Boolean disposing)
       at System.Runtime.InteropServices.SafeHandle.Finalize()

    =================================================================
    	Native Crash Reporting
    =================================================================
    Got a abrt while executing native code. This usually indicates
    a fatal error in the mono runtime or one of the native libraries
    used by your application.
    =================================================================

    =================================================================
    	Native stacktrace:
    =================================================================
    	0x108bfc396 - /Users/rolf/Library/Developer/CoreSimulator/Devices/289E372A-501C-4499-A1A6-59C5B3B6A9AE/data/Containers/Bundle/Application/A23AD847-E868-4895-ADBA-036D4E87BA35/monotouchtest.app/libmonosgen-2.0.dylib : mono_dump_native_crash_info
    	0x108ba878f - /Users/rolf/Library/Developer/CoreSimulator/Devices/289E372A-501C-4499-A1A6-59C5B3B6A9AE/data/Containers/Bundle/Application/A23AD847-E868-4895-ADBA-036D4E87BA35/monotouchtest.app/libmonosgen-2.0.dylib : mono_handle_native_crash
    	0x108bfbbed - /Users/rolf/Library/Developer/CoreSimulator/Devices/289E372A-501C-4499-A1A6-59C5B3B6A9AE/data/Containers/Bundle/Application/A23AD847-E868-4895-ADBA-036D4E87BA35/monotouchtest.app/libmonosgen-2.0.dylib : sigabrt_signal_handler
    	0x7fff51c005fd - /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 13.5.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libsystem_platform.dylib : _sigtramp
    	0x0 - Unknown
    	0x7fff51af0b7c - /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 13.5.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libsystem_c.dylib : abort
    	0x1089bf7ef - /Users/rolf/Library/Developer/CoreSimulator/Devices/289E372A-501C-4499-A1A6-59C5B3B6A9AE/data/Containers/Bundle/Application/A23AD847-E868-4895-ADBA-036D4E87BA35/monotouchtest.app/libxamarin-debug.dylib : xamarin_unhandled_exception_handler
    	0x108c69548 - /Users/rolf/Library/Developer/CoreSimulator/Devices/289E372A-501C-4499-A1A6-59C5B3B6A9AE/data/Containers/Bundle/Application/A23AD847-E868-4895-ADBA-036D4E87BA35/monotouchtest.app/libmonosgen-2.0.dylib : mono_invoke_unhandled_exception_hook
    	0x108cc688c - /Users/rolf/Library/Developer/CoreSimulator/Devices/289E372A-501C-4499-A1A6-59C5B3B6A9AE/data/Containers/Bundle/Application/A23AD847-E868-4895-ADBA-036D4E87BA35/monotouchtest.app/libmonosgen-2.0.dylib : mono_thread_internal_unhandled_exception
    	0x108cf5ad5 - /Users/rolf/Library/Developer/CoreSimulator/Devices/289E372A-501C-4499-A1A6-59C5B3B6A9AE/data/Containers/Bundle/Application/A23AD847-E868-4895-ADBA-036D4E87BA35/monotouchtest.app/libmonosgen-2.0.dylib : mono_gc_run_finalize
    	0x108d0f095 - /Users/rolf/Library/Developer/CoreSimulator/Devices/289E372A-501C-4499-A1A6-59C5B3B6A9AE/data/Containers/Bundle/Application/A23AD847-E868-4895-ADBA-036D4E87BA35/monotouchtest.app/libmonosgen-2.0.dylib : sgen_gc_invoke_finalizers
    	0x108cf73cf - /Users/rolf/Library/Developer/CoreSimulator/Devices/289E372A-501C-4499-A1A6-59C5B3B6A9AE/data/Containers/Bundle/Application/A23AD847-E868-4895-ADBA-036D4E87BA35/monotouchtest.app/libmonosgen-2.0.dylib : finalizer_thread
    	0x108cc7081 - /Users/rolf/Library/Developer/CoreSimulator/Devices/289E372A-501C-4499-A1A6-59C5B3B6A9AE/data/Containers/Bundle/Application/A23AD847-E868-4895-ADBA-036D4E87BA35/monotouchtest.app/libmonosgen-2.0.dylib : start_wrapper_internal
    	0x108cc6f39 - /Users/rolf/Library/Developer/CoreSimulator/Devices/289E372A-501C-4499-A1A6-59C5B3B6A9AE/data/Containers/Bundle/Application/A23AD847-E868-4895-ADBA-036D4E87BA35/monotouchtest.app/libmonosgen-2.0.dylib : start_wrapper
    	0x7fff51c0c109 - /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 13.5.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libsystem_pthread.dylib : _pthread_start
    	0x7fff51c07b8b - /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 13.5.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libsystem_pthread.dylib : thread_start
2020-08-24 17:55:24 +02:00
Rolf Bjarne Kvinge 54622428a9
[monotouch-test] Don't run the mono tests for the System.Drawing types in .NET (#9464)
A System.Drawing.Point test fails because it tests GetHashCode, which returns
a different value in .NET. None of the System.Drawing tests actually test any
of our code (when using .NET), so the fix is to just not include the
System.Drawing tests in the first place.

Fixes this test failure:

    MonoTests.System.Drawing.PointTest
        [FAIL] GetHashCodeTest :   #1
            Expected: 32
            But was:  1527927283
                at MonoTests.System.Drawing.PointTest.GetHashCodeTest() in /Users/rolf/work/maccore/squashed-onedotnet/xamarin-macios/builds/mono-ios-sdk-destdir/ios-sources/mcs/class/System.Drawing/Test/System.Drawing/TestPoint.cs:line 198
2020-08-24 17:55:10 +02:00
Rolf Bjarne Kvinge d29356df3a
[monotouch-test] Ignore an autoreleasepool threadpool test which is a known issue in .NET. (#9465)
Fixes this test failure:

    MonoTouchFixtures.ObjCRuntime.RuntimeTest
		[FAIL] NSAutoreleasePoolInThreadPool :   RC. Iterations: 101
			Expected: not greater than 50
			But was:  101
				at MonoTouchFixtures.ObjCRuntime.RuntimeTest.NSAutoreleasePoolInThreadPool() in /Users/rolf/work/maccore/squashed-onedotnet/xamarin-macios/tests/monotouch-test/ObjCRuntime/RuntimeTest.cs:line 484
2020-08-24 17:54:57 +02:00
Rolf Bjarne Kvinge ccdd577f9f
[xharness] Process '$(RootTestsDirectory)' before bailing due to any other variables when resolving paths in project files. (#9467)
While keeping '$(RootTestsDirectory)' as-is works fine when building the
project using MSBuild, xharness itself may end up encountering it (in
particular when listing referenced projects), and at that point will end up
confused. So just always resolve '$(RootTestsDirectory)' to the actual
directory to keep other parts of xharness happy.

Fixes this problem (as seen in PR #9460):

    Harness exception for 'interdependent-binding-projects': System.IO.DirectoryNotFoundException: Could not find a part of the path "/Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/external/Touch.Unit/Touch.Client/dotnet/iOS/Touch.Client-iOS.dotnet.csproj".
        at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) [0x0015e] in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/external/bockbuild/builds/mono-x64/mcs/class/corlib/System.IO/FileStream.cs:223
        at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean isAsync, System.Boolean anonymous) [0x00000] in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/external/bockbuild/builds/mono-x64/mcs/class/corlib/System.IO/FileStream.cs:149
        at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access) [0x00000] in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/external/bockbuild/builds/mono-x64/mcs/class/corlib/System.IO/FileStream.cs:86
        at (wrapper remoting-invoke-with-check) System.IO.FileStream..ctor(string,System.IO.FileMode,System.IO.FileAccess)
        at Microsoft.DotNet.XHarness.iOS.Shared.Utilities.PListExtensions.LoadWithoutNetworkAccess (System.Xml.XmlDocument doc, System.String filename) [0x00001] in /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/xharness/Microsoft.DotNet.XHarness.iOS.Shared/Utilities/PlistExtensions.cs:17
        at Microsoft.DotNet.XHarness.iOS.Shared.TestProject.CreateCopyAsync (Microsoft.DotNet.XHarness.iOS.Shared.Logging.ILog log, Microsoft.DotNet.XHarness.iOS.Shared.Execution.IProcessManager processManager, Microsoft.DotNet.XHarness.iOS.Shared.Tasks.ITestTask test, System.String rootDirectory, System.Collections.Generic.Dictionary`2[TKey,TValue] allProjectReferences) [0x0010c] in /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/xharness/Microsoft.DotNet.XHarness.iOS.Shared/TestProject.cs:98
        at Microsoft.DotNet.XHarness.iOS.Shared.TestProject.CreateCopyAsync (Microsoft.DotNet.XHarness.iOS.Shared.Logging.ILog log, Microsoft.DotNet.XHarness.iOS.Shared.Execution.IProcessManager processManager, Microsoft.DotNet.XHarness.iOS.Shared.Tasks.ITestTask test, System.String rootDirectory, System.Collections.Generic.Dictionary`2[TKey,TValue] allProjectReferences) [0x00811] in /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/xharness/Microsoft.DotNet.XHarness.iOS.Shared/TestProject.cs:168
        at Microsoft.DotNet.XHarness.iOS.Shared.Tasks.TestTasks.RunInternalAsync () [0x00117] in /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/xharness/Microsoft.DotNet.XHarness.iOS.Shared/Tasks/TestTask.cs:274
2020-08-24 17:48:59 +02:00
Whitney Schmidt a20e738592
[Bug] Fix AVAudioFormat failure on older OS (#9433)
* fix_avaudioformat_monotouch_failure

* add platform checks instead of xcode check
2020-08-24 09:23:24 -04:00
Rolf Bjarne Kvinge 9d30e6e135
[tests] Port monotouch-test to .NET. (#9452)
* Create a .NET version of the monotouch-test project.
* Make sure it builds and launches (there are test failures, and it eventually
  crashes, which will be fixed in a later PR).
* Add it to xharness, in a way that it's possible to run monotouch-test
  locally, while at the same time it'll never run on the bots (because it's
  not green yet).
2020-08-24 08:24:36 +02:00
Rolf Bjarne Kvinge 92a3cd9a30
[dotnet] Bump .NET and the linker. (#9451)
* Bump .NET 5 and the linker.

The old linker run into a problem that seems fixed in the new linker, so bump.

* [tests] Add a workaround for a .NET bug in the fsharplibrary tests.

It's now the default to produce reference assemblies, but the F# compiler
doesn't support producing reference assemblies, so when there's no reference
assembly afterwards the MSBuild tasks complain. So explicitly disable
reference assemblies for our F# library.

* [tests] Skip reference assemblies when iterating over produced assemblies in the .NET unit tests.

Also simplify the code a little bit.

This happens because producing reference assemblies is now the default.
2020-08-24 08:20:46 +02:00
Rolf Bjarne Kvinge 04866dd0b7 [xharness] Improve resolving paths in project files.
* Properties may contain a list of files, separated by semi-colon, so if we find
  any semi-colons, treat each entry as a separate path.

* Treat anything that starts with a variable as a full path, because either the
  variable is a full path, or it will be updated according to the new project location
  and resolve correctly.
2020-08-21 18:47:33 +02:00
Rolf Bjarne Kvinge b2ad96ec40 [xharness] Add monotouch-test to the .NET lineup. 2020-08-21 18:47:33 +02:00
Rolf Bjarne Kvinge 64641f66e8 [xharness] Make it possible to make a project ignored by default from its initial definition.
Make it possible to make a project ignored by default from its initial definition,
and which takes precedence over any other selection criteria.

This way it's possible to make the .NET version of monotouch-test show up in the
web view, which makes it runnable locally (for testing), while at the same time it
will never be run on CI.
2020-08-21 18:47:33 +02:00
Rolf Bjarne Kvinge 5db367a1fe [monotouch-test] Exclude tests that require OpenTK-1.0.dll in .NET.
OpenTK-1.0.dll isn't supported yet.
2020-08-21 18:47:33 +02:00
Rolf Bjarne Kvinge ba9df78138 [monotouch-test] Exclude WeakAttribute testing on .NET.
.NET does not support WeakAttribute.
2020-08-21 18:47:33 +02:00
Rolf Bjarne Kvinge 2812f2b235 [tests] Port monotouch-test to .NET. 2020-08-21 18:47:33 +02:00
Rolf Bjarne Kvinge 6f911a2259
[dotnet] Put NuGet packages in a directory which will not be picked up by default item inclusions / globs. (#9440)
Put NuGet packages in tests/dotnet, instead of a directory next to the project
file, so that default item inclusions / globs don't pick up anything from
them.

This fixes an issue where the build would pick up a Program.cs that ships with NUnitLite,
and include it in the build, which would then cause build failures because that Program.cs
has a Main method, which would conflict with our Main method.
2020-08-21 14:55:24 +02:00
monojenkins 2a569e6274
[main] Partial fix for AVAudioEngine.Connect(input, sink, format) crash when format == null (#9410)
* partial fix for https://github.com/xamarin/xamarin-macios/issues/9267

* simplify notequals

* add monotouch-test case

* add more using per manuel's feedback

Co-authored-by: Whitney Schmidt <whschm@microsoft.com>
2020-08-20 07:41:42 -04:00
Rolf Bjarne Kvinge 558af9612a [dotnet] Add support for consuming binding projects. (#9376)
* Port the interdependent-binding-projects test to .NET (it's the simplest
  test project we have with binding projects).
* Add a lot of the shared source code for mtouch/mmp to dotnet-linker, and
  make it compile. Most issues were fixed by adding a few stubbed out classes,
  since there are large chunks of the mtouch/mmp code we're not using yet, so
  stubbing out while things are being implemented works fine.
* Add a step in dotnet-linker for loading the linker output (the linked
  assemblies) into our bundler code.
* Add another step in dotnet-linker to extract native resources from binding
  libraries.
* Augment the build process to take into account the native resources we found
  in any binding libraries.
2020-08-20 08:35:12 +02:00
Rolf Bjarne Kvinge a8291e4351 [tests] Add missing eols to a few Info.plists. 2020-08-20 08:34:07 +02:00
Rolf Bjarne Kvinge a124a1a0c7 [tests] Make sure the .NET version of the independent-binding-projects test have a unique bundle identifier.
Otherwise there could be a problem when installing a test app into the
simulator if there's already an existing app there with the same bundle
identifer, because that doesn't remove existing files, and if there are
existing files in the bundle, the app might end up crashing (in particular
there may be files in a .monotouch-32/64 subdirectory which are not removed,
and those take precedence when looking for assemblies, eventually causing a
conflict).
2020-08-20 08:33:43 +02:00
Whitney Schmidt 2f377f0887
fix tiny typo (#9399) 2020-08-19 12:57:05 -04:00
Rolf Bjarne Kvinge 695ca8d680 [xharness] Don't clone the same project multiple times when reached through different project references.
Problem:

1. interdependent-binding-project references binding-test and bindings-test2.
2. bindings-test2 references bindings-test.

This means bindings-test is reached through 2 projects: both
interdependent-binding-projects and bindings-test2, and previously we'd
process each of these references separately, effectively making two separate
clones of the bindings-test project.

Instead keep track of all referenced projects from the leaf project, and if we
encounter a project we've already cloned, use that directly.
2020-08-18 15:22:24 +02:00
Rolf Bjarne Kvinge b84e5e8049 [tests] Add a reference to System.Json in the interdependent-binding-projects test. 2020-08-18 11:35:42 +02:00
Rolf Bjarne Kvinge 138ebc7288 [xharness] Bump timeout for the .NET tests.
More tests take longer to run!
2020-08-17 19:59:05 +02:00
Rolf Bjarne Kvinge ea30bc9cea [xharness] Make sure MSBUILD_EXE_PATH is not set when executing dotnet.
Something ends up confused, and dotnet hangs.
2020-08-17 11:09:06 +02:00
Rolf Bjarne Kvinge 5795f11bf0 [tests] Adjust the bindings-test2 project to work with xharness.
xharness needs to inspect project files, but can't do so through imported
projects, so move some of the logic from the imported shared.csproj to the
main csproj.
2020-08-17 09:32:12 +02:00
Přemek Vysoký b1f7bd44d9
[xharness] Do not mark DeviceLoaders as loaded when loading fails (#9367) 2020-08-17 08:27:48 +02:00
Manuel de la Pena 7e7caa00a6
[Submission] Fix all the selectors that apple warns about. (#9268)
We have noticed the following message from Apple when performing
submissions with Xamarin.iOS:

> ITMS-90338: Non-public API usage - The app references non-public
> selectors in WcBc.iOS: behaviorTypes, convolutionState,
> discoverAllContactUserInfosWithCompletionHandler:,
> discoverAllContactsCompletionBlock,
> discoverUserInfoWithEmailAddress:completionHandler:,
> discoverUserInfoWithUserRecordID:completionHandler:,
> discoverUserInfosCompletionBlock, displayContact, drawableResizesAsynchronously,
> encodeToCommandBuffer:sourceImage:convolutionState:,
> encodeToCommandBuffer:sourceImage:destinationImage:state:,
> getProperty:onChannel:responseHandler:, hasProperty:onChannel:responseHandler:,
> initWithEmailAddresses:userRecordIDs:, initWithMIDIEntity:dataReadyHandler:,
> initWithZoneID:options:, initWithZoneID:subscriptionID:options:,
> isPublicDatabase, mouseUpAction, newDrawable, propertyChangedCallback,
> removeAllAppearanceStreams, replaceTextStorage:, retrieveConnectedPeripherals,
> retrievePeripherals:, setDiscoverAllContactsCompletionBlock:,
> setDiscoverUserInfosCompletionBlock:, setDrawableResizesAsynchronously:,
> setEditedMask:, setMouseUpAction:, setMovieControlMode:,
> setProperty:onChannel:responseHandler:, setPropertyChangedCallback:,
> setSocketFamily:, setTemporaryAttributes:forCharacterRange:, setUserRecordIDs:,
> sourceOffset, subscriptionOptions, takeBackgroundColorFrom:, takePasswordFrom:,
> temporalAntialiasingEnabled, userRecordIDs. If method names in your source code
> match the private Apple APIs listed above, altering your method names will help
> prevent this app from being flagged in future submissions. In addition, note
> that one or more of the above APIs may be located in a static library that was
> included with your app. If so, they must be removed. For further information,
> visit the Technical Support Information at http://developer.apple.com/support/technical/

All of them have been removed but without a break in the API excep
"initWithMIDIEntity:dataReadyHandler:" wich does look like an error on
Apples side.

Empty stubs are used as much as possible except on those cases in which
a handler is called or an output variable should be modified (buffer,
out param) to minimize the users surprise at runtime.
2020-08-14 14:53:01 -04:00
Rolf Bjarne Kvinge 9fddbbda58 [xharness] Enhance ResolveAllPaths to understand $(RootTestsDirectory).
This requires passing the root directory around in multiple places, since ResolveAllPaths
doesn't have access to the static class where we define the root directory.

Also call ResolveAllPaths in a few more places to ensure paths everywhere are resolved.
2020-08-14 18:33:29 +02:00
Rolf Bjarne Kvinge 5a5a53e1a9 [xharness] Add the .NET version of interdependent-binding-projects to our lineup 2020-08-14 18:33:28 +02:00
Rolf Bjarne Kvinge 98b52c7c3a [tests] Port interdependent-binding-projects to .NET. 2020-08-14 18:33:28 +02:00
Rolf Bjarne Kvinge 6186e98de8 [tests] Fix binding project file path 2020-08-14 18:33:28 +02:00
Rolf Bjarne Kvinge b28997fa8a
[xharness] Add support for getting the default AssemblyName for projects. (#9369)
In .NET projects there's a default value for most properties, which means that
there won't necessarily be an AssemblyName property in a csproj. We need to know the
AssemblyName, so calculate it from the csproj filename (which is how .NET does it).

This turned out slighly complicated, because we're pass an XmlDocument around,
and the XmlDocument doesn't know the file from where it was loaded, so we need
to keep that information separately.
2020-08-14 10:32:23 +02:00
Rolf Bjarne Kvinge d36853c8cd
[xharness] Add support for adding PropertyGroups for unknown platform/configuration values in a csproj. Fixes xamarin/maccore@2277. (#9347)
Fixes https://github.com/xamarin/maccore/issues/2277.
2020-08-12 10:35:18 +02:00
Rolf Bjarne Kvinge 621bf6c085
[tests] Fix running several test suites from the command line. Fixes xamarin/maccore@2279. (#9348)
Fixes https://github.com/xamarin/maccore/issues/2279
2020-08-12 10:34:55 +02:00
Rolf Bjarne Kvinge 9fda2c6c9b
[tests] Add --dlsym:+nunit.framework.dll to all Xamarin.iOS test suites. (#9349)
This works around a build problem that occurs because NUnit ships with a
P/Invoke to a function that doesn't exist on Apple platforms:

    MTOUCH : error MT5210: Native linking failed, undefined symbol: _GetVersionEx. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. [/Users/xamarinqa/myagent/_work/8/s/xamarin-macios/tests/xharness/tmp-test-dir/monotouch-test58/monotouch-test-tvos.csproj]
    MTOUCH : error MT5201: Native linking failed. Please review the build log and the user flags provided to gcc: -fembed-bitcode-marker [/Users/xamarinqa/myagent/_work/8/s/xamarin-macios/tests/xharness/tmp-test-dir/monotouch-test58/monotouch-test-tvos.csproj]
    clang : error : linker command failed with exit code 1 (use -v to see invocation) [/Users/xamarinqa/myagent/_work/8/s/xamarin-macios/tests/xharness/tmp-test-dir/monotouch-test58/monotouch-test-tvos.csproj]

Also fix an issue in mtouch where we would overwrite any previous --dlsym
values; they're now accumulative (`--dlsym:foo.dll --dlsym:bar.dll` works
as expected)

Ref: https://github.com/nunit/nunit/issues/3618
2020-08-12 09:42:53 +02:00
Rolf Bjarne Kvinge 90ec0c7cf9
[dotnet] Add support for building binding projects (#9340).
* Ship bgen
* Fix a few issues in the generator.
* Modify some of the MSBuild logic to support binding projects.
* Port bindings-test[2] to .NET.
2020-08-11 11:15:56 +02:00
Rolf Bjarne Kvinge 855c2b09fc
[mtouch] Fix the MT0091 (now called MT0180) after recent code changes. Fixes xamarin/maccore@2280. (#9342)
Also fix a confusion between the M?0179 and M?0180 error message vs error number.

Fixes https://github.com/xamarin/maccore/issues/2280.
2020-08-10 15:49:50 -04:00
Rolf Bjarne Kvinge 8814e8ca24 [tests] Port bindings-test2 to .NET. 2020-08-10 16:14:52 +02:00
Rolf Bjarne Kvinge d883eb4725 [tests] Add a tvOS and watchOS version of the bindings-test project for .NET 2020-08-10 16:12:42 +02:00
Rolf Bjarne Kvinge 43d234de52 [tests] Add a macOS version of the bindings-test project for .NET
This required disabling some Xamarin.Mac-specific binding code in .NET mode.
2020-08-10 16:12:42 +02:00
Rolf Bjarne Kvinge c583cfd01e [dotnet] Add bindings-test to our unit tests. 2020-08-10 16:12:42 +02:00
Rolf Bjarne Kvinge 89e5bb15f7 [tests] Port bindings-test to .NET 2020-08-10 16:12:41 +02:00
Rolf Bjarne Kvinge 19e53376dd
[dotnet] Port the fsharplibrary project to .NET (#9339) 2020-08-10 16:12:19 +02:00
Rolf Bjarne Kvinge d96827cd89
[msbuild] Share the _CompileEntitlements target. (#9323)
Use two separate output variables (EntitlementsInExecutable/EntitlementsInSignature)
instead of using the same output variable for two different purposes. This makes
the code more self-explanatory.

Also move the simulator check to the C# code, that way it's easier to re-use elsewhere.

* [msbuild] Share the _CompileEntitlements task.

* [msbuild] Create the same class hierarchy for Xamarin.Mac and Xamarin.iOS for the CompileEntitlements task.

    CompileEntitlementsTaskBase
    └─── iOS/CompileEntitlementsTaskCore
    │    └─── iOS/CompileEntitlements
    └─── Mac/CompileEntitlementsTaskCore
         └─── Mac/CompileEntitlements

This also means we can remove a known failure in the list of MSBuild tasks that don't
conform to our 'no code in final task implementation' requirements.
2020-08-10 13:55:54 +02:00
Rolf Bjarne Kvinge d0f426b731
[tests] Port the EmbeddedResources test project to .NET and add a test to build it. (#9324) 2020-08-10 10:48:29 +02:00
Rolf Bjarne Kvinge 200608ce77
[xharness] Look at the exact NUnit version an NUnit project is referencing to figure out how to run it in a makefile. (#9322) 2020-08-10 10:47:45 +02:00
Rolf Bjarne Kvinge 8f5dba2194
[introspection] Some P/Invokes have moved to a QCall library in .NET 5 preview 8+. (#9300)
This fixes numerous P/Invoke test failures like this:

    Could not find the symbol 'GlobalizationNative_GetCalendars' in QCall
    Could not find the symbol 'GlobalizationNative_GetCalendarInfo' in QCall
    Could not find the symbol 'GlobalizationNative_EnumCalendarInfo' in QCall
    Could not find the symbol 'GlobalizationNative_GetLatestJapaneseEra' in QCall
    [...]

Ref: a56d6a8034
Ref: fae477f34b
2020-08-07 08:06:31 +02:00
Rolf Bjarne Kvinge f2b8dc3d48
[xharness] Make it possible to include .NET tests by setting a label. (#9298)
This also means that setting 'run-all-tests' enables the .NET tests, which
means they'll now start running on internal Jenkins (as was the intention from
the beginning).
2020-08-07 07:59:14 +02:00
Rolf Bjarne Kvinge 2b96b9ac5f
[monotouch-test] Adjust tests based on Environment.OSVersion (#9291)
With Mono, Environment.OSVersion returns the macOS version when running in the
simulator. On Catalina, Mono returns 19.* as the Environment.OSVersion, which
means that the check for major version = 15 in the simulator turns out to be a
constant value now (since we don't support running in the simulator on a
4-year-old macOS version).

With .NET, Environment.OSVersion returns the iOS version instead, which means
that the check would have to be reworked.

However, since these version checks have effectively been constant for a few
years now, we can just remove the checks and the resulting unreachable code.
2020-08-07 07:57:40 +02:00
Manuel de la Pena f147fe91cf
[Harness] Fix some typos. (#9303) 2020-08-06 17:37:57 -04:00
Manuel de la Pena 90bf04f608
Remove wrongly added dir. (#9301)
Someone (Manuel) uses an IDE that uses .idea to store user settings and
that got added by accident.
2020-08-06 16:35:26 -04:00
Rolf Bjarne Kvinge 53ccfa6664
[monotouch-test] Improve a few asserts to make them show better output when they fail. (#9290) 2020-08-06 15:04:57 +02:00
Manuel de la Pena 6293ce6828
[Tests] Fix TryGetSupportedInterfaces when we have values. Fixes #2273 (#9276)
* [Tests] Fix TryGetSupportedInterfaces when we have values. Fixes #2273

Make the test check against the value returned by the native API rather
than expect the result to always be null.

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

* Address reviews.
2020-08-06 11:00:18 +02:00
Rolf Bjarne Kvinge 603b22e1d6
[tests] Move from MonoTouch.NUnitLite to Touch.Client. (#9264)
* Touch.Client is a tiny mobile UI/runner for the official NUnitLite. This
  means we'll stop using a very old fork of NUnitLite to run our tests, and
  instead use the most recent upstream version instead.

* Some test changes were required to use the official NUnitLite, because there
  have been breaking changes there.

* NUnitLite is now referenced using a NuGet, which means there are numerous
  changes to support this.

* We're not using GuiUnit anymore, so that dependency has been removed.
2020-08-05 09:32:23 +02:00
Rolf Bjarne Kvinge ab80b27d52 [tests] Update according to API change in Touch.Client.
New commits in spouliot/Touch.Unit:

* spouliot/Touch.Unit@d7f55a6 [TouchRunner] Add support for a --test:<testname> argument to select a specific test to run. (#85)
* spouliot/Touch.Unit@6cf8d0b [TouchRunner] Fix test filtering. (#86)
* spouliot/Touch.Unit@c4a1cd1 [TouchRunner] The mac runner must run tests inside NSApplication.Run. (#84)

Diff: f62066880a..d7f55a6167
2020-08-04 17:10:07 +02:00
Rolf Bjarne Kvinge 5327564109
[AppKit/UIKit] Merge the definitions of NS[Mutable]ParagraphStyle. (#9261)
* Reduces code duplication.
* Makes the macOS versions thread-safe (the iOS versions have been thread-safe
  for years: 2c6a5303a7).
* A few parameters names were different in the definitions; I chose to keep the ones in Xamarin.iOS, since they looked better.
* Xamarin.Mac had two methods, SetTextBlocks and SetTextLists, in place of an actual property override (for the mutable setter), this was fixed to be an actual property overload, and compat methods were implemented.
* xtro needed an update to cope with multiple static methods for the same selector.
2020-08-04 14:25:24 +02:00
Rolf Bjarne Kvinge 85b50a0347 Merge remote-tracking branch 'origin/main' into HEAD 2020-08-04 10:39:46 +02:00
Rolf Bjarne Kvinge 7b92ea061b [monotouch-test] Fix a couple asserts with regards to native types. 2020-08-04 10:33:16 +02:00
Rolf Bjarne Kvinge 21ee5a7f74
[mtouch] Don't try to copy invalid symbol files. (#9262)
This solves a rebuild problem if an assembly has an invalid or unsupported symbol
file, where we'd detect that the symbol file exists, and expect it to be copied,
but then the linker would drop it, causing us to always rebuild the app (this is
not the same as when a symbol file is out of date).

This happens for NUnitLite 3.12.0's nunit.framework.dll, which ships with an old-style
pdb.

Also add a warning that is shown when we detect that there's a symbol file, but it
couldn't be loaded for some reason.
2020-08-04 08:08:44 +02:00
Rolf Bjarne Kvinge 691e8eac7a
[xharness] Improve parsing of NUnitV2 xml reports to fix an issue with failures in parameterized tests. (#9259)
We weren't properly reporting all failures when there were multiple failures
in parameterized tests, because we'd incorrectly skip too many xml nodes when
we were looking for the next test failure.
2020-08-03 18:51:30 +02:00
Rolf Bjarne Kvinge 7e9a60d690
[xharness] Fix main log parsing by not requiring it to come from a file. (#9258)
Not all types of logs have files, but all types of logs have a reader (or will
have soon due to PR #9257).
2020-08-03 18:51:09 +02:00
Rolf Bjarne Kvinge f7cd7d3cad
[xharness] Implement Log.GetReader for all loggers. (#9257)
This makes it easier to write code that parses logs, since that code won't
have to worry about if a particular log supports GetReader or not.
2020-08-03 18:51:01 +02:00
Rolf Bjarne Kvinge 8bb50638da Bump Touch.Unit.
This also required adding System.Core.dll to the MonoTouch.NUnitLite.dll, and fixing a csproj path.

New commits in spouliot/Touch.Unit:

* spouliot/Touch.Unit@f620668 [Touch.Client] Adjust project configurations. (#83)
* spouliot/Touch.Unit@545400b [Touch.Client] Fix paths in the .NET project files. (#81)
* spouliot/Touch.Unit@703586b [Touch.Client] Add API to exclude tests based on categories. (#82)
* spouliot/Touch.Unit@9266732 [Touch.Client] Add support for macOS. (#80)
* spouliot/Touch.Unit@2d556a5 [TouchRunner] Fix network logging to log if we're logging to a file even if EnableNetwork is false. (#79)
* spouliot/Touch.Unit@1f85e16 [TouchOptions] Fix a few issues related to command-line parsing. (#78)
* spouliot/Touch.Unit@1c272a9 [TouchRunner] Rename TestElement.Update to TestElement.TestFinished to make it clearer when it's used. (#73)
* spouliot/Touch.Unit@9a654ca [TouchRunner] Fix running multiple test assemblies in NUnitLite mode. (#76)
* spouliot/Touch.Unit@55c747f [TouchRunner] Print test output to the console. (#75)
* spouliot/Touch.Unit@ab5dce0 [TouchRunner] Keep track of the last shown test suite, and return to it when the app is relaunched. (#74)
* spouliot/Touch.Unit@1a7068c [TouchRunner] Only update the UI for a single test after the test has finished running. (#72)
* spouliot/Touch.Unit@ba93ddf [TouchRunner] Fix unused variable warning by only defining the variable when it's used. (#71)
* spouliot/Touch.Unit@ab2aaa5 [TouchRunner] Always show 'Run all'. (#70)
* spouliot/Touch.Unit@af58317 Move every Touch.Client projects to its own folder. (#69)
* spouliot/Touch.Unit@8a0ec0d [TouchRunner] Improve name printing in NuGet mode. (#68)
* spouliot/Touch.Unit@c7f8ff0 Ignore any 'packages' directory. (#67)

Diff: b4e8606a85..f62066880a
2020-08-03 16:21:43 +02:00
Rolf Bjarne Kvinge cad850fae7 [tests] Restore projects before building them from the command line. 2020-08-03 11:53:18 +02:00
Rolf Bjarne Kvinge 49030cffaf [tests] Pass --dlsym:+nunit.framework.dll to work around a P/Invoke to an inexistent function in nunit.framework.dll. 2020-08-03 11:53:18 +02:00
Rolf Bjarne Kvinge 3f8ebe4ba5 [tests] Make the mtouch tests cope with bindings-test.dll now having a dependency on nunit.framework.dll from a NuGet.
I would have liked to automatically get all the references required by bindings-test.dll,
but that turned out to be not as simple as I first thought (since bindings-test is
a library project, the exact dependencies actually depend on the type of the executable
project that references it, which means it's quite difficult to calculate the final
references given just the binding project).

Instead just hardcode the fact that there's a reference to nunit.framework.dll, and
the corresponding on-disk path (we still look in the actual csproj to get the version
of nunit.framework.dll).
2020-08-03 11:53:17 +02:00
Rolf Bjarne Kvinge 62719b6f7b [xharness] Use LogFile instead of ResultFile in macOS BCL tests to match the Touch.Client usage. 2020-08-03 11:53:18 +02:00
Rolf Bjarne Kvinge 09edb8558d [xharness] Add support for finding/setting the main Xamarin import among multiple imports.
This is required for the previous commit, where we added an additional import to
a few project files to pass an xml definition to mtouch/mmp.
2020-08-03 11:53:17 +02:00
Rolf Bjarne Kvinge 96615bbd67 [tests] The upstream NUnitLine isn't linker safe, so add an xml file to make sure linking doesn't remove too much.
In particular NUnit uses reflection to get a private method, and the linker removes
the corresponding private method:

1c680b4dc8/src/NUnitFramework/framework/Internal/TestExecutionContext.cs (L552)

So add an xml definition to keep this private method, and modify project files to
pass the xml definition to mtouch and mmp.

Some care needs to be taken to make sure xharness is still able to clone these project
files.
2020-08-03 11:53:17 +02:00
Rolf Bjarne Kvinge 5dcb243a05 [introspection] Remove NUnitLite and MonoTouchDialog tests.
These tests now end up testing the NUnitLite and MonoTouch.Dialog assemblies from
NuGet, not the ones we ship, which means they're out of our control to fix.
2020-08-03 11:53:17 +02:00
Rolf Bjarne Kvinge ba76910dc2 [tests] Delete MacTestMain.cs, it's not used anymore. 2020-08-03 11:53:17 +02:00
Rolf Bjarne Kvinge d85b7ea03e [tests] Make the template watchOS extension use Touch.Client's API to exclude tests based on categories.
This also removes the ability to filter tests based on the first character of
a test name, but we don't use this ability anymore.
2020-08-03 11:53:17 +02:00
Rolf Bjarne Kvinge f79efc29f6 [tests] Fix template projects to use Touch.Client. 2020-08-03 11:53:17 +02:00
Rolf Bjarne Kvinge 1cc265838a [xharness] Add the Touch.Client projects to our solutions instead of MonoTouch.NUnitLite. 2020-08-03 11:53:17 +02:00
Rolf Bjarne Kvinge e4aaf6a8d6 [xharness] Change how we run macOS unit tests to work with Touch.Client.
This is very similar to how we run iOS unit tests.
2020-08-03 11:53:17 +02:00
Rolf Bjarne Kvinge fcb8446eb5 [tests] Remove dead code related to GuiUnit and the GuiUnit submodule. 2020-08-03 11:53:17 +02:00
Rolf Bjarne Kvinge dcfa5015cc [tests] Update Xamarin.Mac tests to use Touch.Client and the official NUnit[Lite]. 2020-08-03 11:53:17 +02:00
Rolf Bjarne Kvinge 0a5b72d64b [tests] Update attributes in tests according to breaking changes in NUnit[Lite]. 2020-08-03 11:53:17 +02:00
Rolf Bjarne Kvinge 4a8cd19f93 [tests] Move the TestRuntime class out of MacTestMain.cs.
This makes it easier to re-use the TestRuntime code together with other Main implementations.
2020-08-03 11:53:17 +02:00
Rolf Bjarne Kvinge 349a6b6d5a [xharness] Add support for generating/duplicating projects with a Touch.Client reference.
This also means removing support for generating/duplicating MonoTouch.NUnit references,
since we're not using those anymore.
2020-08-03 11:53:17 +02:00
Rolf Bjarne Kvinge a528c4e869 [monotouch-test] Update setting the default floating point tolerance to how it's done in the official NUnitLite. 2020-08-03 11:53:17 +02:00
Rolf Bjarne Kvinge 4cee581ba5 [tests] Use Assert.IsInstanceOf instead of Assert.IsInstanceOfType.
The latter doesn't exist anymore in the official NUnitLite.
2020-08-03 11:53:17 +02:00
Rolf Bjarne Kvinge f516fcfb07 [tests] Use the Does.[BeginWith|Contain|EndWith] constraints instead of the Is.[StringStarting|StringContaining|StringEnding] constraints.
The latter don't exist in the official NUnitLite anymore.
2020-08-03 11:53:17 +02:00