瀏覽代碼

[ci] fix incomplete test log for flash & as3

Alexander Kuzmenko 6 年之前
父節點
當前提交
d31f6b1c93
共有 1 個文件被更改,包括 9 次插入8 次删除
  1. 9 8
      tests/runci/targets/Flash.hx

+ 9 - 8
tests/runci/targets/Flash.hx

@@ -27,11 +27,11 @@ class Flash {
 
 		switch (systemName) {
 			case "Linux":
-				Linux.requireAptPackages([
-					"libglib2.0", "libfreetype6"
-				]);
 				var playerCmd = "flashplayerdebugger";
 				if(Sys.command("type", [playerCmd]) != 0) {
+					Linux.requireAptPackages([
+						"libglib2.0", "libfreetype6"
+					]);
 					var majorVersion = getLatestFPVersion()[0];
 					runCommand("wget", ["-nv", 'http://fpdownload.macromedia.com/pub/flashplayer/updaters/${majorVersion}/flash_player_sa_linux_debug.x86_64.tar.gz'], true);
 					runCommand("tar", ["-xf", "flash_player_sa_linux_debug.x86_64.tar.gz", "-C", Sys.getEnv("HOME")]);
@@ -102,19 +102,20 @@ class Flash {
 
 		//read flashlog.txt continously
 		var traceProcess = new Process("tail", ["-f", flashlogPath]);
-		var line = "";
+		var success = false;
 		while (true) {
 			try {
-				line = traceProcess.stdout.readLine();
-				Sys.println(line);
+				var line = traceProcess.stdout.readLine();
 				if (line.indexOf("success: ") >= 0) {
-					return line.indexOf("success: true") >= 0;
+					success = line.indexOf("success: true") >= 0;
+					break;
 				}
 			} catch (e:haxe.io.Eof) {
 				break;
 			}
 		}
-		return false;
+		Sys.command("cat", [flashlogPath]);
+		return success;
 	}
 
 	static public function run(args:Array<String>) {