xamarin-macios/tests
Rolf Bjarne Kvinge dbd247ed38
[NSLayoutManager] Complete bindings for NSLayoutManager. Fixes #4740. (#4853)
Fix numerous issues with NSLayoutManager[Delegate]:

* The classes are available in both AppKit and UIKit, but the bindings are
  duplicated (unsuccessfully) in both appkit.cs and uikit.cs. So create a new
  xkit.cs that is shared between XI and XM, and put a shared version of the
  bindings there.

* Bind everything that hasn't already been bound (or deprecated by Apple).

* Methods that take a nullable NSRangePointer has been bound with three overloads:

	* A protected overridable (exported) method that uses IntPtr.
	* A public method without the parameter.
	* A public method with the parameter typed as 'ref NSRange'.

	This makes sure the native method can be overridden if needed, while at
	the same time making it possible to call without providing the nullable
	parameter.

* Fix numerous ugly bindings:

	* There's a great nint/nuint confusion for parameters referring to
	  'character index' and 'glyph index'. XI seems to prefer nuint, while XM
	  seems to prefer nint. Standardize on nuint, since that's how Apple
	  created them.

	* Many methods have names than sound like Objective-C. Fix them all,
	  either right away when possible, or for XAMCORE_4_0.

	* Several parameter names have been modified to comply with our naming
	  guidelines (no abbreviations).

Fixes https://github.com/xamarin/xamarin-macios/issues/4740.
2019-01-29 15:37:48 -05:00
..
BundledResources
EmbeddedResources
api-shared [registrar] Improve error message when failing to create a managed wrapper for a native handle. (#4360) 2018-06-29 14:38:28 +02:00
apitest Merge xcode10.1 into d15-9 (#5063) 2018-10-31 17:30:44 -04:00
bcl-test Merge branch 'd15-8' into xcode10-rebase-15.8 2018-08-13 21:04:56 -04:00
bindings-framework-test Merge xcode9 into d15-4[-xi] (#2710) 2017-09-15 17:53:16 -04:00
bindings-test [runtime] Always release blocks on the main thread. Fixes #4130. (#4312) 2018-06-29 10:42:25 +02:00
bindings-test2
common [UIKit] Update bindings to Xcode 10.2 Beta 1 (#5475) 2019-01-25 13:01:07 -05: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
generator Merge branch 'd15-8' into xcode10-rebase-15.8 2018-08-13 21:04:56 -04:00
interdependent-binding-projects
introspection [passkit] Update for xcode 10.2 beta 1 (#5498) 2019-01-28 16:08:18 -05:00
linker Merge branch 'xcode10' into d15-9-merge-xcode10 2018-09-14 12:53:17 -04:00
mac-binding-project Revert "Bump tests minimum version from 10.7 to 10.9" 2018-07-25 11:55:58 +02:00
mini Bump mono to head of 2018-02 (#4118) 2018-05-24 08:40:21 -04:00
misc
mmptest [macos][msbuild] Cache actool results like XI (#4892) (#4915) 2018-10-04 09:44:22 -04:00
monotouch-test [NSLayoutManager] Complete bindings for NSLayoutManager. Fixes #4740. (#4853) 2019-01-29 15:37:48 -05: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][mtouch] SimlauncherSymbols issues (#5482) 2019-01-25 15:27:02 -05:00
no-mmp Remove more usage of mcs across the build and tests (#3815) 2018-04-18 11:17:00 +02:00
qa-regression Revert "Bump tests minimum version from 10.7 to 10.9" 2018-07-25 11:55:58 +02:00
scripted Remove more usage of mcs across the build and tests (#3815) 2018-04-18 11:17:00 +02:00
scriptingbridge Revert "Bump tests minimum version from 10.7 to 10.9" 2018-07-25 11:55:58 +02:00
templates [runtime] integrate mono 2018-02 (#3402) 2018-04-25 13:56:37 -04:00
test-libraries Merge branch 'xcode10' into d15-9-merge-xcode10 2018-09-14 12:53:17 -04:00
xammac_tests Merge branch 'd15-8' into xcode10-rebase-15.8 2018-08-13 21:04:56 -04:00
xharness [xharness] Detect another scenario where failing to pair devices, and try again with a new watch device. Fixes maccore#961. (#4702) 2018-08-28 07:41:22 +02:00
xtro-sharpie [NSLayoutManager] Complete bindings for NSLayoutManager. Fixes #4740. (#4853) 2019-01-29 15:37:48 -05:00
.gitignore
HtmlTransform.xslt
Makefile [tests] Ignore 32-bit mac tests when running on internal Jenkins. (#4267) 2018-06-15 12:23:38 +02:00
README.md
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 Bundle Make.version with the packaged XM tests to fix testing. (#4946) 2018-10-09 09:26:15 -04:00
test-dependencies.sh
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.