2
0
Эх сурвалжийг харах

TravisCI: test as3, in allow_failures.

Andy Li 11 жил өмнө
parent
commit
cadd3cab2c
2 өөрчлөгдсөн 19 нэмэгдсэн , 16 устгасан
  1. 2 1
      .travis.yml
  2. 17 15
      tests/unit/RunTravis.hx

+ 2 - 1
.travis.yml

@@ -3,6 +3,7 @@ language: node_js
 env:
   - TARGET=flash9
   - TARGET=flash8
+  - TARGET=as3
   - TARGET=neko
   - TARGET=macro
   - TARGET=php
@@ -10,11 +11,11 @@ env:
   - TARGET=js
   - TARGET=java
   - TARGET=cs
-  # - TARGET=as3
 
 matrix:
   allow_failures:
     - env: TARGET=flash8
+    - env: TARGET=as3
     - env: TARGET=java
     - env: TARGET=cs
 

+ 17 - 15
tests/unit/RunTravis.hx

@@ -30,10 +30,9 @@ class RunTravis {
 		//wait a little until flashlog.txt is created
 		var flashlogPath = Sys.getEnv("HOME") + "/.macromedia/Flash_Player/Logs/flashlog.txt";
 		for (t in 0...5) {
+			runProcess("sleep", ["2"]);
 			if (FileSystem.exists(flashlogPath))
-				break;
-			else
-				runProcess("sleep", ["2"]); 
+				break;				
 		}				
 		if (!FileSystem.exists(flashlogPath)) {
 			//the flashplayerdebugger should has already exited with some error...
@@ -108,19 +107,22 @@ class RunTravis {
 				setupFlashPlayerDebugger();
 				runProcess("haxe", ["compile-flash8.hxml", "-D", "fdb"]);
 				runFlash(new Process("./flashplayerdebugger", ["unit8.swf"]));
-			// case "as3":
-			// 	//install Apache Flex
-			// 	//see https://cwiki.apache.org/confluence/display/FLEX/1.3+Setting+up+Linux+(if+having+trouble)
-			// 	runProcess("sudo", ["apt-get", "install", "ia32-libs", "-y"]); //AIR is 32-bit only
-			// 	runProcess("wget", ["http://update.devolo.com/linux/apt/pool/main/a/adobeair/adobeair_2.6.0.19170_amd64.deb"]);
-			// 	runProcess("sudo", ["dpkg", "-i", "adobeair_2.6.0.19170_amd64.deb"]);
-			// 	runProcess("wget", ["http://apache.communilink.net/flex/installer/2.7/binaries/apache-flex-sdk-installer-2.7.0-bin.deb"]);
-			// 	runProcess("sudo", ["dpkg", "-i", "--force-depends", "apache-flex-sdk-installer-2.7.0-bin.deb"]);
-			// 	Sys.setCwd("/opt/Apache Flex/Apache Flex SDK Installer/bin");
-			// 	runProcess("./Apache Flex SDK Installer", []);
-			// 	Sys.setCwd(cwd);
+			case "as3":
+				setupFlashPlayerDebugger();
+
+				//setup flex sdk
+				runProcess("wget", ["http://apache.communilink.net/flex/4.11.0/binaries/apache-flex-sdk-4.11.0-bin.tar.gz"]);
+				runProcess("tar", ["-xvf", "apache-flex-sdk-4.11.0-bin.tar.gz", "-C", Sys.getEnv("HOME")]);
+				var flexsdkPath = Sys.getEnv("HOME") + "/apache-flex-sdk-4.11.0-bin";
+				Sys.putEnv("PATH", Sys.getEnv("PATH") + ":" + flexsdkPath + "/bin");
+				var playerglobalswcFolder = flexsdkPath + "/player";
+				FileSystem.createDirectory(playerglobalswcFolder + "/11.1");
+				runProcess("wget", ["-nv", "http://download.macromedia.com/get/flashplayer/updaters/11/playerglobal11_1.swc", "-O", playerglobalswcFolder + "/11.1/playerglobal.swc"]);
+				File.saveContent(flexsdkPath + "/env.properties", 'env.PLAYERGLOBAL_HOME=$playerglobalswcFolder');
+				runProcess("mxmlc", ["--version"]);
 
-			// 	runProcess("sudo", ["apt-get", "install", "flashplugin-installer", "-y"]);
+				runProcess("haxe", ["compile-as3.hxml", "-D", "fdb"]);
+				runFlash(new Process("./flashplayerdebugger", ["unit9_as3.swf"]));
 			case target:
 				throw "unknown target: " + target;
 		}