Skip to content

Commit

Permalink
Merge branch 'leanDebugTests' of https://github.com/thomasuster/Massi…
Browse files Browse the repository at this point in the history
…veUnit

Conflicts:
	src/massive/munit/TestRunner.hx
  • Loading branch information
mikestead committed Aug 3, 2013
2 parents d5c141e + 4f774f7 commit 34fdb4a
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/massive/munit/TestRunner.hx
Expand Up @@ -263,7 +263,7 @@ class TestRunner implements IAsyncDelegateObserver
{
if(Std.is(client, IAdvancedTestResultClient))
{
var cl : IAdvancedTestResultClient = cast client;
var cl:IAdvancedTestResultClient = cast client;
cl.setCurrentTestClass(null);
}
client.reportFinalStatistics(testCount, passCount, failCount, errorCount, ignoreCount, time);
Expand All @@ -277,8 +277,11 @@ class TestRunner implements IAsyncDelegateObserver
{
if(Std.is(c, IAdvancedTestResultClient))
{
var cl : IAdvancedTestResultClient = cast c;
cl.setCurrentTestClass(activeHelper.className);
if (activeHelper.hasNext())
{
var cl:IAdvancedTestResultClient = cast c;
cl.setCurrentTestClass(activeHelper.className);
}
}
}
for (testCaseData in activeHelper)
Expand Down
36 changes: 36 additions & 0 deletions test/massive/munit/DebuglessTestClassStub.hx
@@ -0,0 +1,36 @@
/**************************************** ****************************************
* Copyright 2010 Massive Interactive. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY MASSIVE INTERACTIVE ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL MASSIVE INTERACTIVE OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of Massive Interactive.
*/

package massive.munit;
class DebuglessTestClassStub {

public function new() {}

@Test
public function isNotExploding():Void {}
}
37 changes: 37 additions & 0 deletions test/massive/munit/DebuglessTestSuiteStub.hx
@@ -0,0 +1,37 @@
/**************************************** ****************************************
* Copyright 2010 Massive Interactive. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY MASSIVE INTERACTIVE ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL MASSIVE INTERACTIVE OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of Massive Interactive.
*/

package massive.munit;
class DebuglessTestSuiteStub extends massive.munit.TestSuite
{
public function new()
{
super();
add(DebuglessTestClassStub);
}
}
14 changes: 14 additions & 0 deletions test/massive/munit/TestRunnerTest.hx
Expand Up @@ -112,6 +112,20 @@ class TestRunnerTest
runner.debug(suites);
}

@AsyncTest
public function noDebugTestsDuringDebugShouldNotRun(factory:AsyncFactory):Void
{
var suites = new Array<Class<massive.munit.TestSuite>>();

suites.push(DebuglessTestSuiteStub);
runner.completionHandler = factory.createHandler(this, debugCompletetionHandler, 5000);
runner.debug(suites);
}

private function debugCompletetionHandler(isSuccessful:Bool):Void {
Assert.areEqual(0, client.testClasses.length);
}

@AsyncTest
public function testAsyncAssertionTests(factory:AsyncFactory):Void
{
Expand Down

0 comments on commit 34fdb4a

Please sign in to comment.