xamarin-macios/tests
Rolf Bjarne Kvinge fd8e8f1d42
[tests] Fix MT4134 test to take into account frameworks introduced in iOS 11.4. (#4242)
This test requires bots with Xcode 8.3 to trigger, which is why this hasn't been caught before.
2018-06-13 22:08:56 -07:00
..
BundledResources [tests] Add support for building device tests for 32-bit or 64-bit. 2016-10-11 19:52:36 +02:00
EmbeddedResources [tests] Explicitly state the resource name for resources. 2017-02-10 16:39:38 +01:00
api-shared [tests] Build the native test library for macOS and create a binding project for it. (#3373) 2018-02-02 11:14:44 +01:00
apitest [apitest] Add 'BusinessChat' to the list of 64-bit only libraries. (#3990) 2018-04-25 18:25:19 +02:00
bcl-test [runtime] integrate mono 2018-02 (#3402) 2018-04-25 13:56:37 -04:00
bindings-framework-test Merge xcode9 into d15-4[-xi] (#2710) 2017-09-15 17:53:16 -04:00
bindings-test [tests] Determine at runtime instead of compile time whether LinkAll is enabled. Fixes #3812. (#4004) 2018-04-27 13:11:27 +02:00
bindings-test2 [xharness] Fix project cloning to understand how to build test-libraries. (#2417) 2017-08-03 14:29:14 +02:00
common Bump mono to head of 2018-02 + fix mtouch/mmp (#4171) 2018-06-04 19:44:40 -04:00
framework-test [tests] Enable LLVM for all Release|Device configurations. (#3376) 2018-02-01 17:59:40 +01:00
fsharp [tests] Don't try to compile the Main function in F# extensions. (#3683) 2018-03-07 22:13:13 +01:00
fsharplibrary [tests] Add support for building device tests for 32-bit or 64-bit. 2016-10-11 19:52:36 +02:00
generator Teach bmac to handle reletive references, in particular -r:System.Drawing (#4028) 2018-05-04 11:02:39 -05:00
interdependent-binding-projects [tests] Change ProjectGuid of a few projects to make sure they're unique. (#1943) 2017-03-30 14:33:26 +02:00
introspection [tests] Add introspection tests to ensure there are native linking instructions for all frameworks. Fixes #3976 (#4194) 2018-06-08 10:00:48 -07:00
linker [tests] Adjust SetupBlockPerfTest to expect at least a 6x speedup instead of 8x. Fixes maccore #649. (#4006) 2018-04-27 11:58:09 -04:00
mac-binding-project [tests] Unset XCODE_DEVELOPER_DIR_PATH when building mac binding projects. (#2776) 2017-09-27 10:48:51 +02:00
mini Bump mono to head of 2018-02 (#4118) 2018-05-24 08:40:21 -04:00
misc [tests] Import 2016-05-26 15:06:52 +02:00
mmptest [runtime] integrate mono 2018-02 (#3402) 2018-04-25 13:56:37 -04:00
monotouch-test [Compression] Ensure we use the correct linking flags for older versions. Fixes #4129. (#4169) 2018-06-05 09:12:27 -07:00
msbuild-mac [tests] Make the msbuild-mac tests a normal NUnit test project. (#4042) 2018-05-08 07:35:42 +02:00
mtouch [tests] Fix MT4134 test to take into account frameworks introduced in iOS 11.4. (#4242) 2018-06-13 22:08:56 -07:00
no-mmp Remove more usage of mcs across the build and tests (#3815) 2018-04-18 11:17:00 +02:00
qa-regression [tests] Import 2016-05-26 15:06:52 +02:00
scripted Remove more usage of mcs across the build and tests (#3815) 2018-04-18 11:17:00 +02:00
scriptingbridge Remove more usage of mcs across the build and tests (#3815) 2018-04-18 11:17:00 +02:00
templates [runtime] integrate mono 2018-02 (#3402) 2018-04-25 13:56:37 -04:00
test-libraries [runtime] Don't throw exceptions when checking if a token reference exists (and not finding any). Fixes #3830. (#3995) 2018-04-27 11:33:33 +02:00
xammac_tests [Compression] Add compression framework bindings. (#3942) 2018-05-11 15:54:31 -04:00
xharness [xharness] Check the right (unpaired) device when determining whether a new watch device must be created or not. (#4222) 2018-06-12 09:23:11 -07:00
xtro-sharpie Merge branch 'xcode9.4' into master 2018-05-29 14:26:32 -04:00
.gitignore [tests] Convert mmp tests to a standard NUnit test library. (#2067) 2017-05-08 13:20:01 +02:00
HtmlTransform.xslt [tests] Move HtmlTransform.xslt here from maccore. (#16) 2016-04-28 15:07:26 -04:00
Makefile [xharness] Trace exceptions to have better information when something goes very wrong. (#4145) 2018-05-29 09:27:26 -04:00
README.md [tests] Update README. (#1207) 2016-11-17 14:18:39 +01:00
common.mk Remove more usage of mcs across the build and tests (#3815) 2018-04-18 11:17:00 +02:00
package-mac-tests.sh [tests] Move linker tests to match introspection directory layout. (#3365) 2018-02-05 15:09:04 +01: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] Move linker tests to match introspection directory layout. (#3365) 2018-02-05 15:09:04 +01:00
tests.sln [build] Remove MT.D source build and replace it with a binary (#3957) 2018-04-23 13:08:58 -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 Xamairn.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...)

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.