xamarin-macios/tests
Rolf Bjarne Kvinge abd54028b8 Merge remote-tracking branch 'origin/main' into catalyst-monotouch-test 2021-01-29 19:01:10 +01:00
..
BundledResources [dotnet] Bump to .NET 6.0.100-alpha.1.20556.2. and net6.0 2020-11-10 11:41:06 +01:00
EmbeddedResources [dotnet] Bump to .NET 6.0.100-alpha.1.20556.2. and net6.0 2020-11-10 11:41:06 +01:00
api-shared [tests] Use the Does.[BeginWith|Contain|EndWith] constraints instead of the Is.[StringStarting|StringContaining|StringEnding] constraints. 2020-08-03 11:53:17 +02:00
bcl-test Revert "[tests] Ignore bcl-tests that causes a SIGFPE (#10235)" 2020-12-10 14:31:18 -05:00
bgen [tests] Merge the msbuild-mac tests into the Xamarin.MacDev.Tests project. (#10129) 2020-12-04 13:05:51 +01:00
bindings-framework-test [msbuild] Add support for `.xcframework` (#10046) 2020-11-30 13:44:03 -05:00
bindings-test [dotnet] Bump to .NET 6.0.100-alpha.1.20556.2. and net6.0 2020-11-10 11:41:06 +01:00
bindings-test2 Merge remote-tracking branch 'xamarin/xcode12.3' into main 2020-12-15 23:50:18 -05:00
bindings-xcframework-test [msbuild] Add support for `.xcframework` (#10046) 2020-11-30 13:44:03 -05:00
cecil-tests [src/mtouch] Put implementation assemblies in a per-platform directory (#10169) 2020-11-27 18:53:25 +01:00
common Fix boolean logic (or not!?) 2021-01-29 19:01:00 +01:00
dotnet [dotnet] Add support for some of the single-project MSBuild properties. (#10545) 2021-01-29 17:37:37 +01:00
framework-test [mac] Add user-framework support for Xamarin.Mac (#10144) 2020-11-26 08:47:41 -05:00
fsharp [tests] Use the FSharp.Core NuGet for Mac Catalyst. (#10307) 2020-12-17 15:01:20 +01:00
fsharplibrary [tests] Use the FSharp.Core NuGet for Mac Catalyst. (#10307) 2020-12-17 15:01:20 +01:00
generator [bgen] Avoid a NullReferenceException when reporting multiple attributes on a type. Fixes #10310. (#10311) 2020-12-17 15:12:32 +01:00
interdependent-binding-projects [dotnet] Bump to .NET 6.0.100-alpha.1.20556.2. and net6.0 2020-11-10 11:41:06 +01:00
introspection Bump to .NET 6.0.100-alpha.1.21060.3. (#10388) 2021-01-14 14:07:28 +01:00
linker [dotnet] Add support for LinkDescription items. (#10467) 2021-01-27 17:59:35 +01:00
mac-binding-project [Tests] Bump language used in the mac binding tests. (#8348) 2020-08-05 18:50:06 -04:00
mini Merge remote-tracking branch 'origin/xcode11' into master-xcode11 2019-09-13 18:35:18 +02:00
misc [tests] Import 2016-05-26 15:06:52 +02:00
mmp-regression [linker] Update custom attributes that can be removed (#8535) 2020-05-06 20:44:52 -04:00
mmptest [macos] Add correct support for producing/archiving `dSYM` (#10409) 2021-01-14 08:42:24 -05:00
mono-native [Xharness] Bring xharness changes to d16-8 (#9951) 2020-10-26 16:05:40 -04:00
monotouch-test Adjust code according to code review. 2021-01-29 11:06:55 +01:00
msbuild [dotnet] Add support for some of the single-project MSBuild properties. (#10545) 2021-01-29 17:37:37 +01:00
mtouch [tests] Don't use the tcp tunnel in the HttpClientHandler tests. Fixes xamarin/maccore#2154. (#10451) 2021-01-18 14:27:34 +01:00
qa-regression Mono 2018-08 requires macOS 10.9+, so Xamarin.Mac must as well. 2018-10-25 09:54:43 +02:00
sampletester Merge branch 'xcode12.2' into main-xcode12.2 2020-11-17 11:09:15 -05:00
scripted [runtime] Split the build differently: build libraries for simulator and device separately. (#7143) 2019-10-03 16:38:44 +02:00
scriptingbridge [tests] Remove Classic code from all tests. (#8707) 2020-05-29 16:43:06 +02:00
templates [tests] Make the template watchOS extension use Touch.Client's API to exclude tests based on categories. 2020-08-03 11:53:17 +02:00
test-libraries Add support for binding projects in Mac Catalyst. Fixes #10286. (#10295) 2020-12-17 18:53:16 +01:00
xammac_tests [tests] Merge apitest into xammac_tests. (#10276) 2020-12-18 11:45:06 +01:00
xcframework-test [msbuild] Add support for `.xcframework` (#10046) 2020-11-30 13:44:03 -05:00
xharness [xharness] Run Mac Catalyst variations by default, and disable all but monotouch-test by default. 2021-01-28 08:08:02 +01:00
xtro-sharpie [xtro] More xtro updates. 2021-01-29 18:58:48 +01:00
.gitignore [Xharness] Bring xharness changes to d16-8 (#9951) 2020-10-26 16:05:40 -04:00
HtmlTransform.xslt [tests] Move HtmlTransform.xslt here from maccore. (#16) 2016-04-28 15:07:26 -04:00
Makefile [dotnet] Bump to .NET 6.0.100-alpha.1.20556.2. and net6.0 2020-11-10 11:41:06 +01:00
README.md [xcode12] Rename master to main (#9631) 2020-09-15 07:09:29 -04:00
launch-manual-device-tests.sh Merge master into d16-5 2019-11-08 10:21:12 -05:00
launch-manual-sample-tests.sh [tests] Add script to launch manual sample test run for the current commit. (#8381) 2020-04-15 08:01:59 +02:00
nunit.framework.targets [tests] Add --dlsym:+nunit.framework.dll to all Xamarin.iOS test suites. (#9349) 2020-08-12 09:42:53 +02:00
nunit.framework.xml [tests] The upstream NUnitLine isn't linker safe, so add an xml file to make sure linking doesn't remove too much. 2020-08-03 11:53:17 +02:00
package-mac-tests.sh [CI][VSTS] The pkg of the tests fail because there is a path not longer found. (#10432) 2021-01-15 07:53:05 -05:00
test-dependencies.sh [system-dependencies] Add logic to auto-provision cmake. (#940) 2016-10-04 10:28:41 +02:00
tests-mac.sln [tests] Merge apitest into xammac_tests. (#10276) 2020-12-18 11:45:06 +01:00
tests.sln [msbuild] Add support for `.xcframework` (#10046) 2020-11-30 13:44:03 -05:00

README.md

Various tests to be executed prior to releases

Test solutions

Many of the test solutions and test projects are generated, and will only be available after running make once.

  • tests.sln: This is the base test solution for Xamarin.iOS, which targets iOS using the Unified API. Not generated.
  • tests-tvos.sln: All the TVOS test projects. Generated.
  • tests-watchos.sln: All the WatchOS test projects. Generated.
  • tests-mac.sln: This is the base test solution for Xamarin.Mac. Not generated.

Test solution/project generation

The tool that generates the test solutions / projects is called xharness, and lives in the xharness subdirectory.

Types of Tests

Unit Tests

Most of the projects are using NUnit[Lite] and looks like unit tests. They are meant to be executed on the target: simulator, devices, OSX.

In reality most of them are regression tests - but that does not change the need to execute and continually expand them to cover new code.

Introspection Tests

Introspection tests are executed on target (both simulator and device for iOS) or a specific version of OSX. The application proceed to analyze itself using:

  • System.Reflection for managed code; and
  • the ObjectiveC runtime library for native code

and compare the results. E.g. if using .NET reflection it can see a binding for a NSBundle type then it should be able to find a native NSBundle type using the ObjC runtime functions. Otherwise an error is raised...

Since the application analyze itself it must contains everything we wish to test. That's why the introspection tests are part of the dontlink.app application (for iOS) and the dontlink-mac project (for OSX).

Pros

  • They always tell the truth, which can differ from documentation

Cons

  • Incomplete - Not everything is encoded in the metadata / executable;
  • Too complete - Not every truth is good to be known (or published)

Extrospection Tests

Extrospection tests takes data from some outside sources and see if our implementation match the information, e.g.

  • Header files from the SDK;
  • Rules, like Gendarme or FxCop;

Since this is done externally there's no need to run them on the devices, simulator or even a specific version of OSX.

Pro

  • There is more data available, e.g. information lost when compiling

Con

  • The data might not represent the truth (errors, false positives...)

Xamarin.Mac

Many tests when run for macOS use a integration hack which helps handle a number of issues:

  • Allowing command line arguments to tests while excluding "psn" arguments passed in while debugging with Visual Studio for Mac
  • Invoking _exit to work around a number of post-test hangs. See the bug for details.
  • Add a number of "default" excludes for mono BCL tests

One very useful "hack" this support adds is the ability to run a single test from the command line via the XM_TEST_NAME environmental variable. For example

XM_TEST_NAME=MonoTouchFixtures.Security.KeyTest.CreateRandomKeyWithParametersTests make run-mac-unified-xammac_tests

Test Suites

*-tests : where * is the assembly name, e.g. monotouch

Use the project defaults for linking, i.e.

  • "Don't link" for simulator

  • "Link SDK assemblies only" for devices

  • regression testing without using the linker

  • both simulator and devices are set to "Don't link"

linkall

  • regression testing using the linker on the all assemblies

  • "Link all assemblies" for both simulator/devices

linksdk

  • regression testing using the linker on the SDK assemblies

  • "Link SDK assemblies only" for both simulator/devices

bcl-test

These are the Mono BCL test suite tweaked to run on the mobile profile. It reuse the files directly from mono's repository (linking, not copying).

As other unit tests the configuration is set to mimick normal apps, e.g.

  • "Don't link" for simulator

  • "Link SDK assemblies only" for devices

Common make targets

Run every test in both the simulator and on device, using both the compat and the new profile (for the simulator both in 32 and 64bit mode).

$ make run

Run every test in the simulator, using both the compat and the new profile (both 32 and 64bit simulators).

$ make run-all-sim

Run every test on device, using both the compat and the new profile

$ make run-all-dev

Detailed make targets

  • Main target

    • run-what-where-project: Builds, installs (if applicable) and runs the specified test project on the specified platform. This is the most common target to use.
    • build-what-where-project: Will build the specified test project for the specified platform and target.
    • install-what-where-project: Will install the specified test project on a connected device. There's currently no way to select the device, so ensure you've only one connected (if many devices are connected, it's random which will used).
    • exec-what-where-project: Will run the specified test project in the simulator or on a device.
  • What

    • -ios-: iOS.
    • -tvos-: TVOS.
    • -watchos-: WatchOS

    If "What" is skipped, all variations are executed sequentially.

  • Where

    • -simclassic-: Simulator using the Classic API. Only applicable when platform is iOS.
    • -simunified-: Simulator using Unified API. The build will contain both an i386 and an x86_64 binary. Only applicable to the build-* target, while the -sim32- and -sim64- are only applicable to the exec-* targets. Only applicable when the platform is iOS.
    • -sim32-: 32bits iOS simulator using the Unified API. Not applicable to other platforms.
    • -sim64-: 64bits iOS simulator using the Unified API. Not applicable to other platforms.
    • -sim-:
      • iOS: Both the -simclassic- and -simunified- versions.
      • WatchOS/TVOS: The WatchOS/TVOS simulator.
    • -devclassic-: Device using the Classic API. Only applicable when the platform is iOS.
    • -devunified-: Device using the Unified API. The build will contain both an armv7 and an arm64 binary. It's not possible to select a 32/64bit version, you'll run what your device supports. Only applicable when the platform is iOS.
    • -dev-:
      • iOS: Both the -devclassic- and -devunified- versions.
      • WatchOS/TVOS: A Watch or TV device.
  • Examples

    $ make run-ios-sim32-monotouchtest: This will run monotouch-test using the Unified API in a 32-bit simulator. $ make run-tvos-dev-dont\ link: This will run dont link on an Apple TV device.

Utility run-* targets

These targets will build, install (if applicable) and run the specified project(s).

  • Simulator

    • run-sim-project: Builds and runs the specified test project in the simulator in compat, 32 and 64bit mode.
    • run-sim: Builds and runs all the non-bcl test projects in the simulator in compat, 32 and 64bit mode.
  • Device

    • run-dev-project: Builds and runs the specified non-bcl test project on a device in compat and native mode (if it's 32 and 64bit depends on the device; 64bit devices will run in 64bit mode and the same for 32bit devices).
    • run-devcompat: Run all the non-bcl test projects on device, in compat mode.
    • run-devdual: Run all the non-bcl test projects on device, in native mode (if it's 32 and 64bit depends on the device; 64bit devices will run in 64bit mode and the same for 32bit devices).
    • run-dev: Run all the non-bcl test projects on device, in both compat and native mode.