Runs utest tests associated with an OpenFL project. Detects classes that extend utest.Test
and automatically generates a runner for them.
This library is not yet available on Haxelib, so you'll need to install it and its dependencies from Github.
haxelib git openfl-utest-tools https://github.com/feathersui/openfl-utest-tools.git
Create a directory named tests in the same parent directory as your OpenFL project.xml file. This will be the class path for your tests.
Run the following command in a terminal.
haxelib run openfl-utest-tools test neko
The command above runs the tests using the neko
target. Other OpenFL targets are supported, including html5
, windows
, mac
, linux
, and hl
.
When running tests on the html5
target, Node.js is required. The Playwright npm module is used to run tests in Chromium, Firefox, and WebKit.
test
builds and runs tests. Thetest
command has a few optional parameters.--source
sets a custom source path for the tests. Default: tests--project
sets a custom path to the OpenFL project file. Default: project.xml--include
sets a custom glob pattern for test files to include. Default: **/*.hx--exclude
sets an optional glob pattern for test files to exclude.--verbose
displays more detailed output.
help
displays help about the available commands.