Skip to content

Commit

Permalink
Added stderr output to HaxeWrapper even if exit code is 0, updated te…
Browse files Browse the repository at this point in the history
…sts for munit 0.9.5.x
  • Loading branch information
misprintt committed Aug 21, 2012
1 parent 81ef25d commit afa394b
Show file tree
Hide file tree
Showing 13 changed files with 167 additions and 1,238 deletions.
5 changes: 4 additions & 1 deletion .gitignore
@@ -1,4 +1,7 @@
.svn
haxe/tmp/
report/
bin/
bin/
.DS_Store
.mcover
/mlib.sublime-workspace
2 changes: 2 additions & 0 deletions build.sh
@@ -1,6 +1,8 @@
#!/bin/bash
set -e

mkdir -p bin

#build tool
echo ' build tool src'
cd tool
Expand Down
5 changes: 3 additions & 2 deletions haxe/.munit
@@ -1,5 +1,6 @@
version=0.2.0.116
version=0.9.5.2
src=test
bin=../bin
report=../report/haxe
hxml=test.hxml
hxml=test.hxml
classPaths=src
8 changes: 4 additions & 4 deletions haxe/test.hxml
@@ -1,33 +1,33 @@
# Flash 9+
-main TestMain
-lib munit
-cp test
-cp src
-lib munit
-swf9 ../bin/haxe_test.swf

--next

#Flash 8
-main TestMain
-lib munit
-cp test
-cp src
-lib munit
-swf ../bin/haxe8_test.swf

--next

# JavaScript
-main TestMain
-lib munit
-cp test
-cp src
-lib munit
-js ../bin/haxe_test.js

--next

# Neko
-main TestMain
-lib munit
-cp test
-cp src
-lib munit
-neko ../bin/haxe_test.n
112 changes: 71 additions & 41 deletions haxe/test/TestMain.hx
@@ -1,55 +1,85 @@
/*
Copyright (c) 2012 Massive Interactive
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/

import massive.munit.client.PrintClient;
import massive.munit.client.RichPrintClient;
import massive.munit.client.HTTPClient;
import massive.munit.client.JUnitReportClient;
import massive.munit.client.SummaryReportClient;
import massive.munit.TestRunner;

#if js
import js.Lib;
import js.Dom;
#end


/**
* Auto generated Test Application.
* Auto generated Test Application.
* Refer to munit command line tool for more information (haxelib run munit)
*/
class TestMain
{
static function main(){ new TestMain(); }

public function new()
{
var suites = new Array<Class<massive.munit.TestSuite>>();
suites.push(TestSuite);

#if MCOVER
var client = new mcover.coverage.munit.client.MCoverPrintClient();
var httpClient = new HTTPClient(new mcover.coverage.munit.client.MCoverSummaryReportClient());
#else
var client = new RichPrintClient();
var httpClient = new HTTPClient(new SummaryReportClient());
#end

var runner:TestRunner = new TestRunner(client);
runner.addResultClient(httpClient);
//runner.addResultClient(new HTTPClient(new JUnitReportClient()));

runner.completionHandler = completionHandler;
runner.run(suites);
}

class TestMain
{
static function main(){ new TestMain();}

public function new()
{
var suites = new Array<Class<massive.munit.TestSuite>>();
suites.push(TestSuite);

var runner:TestRunner = new TestRunner(new HTTPClient(new JUnitReportClient(), "http://localhost:2000"));
runner.addResultClient(new PrintClient());
runner.completionHandler = completionHandler;
runner.run(suites);
}

/*
updates the background color and closes the current browser
for flash and html targets (useful for continous integration servers)
*/
private function completionHandler(successful:Bool):Void
{
try
{
#if flash
flash.external.ExternalInterface.call("testResult", successful);
#elseif flash9
flash.external.ExternalInterface.call("testResult", successful);
#elseif js
js.Lib.eval("testResult(" + successful + ");");
#elseif neko
neko.Sys.exit(0);
#end
}
// if run from outside browser can get error which we can ignore
catch (e:Dynamic)
{
}
}
}
/*
updates the background color and closes the current browser
for flash and html targets (useful for continous integration servers)
*/
function completionHandler(successful:Bool):Void
{
try
{
#if flash
flash.external.ExternalInterface.call("testResult", successful);
#elseif js
js.Lib.eval("testResult(" + successful + ");");
#elseif neko
neko.Sys.exit(0);
#end
}
// if run from outside browser can get error which we can ignore
catch (e:Dynamic)
{
}
}
}
2 changes: 1 addition & 1 deletion haxelib.xml
Expand Up @@ -5,5 +5,5 @@
<tag v="haxelib" />
<tag v="massive" />
<description>Lightwieght framework for implementing command line driven haxelib (and neko) tools, and for automating the packaging/management of Haxelib libraries.</description>
<version name="0.4.2">Fix for HaxeWrapper.compile hangs due to stdout buffer limit</version>
<version name="0.4.3">Fix for HaxeWrapper and hxcpp errors (bug in nekovm)</version>
</project>
Binary file modified mlib.n
Binary file not shown.

0 comments on commit afa394b

Please sign in to comment.