Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Compiling and running tests
The test command is the main command used when developing with unit tests to updates, compiles and runs all targets within a hxml build file
haxelib run munit test
What it does
- Updates active test cases using the gen command
- Compiles the targets within the hxml build file
- Runs all compiled targets using the run command
By default this command uses the settings from the .munit settings in the project so you don't need to specify anything.
Alternatively you can specify a single target within the build file through a -[platform] flag. Valid options are -swf-neko and -js. If testing both flash 8 and flash 9+ targets you can target one only using -swf8 and -swf9.
haxelib run munit test -swf
To use this command outside a munit project you can also specify manual paths to the hxml, bin, src and report paths you are working with.
Run the inline help for detailed instructions on individual command line options
haxelib run munit help test
The run command launches one or more target applications from a specified path
It matches files ending in _test.swf, _test.js and _test.n
haxelib run munit run
By default this command uses the settings defined in the .munit settings in the project so you don't need to specify anything.
How it works
It saves junit style generated reports into the report directory on completion.
By default munit run uses the default browser to launch swf and js targets
To specify an alternate browser use the -browser flag
haxelib run munit test -browser FireFox
To close the browser window after the tests are finished use the
haxelib run munit test -kill-browser
By default there is a 30s timeout for tests; this duration can be modified using
-timeout <seconds> flag:
haxelib run munit test -timeout 60
When specifying a (valid) custom timeout, munit will print out:
Running tests with <custom timeout> seconds timeout.
There are a number of known platform specific issues that may prevent tests from running correctly.
- Running swf and js tests in Safari
- "Fatal Error in gc" under Windows 7 (possibly XP too)
- HTTP POST causes Nekotools server to hang (fixed in 2.1.2)
See Known Issues for more details