浏览代码

[php] test minor php versions on Travis

Aleksandr Kuzmenko 6 年之前
父节点
当前提交
40ff305521
共有 1 个文件被更改,包括 14 次插入3 次删除
  1. 14 3
      tests/runci/targets/Php.hx

+ 14 - 3
tests/runci/targets/Php.hx

@@ -49,17 +49,28 @@ class Php {
 			}
 
 			runCommand("haxe", ["compile-php.hxml"].concat(prefix).concat(args));
-			runCommand("php", [binDir + "/index.php"]);
+			runThroughPhpVersions(runCommand.bind("php", [binDir + "/index.php"]));
 
 			changeDirectory(sysDir);
 			if(isCi()) {
 				deleteDirectoryRecursively(binDir);
 			}
 			runCommand("haxe", ["compile-php.hxml"].concat(prefix));
-			runCommand("php", ["bin/php/Main/index.php"]);
+			runThroughPhpVersions(runCommand.bind("php", ["bin/php/Main/index.php"]));
 
 			changeDirectory(miscPhpDir);
-			runCommand("haxe", ["run.hxml"]);
+			runThroughPhpVersions(runCommand.bind("haxe", ["run.hxml"]));
+		}
+	}
+
+	static function runThroughPhpVersions(fn:()->Void) {
+	if(isCi() && systemName == "Linux") {
+			for(version in ['7.0', '7.1', '7.2', '7.3']) {
+				runCommand("phpenv", ["global", version]);
+				fn();
+			}
+		} else {
+			fn();
 		}
 	}
 }