ソースを参照

Test C# on AppVeyor.

Andy Li 11 年 前
コミット
8ec9c126e4

+ 32 - 7
tests/RunCi.hx

@@ -212,6 +212,16 @@ class RunCi {
 		Sys.exit(1);
 	}
 
+	static function runExe(exe:String):Void {
+		exe = FileSystem.fullPath(exe);
+		switch (systemName) {
+			case "Linux", "Mac":
+				runCommand("mono", [exe]);
+			case "Windows":
+				runCommand(exe, []);
+		}
+	}
+
 	static function parseCommand(cmd:String) {
 		var args = [];
 		var offset = 0;
@@ -330,10 +340,13 @@ class RunCi {
 		switch (systemName) {
 			case "Linux":
 				runCommand("sudo", ["apt-get", "install", "mono-devel", "mono-mcs", "-qq"], true);
+				runCommand("mono", ["--version"]);
 			case "Mac":
 				runCommand("brew", ["install", "mono"], true);
+				runCommand("mono", ["--version"]);
+			case "Windows":
+				//pass
 		}
-		runCommand("mono", ["--version"]);
 
 		haxelibInstallGit("HaxeFoundation", "hxcs", true);
 	}
@@ -392,7 +405,6 @@ class RunCi {
 	static var miscDir(default, never) = cwd + "misc/";
 
 	static function main():Void {
-		changeDirectory(unitDir);
 		Sys.putEnv("OCAMLRUNPARAM", "b");
 
 		var args = ["foo", "12", "a b  %PATH% $HOME c\\&<>[\"]#{}|%$"];
@@ -403,10 +415,13 @@ class RunCi {
 			case TravisCI:
 				[Sys.getEnv("TEST")];
 			case AppVeyor:
-				[Macro, Neko];
+				[Macro, Neko, Cs];
 		}
+		Sys.println('Going to test: $tests');
 
 		for (test in tests) {
+			infoMsg('Now test $test');
+			changeDirectory(unitDir);
 			switch (test) {
 				case Macro:
 					runCommand("haxe", ["compile-macro.hxml"]);
@@ -516,11 +531,21 @@ class RunCi {
 				case Cs:
 					getCsDependencies();
 
-					runCommand("haxe", ["compile-cs-travis.hxml"]);
-					runCommand("mono", ["bin/cs/bin/Test-Debug.exe"]);
+					switch (ci) {
+						case TravisCI:
+							runCommand("haxe", ["compile-cs-travis.hxml"]);
+							runExe("bin/cs/bin/Test-Debug.exe");
 
-					runCommand("haxe", ["compile-cs-unsafe.hxml"]);
-					runCommand("mono", ["bin/cs_unsafe/bin/Test-Debug.exe"]);
+							runCommand("haxe", ["compile-cs-unsafe-travis.hxml"]);
+							runExe("bin/cs_unsafe/bin/Test-Debug.exe");
+						case AppVeyor, null:
+							runCommand("haxe", ["compile-cs.hxml"]);
+							runExe("bin/cs/bin/Test-Debug.exe");
+
+							runCommand("haxe", ["compile-cs-unsafe.hxml"]);
+							runExe("bin/cs_unsafe/bin/Test-Debug.exe");
+					}
+					
 				case Flash9:
 					setupFlashPlayerDebugger();
 					runCommand("haxe", ["compile-flash9.hxml", "-D", "fdb"]);

+ 7 - 0
tests/unit/compile-cs-unsafe-travis.hxml

@@ -0,0 +1,7 @@
+compile-cs-unsafe.hxml
+
+-net-lib cs_drivers/System.Data.dll
+-net-lib cs_drivers/System.Xml.dll
+-net-lib cs_drivers/Mono.Data.Sqlite.dll
+
+-D travis

+ 0 - 3
tests/unit/compile-cs-unsafe.hxml

@@ -8,6 +8,3 @@ compile-each.hxml
 -D unsafe
 -cs bin/cs_unsafe
 -net-lib native_cs/bin/native_cs.dll
--net-lib cs_drivers/System.Data.dll
--net-lib cs_drivers/System.Xml.dll
--net-lib cs_drivers/Mono.Data.Sqlite.dll