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

19 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 94a3903df7 [tests] Bump min OS versions in all tests. 2023-02-02 16:30:28 +01:00
Rolf Bjarne Kvinge 1c80823582
[autoformat] Add all of tests/. (#16857) 2022-12-05 08:23:34 +01:00
Rolf Bjarne Kvinge e3bc284ab1
[build] Set DEVELOPER_DIR and MD_APPLE_SDK_ROOT to the Xcode we're using. (#15266)
This makes it not necessary to check for the currently selected Xcode in our
system dependency check. It also means it'll become much easier to work with
multiple branches simultaneously where each branch needs its own Xcode.
2022-06-20 09:52:21 +02:00
Rolf Bjarne Kvinge 88eb5e1ac8
Rename any *OSX_SDK_VERSION variables to *MACOS_SDK_VERSION. (#13411)
This makes it easier to iterate over all the *_SDK_VERSION variables in
template code, because they're all named using the standard platform names we
use elsewhere.
2021-11-22 18:48:05 +01:00
Rolf Bjarne Kvinge 2972e1b715
Fix some whitespace issues in various files. (#12399)
* Remove BOM
* Add EOL at end of file.
2021-08-11 10:06:46 +02:00
Manuel de la Pena 382f2ad997
[Tests] Bump language used in the mac binding tests. (#8348)
* [Tests] Bump language used in the mac binding tests.

They broke with nullability, we need to use the latests lang version.

Fixes: https://github.com/xamarin/xamarin-macios/issues/8346
2020-04-10 19:25:30 -04:00
Rolf Bjarne Kvinge f496904082
[tests] Fix tests on Catalina. (#7255)
* [monotouch-test] Percent-escape some local file paths. Fixes xamarin/maccore#2032.

Fixes this xammac test failure when the csproj has paths in its path:

    1) GetCaption (MonoTouchFixtures.MediaAccessibility.ImageCaptioningTest.GetCaption)
       System.Exception : Could not initialize an instance of the type 'Foundation.NSUrl': the native 'initWithString:' method returned nil.
    It is possible to ignore this condition by setting ObjCRuntime.Class.ThrowOnInitFailure to false.
      at Foundation.NSObject.InitializeHandle (System.IntPtr handle, System.String initSelector) [0x000ab] in <c93a0a20c5e340cb9a858d96ecca3415>:0
      at Foundation.NSUrl..ctor (System.String urlString) [0x00044] in <c93a0a20c5e340cb9a858d96ecca3415>:0
      at MonoTouchFixtures.MediaAccessibility.ImageCaptioningTest.GetCaption () [0x00076] in <7a733573c3684923854270073138d4be>: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 culture) [0x0006a] in <9c0bd541400747ef85267f70e32bd8e4>:0

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

* [tests] Exclude MPS tests in the simulator on macOS 10.15+. Fixes xamarin/maccore#2030.

The simulator crashes when the app tests if MPS is supported...

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

* [tests] Remove 32-bit slice from macOS test libraries. Fixes xamarin/maccore#2031.

The 32-bit slice is causing a build failure on the bots:

    Task "Exec" (TaskId:35)
      Task Parameter:Command=make bin/SimpleClassDylib.dylib bin/SimpleClassStatic.a bin/Mobile-static/MobileBinding.dll (TaskId:35)
      Task Parameter:WorkingDirectory=/Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/mmptest//../mac-binding-project/ (TaskId:35)
      make bin/SimpleClassDylib.dylib bin/SimpleClassStatic.a bin/Mobile-static/MobileBinding.dll (TaskId:35)
      In file included from ../common/mac/SimpleClass.m:1: (TaskId:35)
      In file included from ../common/mac/SimpleClass.h:1: (TaskId:35)
      In file included from /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13: (TaskId:35)
      In file included from /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:27: (TaskId:35)
      In file included from /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSCollectionView.h:9: (TaskId:35)
    /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSViewController.h(247,39): error GF2D19E48: unknown type name 'NSExtensionContext'; did you mean 'NSAnimationContext'? [/Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/xharness/tmp-test-dir/mmptest/mmptest.csproj]
      @property (nullable, readonly,retain) NSExtensionContext *extensionContext API_AVAILABLE(macos(10.10)); (TaskId:35)
                                            ^ (TaskId:35)
      /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSAnimationContext.h:18:12: note: 'NSAnimationContext' declared here (TaskId:35)
      @interface NSAnimationContext : NSObject (TaskId:35)
                 ^ (TaskId:35)
      In file included from ../common/mac/SimpleClass.m:1: (TaskId:35)
      In file included from ../common/mac/SimpleClass.h:1: (TaskId:35)
      In file included from /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13: (TaskId:35)
      In file included from /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:99: (TaskId:35)
      In file included from /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSSharingServicePickerTouchBarItem.h:9: (TaskId:35)
    /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSSharingService.h(181,119): error GC04982C4: expected a type [/Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/xharness/tmp-test-dir/mmptest/mmptest.csproj]
      - (NSCloudKitSharingServiceOptions)optionsForSharingService:(NSSharingService *)cloudKitSharingService shareProvider:(NSItemProvider *)provider; (TaskId:35)
                                                                                                                            ^ (TaskId:35)
    /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSSharingService.h(196,12): error G93352991: cannot find interface declaration for 'NSItemProvider' [/Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/xharness/tmp-test-dir/mmptest/mmptest.csproj]
      @interface NSItemProvider (NSCloudKitSharing) (TaskId:35)
                 ^ (TaskId:35)
      In file included from ../common/mac/SimpleClass.m:1: (TaskId:35)
      In file included from ../common/mac/SimpleClass.h:1: (TaskId:35)
      In file included from /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13: (TaskId:35)
      In file included from /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:250: (TaskId:35)
    /Applications/Xcode111.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSItemProvider.h(16,12): error G93352991: cannot find interface declaration for 'NSItemProvider' [/Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/xharness/tmp-test-dir/mmptest/mmptest.csproj]
      @interface NSItemProvider (NSItemSourceInfo) (TaskId:35)
                 ^ (TaskId:35)
      4 errors generated. (TaskId:35)
      make[1]: *** [bin/SimpleClass.i386.a] Error 1 (TaskId:35)

and since we don't need the 32-bit slice anymore, just remove it.

Fixes https://github.com/xamarin/maccore/issues/2031.
2019-10-19 00:01:53 +02:00
Rolf Bjarne Kvinge f8a254d628 Merge remote-tracking branch 'origin/master' into mono-2018-08 2018-11-16 14:26:50 -05:00
Ankit Jain f865694f86 Move tests to use new tool xibuild and thus fix msbuild tests (#5128)
* xibuild: New wrapper tool to run msbuild or managed executables

MSBuild supports fallback paths for projects imported using
`$(MSBuildExtensionsPath)`, but these must be specified explicitly in
the app.config of the main executable. There was a PR to allow use of
properties for this in the app.config, but that was not accepted
upstream.

This is required for being able to:

1. build projects with msbuild against the in-tree XI/XM build output
2. and to run nunit tests against the same.

For this we introduce a new tool, `xibuild`, based on XA's `xabuild`.
This supports the fallback paths to be specified via the environment variable
`MSBuildExtensionsPathFallbackPathsOverride`[1].
It essentially operates in 3 modes:

1. `xibuild -c /path/to/foo.exe`
	Generates /path/to/foo.exe.config with the fallback paths inserted into that.

2. `xibuild -- /v:diag /path/to/project.csproj`
	Runs msbuild with the arguments after `--` with a custom app.config based on
	`MSBuild.dll.config`, with the fallback paths correctly inserted.
	This is in a temporary file and the original config file is not touched.

3. `xibuild -t -- /path/to/managed_tool.exe args`
	Generates `/path/to/managed_tool.exe.config` based on `MSBuild.dll.config` with
	the fallback paths inserted, and runs `managed_tool.exe` with the arguments.
	The default is to overwrite the config file.
	But there is also a switch to merge it with an existing config file.

--
1. Value of the environment variable $MSBuildExtensionsPathFallbackPathsOverride
is prepended to any existing list of search paths in `MSBuild.dll.config`, IOW,
it takes precedence. So, the order of lookup becomes:

  - Value of the property `$(MSBuildExtensionsPath)`
  - Value of the environment variable `$MSBuildExtensionsPathFallbackPathsOverride`
  - /Library/Frameworks/Mono.framework/External/xbuild on macOS

* Integrate use of `xibuild` with the tests

Update all uses of `msbuild` and invocations of tools like nunit that
might depend on using the in-tree builds to use `xibuild`.

* xibuild: Move help descriptions to OptionSet itself.
2018-11-16 14:24:35 -05:00
Rolf Bjarne Kvinge cca50fe500 Mono 2018-08 requires macOS 10.9+, so Xamarin.Mac must as well. 2018-10-25 09:54:43 +02:00
Ankit c7b051436f [msbuild] Replace all invocations of xbuild with msbuild
- And map xbuild properties to msbuild ones for fallback paths

`XBUILD_FRAMEWORK_FOLDERS_PATH -> TargetFrameworkFallbackSearchPaths`

`MSBuildExtensionsPath -> MSBuildExtensionsPathFallbackPathsOverride`

Note:
Earlier with xbuild, the order of lookup for (example)
`MSBuildExtensionsPath` was:

	1. The value of $(MSBuildExtensionsPath), which we were setting to
	the in-tree path

	2. /Library/Frameworks/Mono.framework/External/xbuild on osx

	3. $prefix/lib/mono/xbuild (default location)

And with the above changes, it will be:

	1. The value of $(MSBuildExtensionsPath), which we are no longer
	setting, so the default path : $prefix/lib/mono/xbuild

	2. The in-tree path, via $(MSBuildExtensionsPathFallbackPathsOverride)

	3. /Library/Frameworks/Mono.framework/External/xbuild on osx

Since, XI/XM targets are used via fallback path
`/Library/Frameworks/Mono.framework/External/xbuild`, the default
location doesn't matter. And the order of the remaining two remains the
same.

The same thing applies to the target frameworks also.
2018-05-22 13:24:29 -04:00
Rolf Bjarne Kvinge ee91b95c19 [tests] Unset XCODE_DEVELOPER_DIR_PATH when building mac binding projects. (#2776)
Unset XCODE_DEVELOPER_DIR_PATH when building mac binding projects, so that
when building from VSfM when the Xcode in VSfM differs from the system Xcode
(according to xcode-select) the Xcode command-line tools don't end up confused
and fail in strange ways.
2017-09-27 10:48:51 +02:00
Rolf Bjarne Kvinge dbc78103d0 [mmp] Fix symbol name for 32-bit Objective-C classes. Fixes #58861. (#2506)
* [mmp] Fix symbol name for 32-bit Objective-C classes. Fixes #58861.

https://bugzilla.xamarin.com/show_bug.cgi?id=58861

* [tests] Add test case for bug #58861.

https://bugzilla.xamarin.com/show_bug.cgi?id=58861

* [tests] Fix build failure for msbuild and xammac tests.

Fixes this:

> tests/common/mac/ProjectTestHelpers.cs(93,68): error CS0117: 'Driver' does not contain a definition for 'Verbosity'

* [mmptest] Fix build to build MobileBinding.dll as well.

This makes sure tests that need MobileBinding.dll actually have it.
2017-08-24 09:42:08 +02:00
Chris Hamons 9accdb3888 Framework tests were still binding non-linked Simple class which errors now (#2216)
- Improve Makefile to rebuild when projects build with errors
2017-06-14 08:33:18 -05:00
Chris Hamons 482ab9051f [XM] Rework binding project test to try to fix build machine issues (#1474)
- https://bugzilla.xamarin.com/show_bug.cgi?id=50634
2017-01-17 10:06:10 -06:00
Rolf Bjarne Kvinge 7cbaa254c5 [tests] Make mdtool verbose on CI, and fix a few xbuild invocation to honor XBUILD_VERBOSITY. (#131) 2016-06-06 13:01:24 +02:00
Rolf Bjarne Kvinge 4a714f3c43 Make logic not depend on the checkout directory being named 'xamarin-macios'. (#129) 2016-06-06 12:18:52 +02:00
Chris Hamons f495ad50a7 [XM] Fix mmp tests to use shared mac-binding-project copy, and name SimpleClassDylib.dylib correctly (#120) 2016-06-01 13:51:04 -04:00
Rolf Bjarne Kvinge ecfdea9508 [tests] Import 2016-05-26 15:06:52 +02:00