Преглед изворни кода

[tests] allow running display tests with another haxe version (#11968)

Rudy Ges пре 7 месеци
родитељ
комит
83258a4be2
1 измењених фајлова са 10 додато и 1 уклоњено
  1. 10 1
      tests/display/src/BaseDisplayTestContext.hx

+ 10 - 1
tests/display/src/BaseDisplayTestContext.hx

@@ -6,7 +6,16 @@ using StringTools;
 import Types;
 
 class BaseDisplayTestContext {
-	static var haxeServer = haxeserver.HaxeServerSync.launch("haxe", []);
+	static var haxeServer = {
+		var hx = "haxe";
+		var testHaxe = haxe.macro.Compiler.getDefine("test_haxe");
+		if (testHaxe != null) {
+			Sys.putEnv("HAXE_STD_PATH", '${Path.directory(testHaxe)}/std');
+			hx = testHaxe;
+		}
+
+		haxeserver.HaxeServerSync.launch(hx, []);
+	}
 
 	var dir:String = ".";
 	var vfs:Vfs;