Prechádzať zdrojové kódy

[TravisCI] enable hl/jit test

Andy Li 7 rokov pred
rodič
commit
ac041b4d55

+ 2 - 2
.travis.yml

@@ -167,7 +167,7 @@ matrix:
 
     - os: linux
       env:
-        - TEST=macro,js,php,flash9,as3,java,cs,python,lua
+        - TEST=macro,hl,js,php,flash9,as3,java,cs,python,lua
         - SAUCE=1
       addons:
         sauce_connect: true
@@ -198,7 +198,7 @@ matrix:
     - os: osx
       osx_image: xcode9.1 # to compile faster
       env:
-        - TEST=macro,java,cs,lua,js,php,flash9,python
+        - TEST=macro,hl,java,cs,lua,js,php,flash9,python
       install: *install_osx
 
     - os: osx

+ 1 - 1
appveyor.yml

@@ -14,7 +14,7 @@ environment:
           secure: ewwkKcjnSKl/Vtrz1SXmI6XKk1ENmJDyzm5YaR2wi03foRhTke29TvymB21rDTSl
     matrix:
         - ARCH: 64
-          TEST: "neko,python,cs,java,php,macro"
+          TEST: "neko,hl,python,cs,java,php,macro"
           DEPLOY_NIGHTLIES: 1
         - ARCH: 64
           TEST: "cpp"

+ 1 - 1
tests/RunCi.hx

@@ -79,7 +79,7 @@ class RunCi {
 					case As3:
 						runci.targets.As3.run(args);
 					case Hl:
-						runCommand("haxe", ["compile-hl.hxml"]);
+						runci.targets.Hl.run(args);
 					case t:
 						throw "unknown target: " + t;
 				}

+ 57 - 0
tests/runci/targets/Hl.hx

@@ -0,0 +1,57 @@
+package runci.targets;
+
+import haxe.io.Path;
+import sys.FileSystem;
+import runci.System.*;
+import runci.Config.*;
+
+class Hl {
+    static public function getHlDependencies() {
+        if (commandSucceed("hl", ["--version"])) {
+            infoMsg('hl has already been installed.');
+            return;
+        }
+        switch (systemName) {
+            case "Linux":
+                Linux.requireAptPackages(["libpng-dev", "libjpeg-turbo8-dev", "libturbojpeg", "zlib1g-dev", "libvorbis-dev"]);
+            case "Mac":
+                runCommand("brew", ["install", "libpng", "jpeg-turbo", "libvorbis"], true);
+            case "Windows":
+                //pass
+        }
+        var hlSrc = Path.join([Sys.getEnv("HOME"), "hashlink"]);
+        runCommand("git", ["clone", "https://github.com/HaxeFoundation/hashlink.git", hlSrc]);
+        var hlBuild = Path.join([Sys.getEnv("HOME"), "hashlink_build"]);
+        FileSystem.createDirectory(hlBuild);
+        runCommand("cmake", [
+            "-GNinja",
+            "-DBUILD_TESTING=OFF",
+            "-DWITH_BULLET=OFF",
+            "-DWITH_DIRECTX=OFF",
+            "-DWITH_FMT=ON",
+            "-DWITH_OPENAL=OFF",
+            "-DWITH_SDL=OFF",
+            "-DWITH_SQLITE=OFF",
+            "-DWITH_SSL=OFF",
+            "-DWITH_UI=OFF",
+            "-DWITH_UV=OFF",
+            "-DWITH_VIDEO=OFF",
+            "-B" + hlBuild,
+            "-H" + hlSrc
+        ]);
+        runCommand("cmake", [
+            "--build", hlBuild
+        ]);
+        
+        addToPATH(Path.join([hlBuild, "bin"]));
+        runCommand("hl", ["--version"]);
+    }
+
+    static public function run(args:Array<String>) {
+        getHlDependencies();
+        runCommand("haxe", ["compile-hl.hxml"].concat(args));
+        runCommand("hl", ["bin/unit.hl"]);
+
+        // TODO sys test
+    }
+}

+ 8 - 6
tests/unit/src/unit/issues/Issue6560.hx

@@ -1,12 +1,14 @@
 package unit.issues;
 
 class Issue6560 extends unit.Test {
-	function test() {
+    #if !hl
+    function test() {
         function foo<F>(a:F):Array<F> {
-			if (false) foo(1);
+            if (false) foo(1);
             return if (a == null) [] else foo(null);
-		}
-		var bar:Array<Int> = foo(1);
-		eq(0, bar.length);
-	}
+        }
+        var bar:Array<Int> = foo(1);
+        eq(0, bar.length);
+    }
+    #end
 }