W3cubDocs

/Haxe

TestRunner

package haxe.unit

Available on all platforms

This class runs unit test cases and prints the result.

var r = new haxe.unit.TestRunner();
r.add(new MyTestCase());
// add other TestCases here

// finally, run the tests
r.run();

See:

Constructor

new ()

Variables

read only result:TestResult

The unit test results. Available after the run() is called.

Methods

add (c:TestCase):Void

Add TestCase instances to the unit test.

run ():Bool

Runs the unit tests and prints the results.

Returns:

true if the unit test succesfully executed the test cases.

Static methods

@:has_untyped static dynamic print (v:Dynamic):Void

Prints the given object/value.

Flash outputs the result in a new TextField on stage. JavaScript outputs the result using console.log. Other targets use native print to output the result.

	This function is `dynamic` so it can be overriden in custom setups.

© 2005–2018 Haxe Foundation
Licensed under a MIT license.
https://api.haxe.org/haxe/unit/TestRunner.html