We have a number of test suites, which are placed in their own folders in this directory.
"RunCi.hx" is the script used by our CIs to run all the test suites.
It is possible to run it in local machines too:
- Change to this directory.
- Define the test target by
export TEST=$TARGET
(orset "TEST=$TARGET"
on Windows), where$TARGET
should be a comma-seperated list of targets, e.g.neko,macro
. Possible targets aremacro
,neko
,js
,lua
,php
,cpp
,cppia
,flash9
,java
,jvm
,cs
,python
, andhl
. - Run the script:
haxe RunCi.hxml
.
Note that the script will try to look for test dependencies and install them if they are not found. Look at the getXXXDependencies
functions for the details.
The "unit" folder contains a set of unit tests for the Haxe std library. Unit tests can be run separately instead of using "RunCi.hx", which runs all test suites.
Assuming all test dependencies has been installed, we compile and run the unit tests for all targets at once as follows:
- Change to the "unit" directory.
- Compile:
haxe compile.hxml
. - Start a dev server:
nekotools server
. - Open http://localhost:2000/unit.html in your browser.
Cpp unit tests are compiled with -D HXCPP_NO_DEBUG_LINK
(removes debug symbols) to speed up compilation times. You can remove this from compile-cpp.hxml
to be able to open the generated Test-debug.exe
in Visual Studio and debug it. This is useful if it's difficult to figure out why a test is failing, or also which test is failing (for instance with a segmentation fault).
The "sys" folder contains tests for the system targets. It can also be run separately instead of using "RunCi.hx".
Assuming all test dependencies has been installed, we compile and run the sys tests for all targets at once as follows:
- Change to the "sys" directory.
- If you're on Windows, comment out the relevant lines in "run.hxml".
haxe run.hxml
.