Ver Fonte

Merge pull request #2404 from andyli/travis

TravisCI: test js/java/cs
Simon Krajewski há 11 anos atrás
pai
commit
441d6a3e90
2 ficheiros alterados com 23 adições e 6 exclusões
  1. 7 6
      .travis.yml
  2. 16 0
      tests/unit/RunTravis.hx

+ 7 - 6
.travis.yml

@@ -5,16 +5,17 @@ env:
   - TARGET=macro
   - TARGET=php
   - TARGET=cpp
+  - TARGET=js
+  - TARGET=java
+  - TARGET=cs
   # - TARGET=flash8
   # - TARGET=flash9
-  # - TARGET=js
   # - TARGET=as3
-  # - TARGET=java
-  # - TARGET=cs
 
-# matrix:
-#   allow_failures:
-#     - env: TARGET=php
+matrix:
+  allow_failures:
+    - env: TARGET=java
+    - env: TARGET=cs
 
 before_install:
   - sudo apt-get install ocaml zlib1g-dev libgc-dev -y

+ 16 - 0
tests/unit/RunTravis.hx

@@ -38,6 +38,22 @@ class RunTravis {
 				
 				runProcess("haxe", ["compile-cpp.hxml"]);
 				runProcess("./cpp/Test-debug", []);
+			case "js":
+				runProcess("haxe", ["compile-js.hxml"]);
+				runProcess("node", ["-e", "var unit = require('./unit.js').unit; unit.Test.main(); process.exit(unit.Test.success ? 0 : 1);"]);
+			case "java":
+				runProcess("haxelib", ["git", "hxjava", "https://github.com/HaxeFoundation/hxjava.git"]);
+				runProcess("haxe", ["compile-java.hxml"]);
+				runProcess("java", ["-jar", "java/java.jar"]);
+			case "cs":
+				runProcess("sudo", ["apt-get", "install", "mono-devel", "mono-mcs", "-y"]);
+				runProcess("haxelib", ["git", "hxcs", "https://github.com/HaxeFoundation/hxcs.git"]);
+				
+				runProcess("haxe", ["compile-cs.hxml"]);
+				runProcess("mono", ["cs/bin/Test-Debug.exe"]);
+
+				runProcess("haxe", ["compile-cs-unsafe.hxml"]);
+				runProcess("mono", ["cs_unsafe/bin/Test-Debug.exe"]);
 			case target:
 				throw "unknown target: " + target;
 		}