Jelajahi Sumber

TravisCI: show commands and their exit code.

Andy Li 11 tahun lalu
induk
melakukan
ce8aa9fea1
2 mengubah file dengan 11 tambahan dan 9 penghapusan
  1. 0 1
      .travis.yml
  2. 11 8
      tests/unit/RunTravis.hx

+ 0 - 1
.travis.yml

@@ -13,7 +13,6 @@ env:
   # - TARGET=cs
 
 matrix:
-  fast_finish: true
   allow_failures:
     - TARGET=php
 

+ 11 - 8
tests/unit/RunTravis.hx

@@ -1,10 +1,13 @@
 import sys.io.Process;
 
 class RunTravis {
-	static function runProcess(p:Process):Void {
+	static function runProcess(cmd:String, args:Array<String>):Void {
+		var p = new Process(cmd, args);
 		Sys.println(p.stdout.readAll().toString());
+		var exitCode = p.exitCode();
+		Sys.println('Process exited with $exitCode: $cmd $args');
 
-		if (p.exitCode() != 0) {
+		if (exitCode != 0) {
 			Sys.exit(1);
 		}
 	}
@@ -12,14 +15,14 @@ class RunTravis {
 	static function main():Void {
 		switch (Sys.getEnv("TARGET")) {
 			case "macro":
-				runProcess(new Process("haxe", ["compile-macro.hxml"]));
+				runProcess("haxe", ["compile-macro.hxml"]);
 			case "neko":
-				runProcess(new Process("haxe", ["compile-neko.hxml"]));
-				runProcess(new Process("neko", ["unit.n"]));
+				runProcess("haxe", ["compile-neko.hxml"]);
+				runProcess("neko", ["unit.n"]);
 			case "php":
-				runProcess(new Process("sudo", ["apt-get", "install", "php", "-y"]));
-				runProcess(new Process("haxe", ["compile-php.hxml"]));
-				runProcess(new Process("php", ["php/index.php"]));
+				runProcess("sudo", ["apt-get", "install", "php", "-y"]);
+				runProcess("haxe", ["compile-php.hxml"]);
+				runProcess("php", ["php/index.php"]);
 			case target:
 				throw "unknown target: " + target;
 		}