=======================
An implementation of sbt's test interface for haXe unit test. This allows you to run haXe unit tests from sbt.
Step 1: Install sbt-haxe
You shoud first Install sbt-haxe
. Just follow the guilds in https://github.com/qifun/sbt-haxe to install sbt-haxe
.
Add the following line to your build.sbt
:
libraryDependencies += "com.qifun.sbt-haxe" %% "test-interface" % "0.1.1" % Test
haxeOptions in Test ++= Seq("--macro", "exclude('haxe.unit')")
haxeOptions in Test ++= Seq("-dce", "no")
package yourPackage;
import haxe.unit.TestCase;
class YourHaxeClassTest extends TestCase
{
public function testYourClass()
{
assertTrue(true);
}
}
$ sbt
[info] Loading global plugins from C:\Users\Dennis.Deng\.sbt\0.13\staging\b479b818d45e59945587\sbteclipse\project
[info] Loading global plugins from C:\Users\Dennis.Deng\.sbt\0.13\plugins
[info] Loading project definition from D:\workspace\test\project\sbt-haxe\project
[info] Loading project definition from D:\workspace\test\project
[info] Set current project to test (in build file:/D:/workspace/test/)
> test
[info] Passed: Total 1, Failed 0, Errors 0, Passed 1
[success] Total time: 0 s, completed 2014-11-6 19:12:47
>
Use the --tests
flag to select the unit tests you need to test. For example, just edit the following lines and then add it to your project's build.sbt
:
testOptions += Tests.Argument(com.qifun.sbtHaxe.HaxePlugin.HaxeUnit, "--tests=<<Your Unit Test Class Name Regex>>")