Jelajahi Sumber

[unit test] should report result in checkDone or else the async tests will be ignored...

Andy Li 10 tahun lalu
induk
melakukan
082467d75a
1 mengubah file dengan 14 tambahan dan 14 penghapusan
  1. 14 14
      tests/unit/src/unit/Test.hx

+ 14 - 14
tests/unit/src/unit/Test.hx

@@ -219,6 +219,20 @@ class Test {
 		if( asyncWaits.length != 0 ) return;
 		if( asyncCache.length == 0 ) {
 			report("DONE ["+count+" tests]");
+			trace("SUCCESS: " + success);
+
+			//out.close();
+
+			#if js
+			if (js.Browser.supported) {
+				untyped js.Browser.window.success = success;
+			}
+			#end
+
+			#if sys
+			Sys.exit(success ? 0 : 1);
+			#end
+
 			return;
 		}
 		resetTimer();
@@ -389,20 +403,6 @@ class Test {
 			onError(e,"ABORTED",Type.getClassName(current));
 		}
 		#end
-
-		trace("SUCCESS: " + success);
-
-		//out.close();
-
-		#if js
-		if (js.Browser.supported) {
-			untyped js.Browser.window.success = success;
-		}
-		#end
-
-		#if sys
-		Sys.exit(success ? 0 : 1);
-		#end
 	}
 
 }