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

104 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 74d7337dcc
[dotnet] Create an MSBuild property for the current min OS version. (#17034)
Create an MSBuild property for the minimum OS version
(`SupportedOSPlatformVersion`) we support for a given platform (named
`[platform]MinSupportedOSPlatformVersion`), and use it in most tests instead
of hardcoding the min OS version (which would otherwise have to be updated
every time we bump the min OS version).
2023-01-10 21:18:39 +01:00
Rolf Bjarne Kvinge 834bb92cb0
[tests] Update .NET tests to cope with updated min OS version and no more 32-bit iOS support. (#17088) 2022-12-21 18:15:28 +01:00
Rolf Bjarne Kvinge b765cf90a3
[tests] Update MTouch tests to cope with potentially higher min OS version and no 32-bit iOS support. (#17087) 2022-12-21 18:14:46 +01:00
Rolf Bjarne Kvinge 574031059d
[tests] Improve the Bug35176 generator test. (#17070)
Make it assert on the exact list of attributes we're expecting. This makes it
much easier to see what changed.
2022-12-16 15:20:06 +01:00
Rolf Bjarne Kvinge cc5c1bb4bf
[tests] Adjust cecil-tests to not test 32-bit iOS assemblies unless 32-bit iOS architectures are enabled. (#16989) 2022-12-07 18:24:14 +01:00
Rolf Bjarne Kvinge 78813cb591
[tests] Remove some dead code. (#16988) 2022-12-07 17:42:36 +01:00
Rolf Bjarne Kvinge 5e010e6700
[xharness] Fix typo when checking whether legacy Xamarin is enabled or not. (#16771)
Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
2022-11-17 17:09:02 -05:00
Rolf Bjarne Kvinge 1c4ac4564d
[jenkins] Jenkins is dead, long live ~Wrench~ Azure Devops. (#16396)
Remove all Jenkins logic that's no longer being used.
2022-10-21 10:05:59 +02:00
Rolf Bjarne Kvinge deb0faa4f2
Autoformat cecil-tests.csproj. (#16103)
All other changes should be blank space only.

Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
2022-09-26 21:00:28 +02:00
Rolf Bjarne Kvinge 8e92e9e5c5
[tests] Ignore tests that require platforms not included in the current build. (#16000) 2022-09-22 07:33:42 +02:00
Rolf Bjarne Kvinge a2f52c77da
[tests] Ignore msbuild tests that require legacy Xamarin when legacy Xamarin is not enabled. (#16019) 2022-09-21 12:13:59 +02:00
Rolf Bjarne Kvinge a020f09979
[tests] Update the cecil tests to run on .NET assemblies. (#15969)
And not legacy assemblies if the legacy build is disabled.
2022-09-19 11:52:23 +02:00
Rolf Bjarne Kvinge a1d0b6eba9
Make our local .NET the default .NET for the build. (#15086)
Make our local .NET the default .NET (in the root's global.json), and then if
a directory wants to use the system .NET, then that directory would have to
opt-in (using its own global.json).

This way we don't have to copy global.json/NuGet.config files around to run
tests with the correct .NET setup.
2022-06-07 10:11:02 +02:00
Rolf Bjarne Kvinge e3a03d2804
Remove the Visual Studio dependency. (#15102)
Remove our dependency on Visual Studio. Use the 'dotnet-t4' tool instead of
invoking the t4 tool embedded in Visual Studio.

Fixes this build error after installing VS Mac 2022:

> Cannot open assembly '/Applications/Visual Studio.app/Contents/Resources/lib/monodevelop/AddIns/MonoDevelop.TextTemplating/TextTransform.exe': No such file or directory.
2022-05-25 08:26:51 +02:00
Chris Hamons f33ddd906d
[nnyeah] Convert integration test to nunit from Makefile (#15040)
- Also refactor test layout a bit to split unit from integration
- Integration should long term invoke the nuget installed, unit never will.
2022-05-17 09:24:35 -05:00
Rolf Bjarne Kvinge 82482edc70
[cecil-tests] Improve these tests a bit. (#14994) 2022-05-13 20:50:02 +02:00
Rolf Bjarne Kvinge 9c185e1fff
[msbuild] Ask ditto to thin native libraries according to the architectures we're targetting. Fixes #13081. (#14403)
Ask ditto to thin native libraries and frameworks when copying them to the app
bundle to remove slices for architectures we're not building for.

Also add tests.

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

Co-authored-by: TJ Lambert <50846373+tj-devel709@users.noreply.github.com>
2022-04-07 08:17:01 +02:00
Rolf Bjarne Kvinge 08978fa4b1
[dotnet] Rename hardcoded 'net6.0' to use a 'DOTNET_TFM' variable instead. (#14524)
This makes things easier for .NET 7.
2022-04-01 13:48:09 +02:00
Rolf Bjarne Kvinge dea5c1e812
[tests] Fix logic to make generator tests work with a system install. (#14497)
Fixes https://github.com/xamarin/maccore/issues/2549.
2022-03-30 21:36:09 +02:00
Rolf Bjarne Kvinge ab513555a6
[tests] There's no need to have different logic to compute the source root path on Azure DevOps. (#14485) 2022-03-25 16:38:37 +01:00
Rolf Bjarne Kvinge e44d0fd047
[.NET] Rename several DOTNET6_* variables to to DOTNET_*. (#14463)
Also rename DOTNET_VERSION to SYSTEM_DOTNET_VERSION to make it clear what it's
referring to (and to not clash with DOTNET6_VERSION which has now been renamed
to DOTNET_VERSION).

.NET 7 is right around the corner.
2022-03-23 08:07:34 +01:00
Rolf Bjarne Kvinge e369f466f7
[dotnet] Rename the DOTNET6 make variable to DOTNET. (#14441)
This is the follow-up to where the DOTNET variable was renamed SYSTEM_DOTNET.
2022-03-21 15:56:57 +01:00
Manuel de la Pena e07b7bef79
[CI] Move tests outside of the build machine. (#14105)
Move the execution of tests to a diff bot to be compliant with the latests EO.
2022-03-10 23:36:37 -05:00
Rolf Bjarne Kvinge df491ed4b3
[cecil-tests] Improve the obsolete member test. Fixes #13621. (#14258)
* Check implementation assemblies instead of reference assemblies.
* Try to print the source code location for failing API (this required processing
  the implementation assemblies, because the reference assemblies don't have debug
  information where the source code location is stored).
* Don't report API that has [EditorBrowsable (None)] attributes, presumably we
  decided to keep these for compatibility, while highly discouraging their
  continued use. Also stop doing this for the next time we can do a breaking
  change, maybe we can remove these APIs then.
* Don't report API that has [UnsupportedOSPlatform ("...#.#") attributes (with
  a version number), presumably this is API that is still valid for some OS
  versions.
* Enable the test for all APIs (no ignores anymore). It's green!

Fixes https://github.com/xamarin/xamarin-macios/issues/13621.
2022-02-28 11:26:44 +01:00
Rolf Bjarne Kvinge 83136c4507
[tests] Fix packaging mac tests by generating valid bash code for test.config. (#14236)
Fixes this failure:

    ++ DOTNET_CSC_COMMAND=/Users/builder/azdo/_work/1/s/xamarin-macios/builds/downloads/dotnet-sdk-6.0.300-preview.22118.1-osx-x64/dotnet
    ++ exec /Users/builder/azdo/_work/1/s/xamarin-macios/builds/downloads/dotnet-sdk-6.0.300-preview.22118.1-osx-x64/sdk/6.0.300-preview.22118.1/Roslyn/bincore/csc.dll
    test.config: line 22: /Users/builder/azdo/_work/1/s/xamarin-macios/builds/downloads/dotnet-sdk-6.0.300-preview.22118.1-osx-x64/sdk/6.0.300-preview.22118.1/Roslyn/bincore/csc.dll: Permission denied
    make[1]: *** [mac-test-package.zip] Error 1
    make: *** [package-tests] Error 2
2022-02-24 22:57:25 +01:00
Rolf Bjarne Kvinge 4fd770c3c4
[msbuild/generator] Pass .NET's C# compiler to bgen to use. Fixes #12922. (#14192)
We can't execute mono's C# compiler when using .NET, so we need to tell bgen
where csc is in that case.

Fixes https://github.com/xamarin/xamarin-macios/issues/12922.
2022-02-23 09:36:43 +01:00
Rolf Bjarne Kvinge e25163f573
[.NET] Rename our product assemblies. Fixes #13748. (#13847)
Rename our product assemblies to:

* Microsoft.iOS.dll
* Microsoft.tvOS.dll
* Microsoft.macOS.dll
* Microsoft.MacCatalyst.dll

This makes it easy to distinguish between legacy Xamarin and .NET whenever the
product assembly is mentioned, and I've also chosen the platform part of the
name to match how the platforms are named elsewhere (this also makes it
possible to simplify our build logic, since we can remove a lot of special
casing).

Fixes https://github.com/xamarin/xamarin-macios/issues/13748.
2022-02-16 21:30:32 +01:00
Rolf Bjarne Kvinge a2e4438536 Merge remote-tracking branch 'origin/main' into dotnet-resolvedfiletopublish 2022-01-13 22:13:00 +01:00
Rolf Bjarne Kvinge d953b6f037 [tests] Augment tests to rebuild and make sure the result is as expected. 2022-01-13 22:07:57 +01:00
Rachel Kang 304048a965
Add cecil test for verifying obsoleted apis (#13590)
* First version cecil test

* Add missing net6 platform assemblies

* Make it work for Catalyst

* Add namespace switch and clean up code

* Update based on feedback

* Update based on feedback

* Update based on feedback

* Make test pass by default

* Fix bgen tests by fixing GetRefNuGetName

* Update based on feedback

Co-authored-by: Chris Hamons <chris.hamons@xamarin.com>
2022-01-12 09:47:46 -05:00
Rolf Bjarne Kvinge 268620bd0e [tests] Add BundleStructure, a test project to verify how files end up in the app bundle. 2021-12-22 10:17:34 +01:00
Rolf Bjarne Kvinge b695c8c837
[dotnet] Don't add FileNativeReferences to the main libraries to link with. Fixes #13503. (#13598)
Don't add FileNativeReferences to the main libraries to link with, because we
pass that list of main libraries to the LinkNativeCodeTask, and we're already
passing the FileNativeReferences for a different task parameter.

This means that we end up adding the file native reference twice to the linker
arguments, and that's wasteful. It can also cause problems if those linker
arguments aren't always computed in the same way (once as a relative path,
once as an absolute path for instance).

Fixes https://github.com/xamarin/xamarin-macios/issues/13503.
2021-12-21 08:13:53 +01:00
Manuel de la Pena 45340e80f7
[Tests] Fix the retrieval of variables in .Net after quotes were added. Fixes #13516 (#13522)
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2021-12-09 20:28:35 -05:00
Rolf Bjarne Kvinge b92f79fe1b [tests][cecil-tests] Add new test to verify the constructors we expose.
Verifies that:

* There shouldn't be any (IntPtr) or (IntPtr, bool) constructors.
* The (NativeHandle) or (NativeHandle, bool) constructors should not be public.
* The constructors correctly chain to the base constructor according to our usual
  pattern: the (IntPtr) ctor must chain to the self/base (IntPtr, bool) constructor
  passing 'false' for the owns parameter.
* The constructors don't have any extra code in them (barring a few exceptions).
2021-11-26 14:25:21 +01: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 b70e6f4674
Submodule MonoTouch.Dialog. (#13058)
* Submodule MonoTouch.Dialog.

Submodule MonoTouch.Dialog, so that we can easily build it using .NET. This
submodule will become redundant when/if we publish a .NET version of
MonoTouch.Dialog, but until that happens we need it at least for our own test
suites.

This also means we have to copy our NuGet.config and global.json files to the
MonoTouch.Dialog project directory so that we point msbuild to use our local
build.

New commits in spouliot/Touch.Unit:

* spouliot/Touch.Unit@cbda703 [Touch.Client] Use MonoTouch.Dialog from a submodule. (#109)

Diff: 3345db2f4e..cbda703583

* Use relative path for submodule.

And fix indentation and set the branch name.

* Don't use 'RootTestsDirectory' when it might not be defined yet.

* [tests] Our test projects don't need to reference MonoTouch.Dialog directly.

The projects get the MonoTouch.Dialog reference indirectly through the
Touch.Client project reference.

* [tests] Only validate unique errors in the .NET unit tests.

* [tests] No need to reference System.Json anymore, that's handled directly in the MonoTouch.Dialog project.

* [tests] Reference nunit.framework.targets so we get a workaround for an NUnit issue everywhere.

* [msbuild] Only try to create a package if we're able to create an app bundle.

This fixes an issue where a library project would try (and fail) to create a
package when 'CreatePackage=true' (which could be set for the executable
project, but inherited by the library project since the executable project
depends on it).

* [tests] Adjust PackTest.BindingXcFrameworksProject to not set the AssemblyName property.

MSBuild ends up being very confused when the project we're trying to build
depends on other projects, because AssemblyName is set for all the projects
being build, and MSBuild complains about ambiguous projects:

> error: Ambiguous project name 'bindings-xcframework-test'
2021-10-26 08:18:34 +02: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
Rolf Bjarne Kvinge ca607b3e86
[tests] Fix warning about unused variable. (#12117) 2021-07-16 16:27:26 +02:00
Rolf Bjarne Kvinge 3d9c37778f
[tests] Collect and zip up the .NET unit tests for execution on Windows. (#11850) 2021-06-08 08:59:10 +02:00
Rolf Bjarne Kvinge fdae69f5d6
[tests] Only run the RegistrarTest.CustomUserTypeWithDynamicallyLoadedAssembly test from a source checkout. (#11743)
It needs another assembly built from the source tree, so it won't work unless
executed from a source checkout. This way we don't try to run it on older
macOS versions, where the required assembly won't exist.
2021-05-31 15:43:25 +02:00
Manuel de la Pena 8ec9182b12
[CI] Allow to ignore tests if dotnet is enabled. (#11604) 2021-05-20 09:37:22 -04:00
Rolf Bjarne Kvinge bf7c3268bc
[dotnet] Use the reference assemblies from the .NET 6 version we're referencing. (#10813) 2021-03-09 14:57:56 +01:00
Rolf Bjarne Kvinge 913b612d6d [tests] Add unit tests for Mac Catalyst on .NET 6. 2021-02-23 07:59:13 +01:00
Rolf Bjarne Kvinge b8d98a499c
[dotnet] Disable watchOS. (#10625)
* [dotnet] Disable watchOS.

* [tests] Ignore watchOS tests when the watchOS build is disabled.
2021-02-12 21:52:27 +01:00
Rolf Bjarne Kvinge c640775699 [dotnet] Bump to .NET 6.0.100-alpha.1.20556.2. and net6.0
New commits in spouliot/Touch.Unit:

* spouliot/Touch.Unit@f8768d9 Advance into the world of net6.0

Diff: 9abe69e6f5..f8768d99ef
2020-11-10 11:41:06 +01:00
Rolf Bjarne Kvinge 69a171abff [tests] Clean up Xamarin.MacDev.Tests.
This is a pretty big refactoring, which:

* Always copies the test projects to a temporary directory before running any tests
  that use them.
* Runs all the tests using an out-of-process MSBuild instance.
* Logs to a binlog instead of writing text to stdout.
* Refactors all the code that used the MSBuild assemblies in memory to instead:
    * Tests that modified projects in memory now modifies them on disk instead. This
      won't affect the working copy because the tests are always working with a copy
      of the test projects.
    * Tests that inspected projects in memory afterwards now parses the binlog to get
      the same information.
* Significantly simplified the code to setup the test projects for testing.
2020-10-29 14:52:31 +01:00
Rolf Bjarne Kvinge 86cb7468b9
[tests] Fix ignoring dotnet tests when certain platforms have been disabled. (#9851)
Fixes an issue where some of the non-macOS dotnet tests where ignored because
the logic to disable the macOS ones were incorrect.
2020-10-13 17:55:20 +02:00
Rolf Bjarne Kvinge 9ade64930f
[msbuild] Move all the msbuild tests to tests/msbuild to put all the tests together. (#9824)
* [msbuild] Move msbuild/tests to tests/msbuild to put all the tests together.

* [tests] Move test projects for Xamarin.Mac to tests/common/TestProjects

* [tests] Move test projects for Xamarin.iOS to tests/common/TestProjects
2020-10-09 16:06:19 +02:00
Rolf Bjarne Kvinge f4832392d7
[tests] Remove duplicated code to set the requirement environment variables for building locally. (#9733) 2020-09-30 19:09:55 +02:00
Rolf Bjarne Kvinge fa58a24161
[msbuild] Port the test projects to .NET, and add a test case that compares the built .app (#9706)
Port the iOS/tvOS/watchOS msbuild test projects to .NET, and add a unit test
that builds both the old-style and new-style test projects and compares the
output in the resulting .app directories.

There are many expected differences in the apps, those will be ignored during
the comparison.

There are also numerous features that are not implemented yet in .NET, with
the corresponding adjustments in the comparison logic (they show up as TODO in
the code), these TODOs will be removed as features are implemented in the .NET
build.

There are a couple of test projects that can't be compared yet, because they
just don't build yet. Those are also TODOs.
2020-09-29 08:44:08 +02:00