Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop hxml script in case of fail? #178

Open
CrazyFlasher opened this issue Oct 31, 2019 · 2 comments
Open

Stop hxml script in case of fail? #178

CrazyFlasher opened this issue Oct 31, 2019 · 2 comments
Labels

Comments

@CrazyFlasher
Copy link

Hi,
Is it possible?
Simple script

-cmd haxelib run munit test test.hxml --verbose
-cmd haxelib run dox -i build -o docs -in "^com\."

In case of 1st line fails, I want script to stop.
Possible?

@CrazyFlasher
Copy link
Author

I am running test with nodejs.
I modified completionHandler and now it works OK for me. But may be I did it bad way?

function completionHandler(successful:Bool):Void
	{
		try
		{
			#if flash
				flash.external.ExternalInterface.call("testResult", successful);
			#elseif js
//				js.Lib.eval("testResult(" + successful + ");");
				Sys.exit(successful ? 0 : 1);
			#elseif sys
				Sys.exit(successful ? 0 : 1);
			#end
		}
			// if run from outside browser can get error which we can ignore
		catch (e:Dynamic)
		{
		}
	}

@elsassph
Copy link
Contributor

elsassph commented Nov 3, 2019

Hmm you're probably right - this call to testResult for JS only works in the browser.

@elsassph elsassph added the Bug label Nov 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants