Skip to content

Commit 3ab13bf

Browse files
authored
Merge pull request #12 from airext/feature/ci-tests
Improves test failure description.
2 parents d00f6b0 + 80fdb12 commit 3ab13bf

File tree

3 files changed

+24
-6
lines changed

3 files changed

+24
-6
lines changed

build/build.xml

+14-1
Original file line numberDiff line numberDiff line change
@@ -475,14 +475,27 @@
475475
<arg line="OpenSSLTests.app" />
476476
<arg line="Main-app.xml" />
477477
<arg line="Main.swf" />
478-
<arg line="-C assets " />
478+
<arg line="-C assets ." />
479479
<arg line="-extdir extensions" />
480480
</java>
481481

482482
<exec executable="open" dir="flash">
483483
<arg line="-a OpenSSLTests.app" />
484484
</exec>
485485

486+
<waitfor maxwait="2" maxwaitunit="minute">
487+
<or>
488+
<available file="tests/tests_success.txt" />
489+
<available file="tests/tests_failure.txt" />
490+
</or>
491+
</waitfor>
492+
493+
<fail>
494+
<condition>
495+
<available file="tests/tests_failure.txt" />
496+
</condition>
497+
</fail>
498+
486499
</target>
487500

488501

openssl-air/openssl-tests-flex/src/TestRunner.as

+5-4
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,14 @@
44
package {
55
import com.github.airext.flexunit.listener.CIFileListener;
66
import com.github.airext.openssl.test.Tests;
7+
import com.github.airext.openssl.test.suite.rsa.TestSuiteRSA;
78

89
import flash.display.Sprite;
910
import flash.events.UncaughtErrorEvent;
1011
import flash.text.TextField;
1112

1213
import org.flexunit.internals.TraceListener;
13-
import org.flexunit.listeners.VisualDebuggerListener;
1414
import org.flexunit.runner.FlexUnitCore;
15-
import org.flexunit.runner.notification.RunListener;
1615

1716
public class TestRunner extends Sprite {
1817

@@ -22,14 +21,14 @@ public class TestRunner extends Sprite {
2221
super();
2322

2423
var handler: Function = function(message: String): void {
24+
trace(message);
2525
tf.text += message + "\n";
2626
};
2727

2828
core = new FlexUnitCore();
2929

3030
core.addListener(new CIFileListener(handler));
3131
core.addListener(new TraceListener());
32-
core.addListener(new RunListener());
3332

3433
core.run(Tests);
3534

@@ -40,7 +39,9 @@ public class TestRunner extends Sprite {
4039
tf.height = stage.stageHeight;
4140
addChild(tf);
4241

43-
tf.text += "Tests started";
42+
tf.text += "Tests started\n";
43+
44+
tf.text += "TestSuiteRSA: " + TestSuiteRSA + "\n";
4445

4546
loaderInfo.uncaughtErrorEvents.addEventListener(UncaughtErrorEvent.UNCAUGHT_ERROR, function(event: UncaughtErrorEvent): void {
4647
tf.text += event.error + "\n";

openssl-air/openssl-tests-flex/src/com/github/airext/flexunit/listener/CIFileListener.as

+5-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import flash.filesystem.File;
1010
import flash.filesystem.FileMode;
1111
import flash.filesystem.FileStream;
1212

13+
import org.flexunit.experimental.theories.internals.ParameterizedAssertionError;
14+
1315
import org.flexunit.runner.IDescription;
1416
import org.flexunit.runner.Result;
1517
import org.flexunit.runner.notification.Failure;
@@ -74,7 +76,9 @@ public class CIFileListener extends EventDispatcher implements IAsyncCompletionR
7476
} else {
7577
var failureContent: String = "";
7678
for each (var failure: Failure in result.failures) {
77-
failureContent += failure.message + "\n";
79+
failureContent += failure.testHeader + "\n";
80+
failureContent += "\t" + failure.message + "\n";
81+
failureContent += "\t\t" + (failure.exception is ParameterizedAssertionError ? ParameterizedAssertionError(failure.exception).targetException.message : failure.exception.message) + "\n";
7882
}
7983
writeToFailureResultFile(failureContent);
8084
}

0 commit comments

Comments
 (0)