Open tomlarkworthy opened 9 years ago
Ok it was kinda working like that, now just figuring out how to link munit in a non-horrible way
haxe-test-compile/jsTest/tests/TestMain.hx:1: characters 7-39 : Type not found : massive.munit.client.PrintClient
Slowly getting there. A full example would be mind blowingly useful. My tests and JS compile, but the test runner is opening the test window for class MainTest, and not on the generate TestSuite. I don't know how to set the paramaters for the TestRunner
There's sort of an example here: https://github.com/prezi/gradle-haxe-plugin/tree/master/src/test/at, but yeah, the project could definitely use some more documentation. The original plan was to refactor the whole thing when the new Gradle configuration model comes out, but it's still not out. I hear it's not too long now, and then this can be done in a much nicer way. Until then ask away, I'll try to answer what I can.
Hello!
It seems super powerful but quite difficult to get going. The example you link does not include the munit integration.
When I run "./gradlew test" a browser window pops up. Inspecting the console reveals its running my "MainTest", rather than the "TestSuite" generate code. I am trying to get it to run test that I have setup in example.HelloWorld. My config:
haxe {
// Set compiler options here for all platforms
include "example.HelloWorld"
targetPlatforms {
js {
// Set compiler options here for only the JavaScript target
flag "-D js-enabled"
}
}
}
In /build/haxe-test-compile/jsTest/tests/TestSuite.hx
There is a correctly wired up test suite:-
import massive.munit.TestSuite;
import example.HelloWorldTest;
/**
* Auto generated Test Suite for MassiveUnit.
* Refer to munit command line tool for more information (haxelib run munit)
*/
class TestSuite extends massive.munit.TestSuite
{
public function new()
{
super();
add(example.HelloWorldTest);
}
}
I just can't figure out how to tell my gradle build file to run it instead of going for the default "Main" and default "MainTest"
(I have tried a number of main, test, file combinations)
Oh is the intention I put my src files in the same directory as the git repo test project dirs?
ok I started from scratch from the sample project
I can;t compile it becuase I can;t satisfy the following dependancies
dependencies {
jsNode group: "haxelib3", name: "nodejs", version: "2.0.1"
test group: "haxelib3", name: "hamcrest", version: "1.2.1"
test group: "haxelib3", name: "mlib", version: "2.0.2"
test group: "haxelib3", name: "munit", version: "2.1.0"
}
Googling "haxelib3" doesn't reveal anything. Haxelib is the haxe package manager but I am not sure how these dependancies are supposed to satisfied from a gradle environment.
OK I am stuck. I tried putting your example in its own repo, but I can't get it to work. As mentioned above I can;t fullfil the dependancies. I have haxelib installed, but I am not sure what technology to link the repo. Are you using Ivy in some capacity for that??!?
https://github.com/tomlarkworthy/gradle-haxe-plugin-bootstrap
My gradle is
but it does not recognize the haxe {...} command. I am clearly not understanding how to link the plugin into the gradle environment (but there are no instruction on how to do so)