Browse Source

support -D MISC_TEST_FILTER in misc tests for easier selective local testing

Simon Krajewski 10 năm trước cách đây
mục cha
commit
f592c79f50
1 tập tin đã thay đổi với 3 bổ sung1 xóa
  1. 3 1
      tests/misc/src/Main.hx

+ 3 - 1
tests/misc/src/Main.hx

@@ -20,13 +20,15 @@ class Main {
 	macro static public function compileProjects():ExprOf<Result> {
 	macro static public function compileProjects():ExprOf<Result> {
 		var count = 0;
 		var count = 0;
 		var failures = 0;
 		var failures = 0;
+		var filter = haxe.macro.Context.definedValue("MISC_TEST_FILTER");
+		var filterRegex = filter == null ? ~/.*/ : new EReg(filter, "");
 		function browse(dirPath) {
 		function browse(dirPath) {
 			var dir = FileSystem.readDirectory(dirPath);
 			var dir = FileSystem.readDirectory(dirPath);
 			for (file in dir) {
 			for (file in dir) {
 				var path = Path.join([dirPath, file]);
 				var path = Path.join([dirPath, file]);
 				if (FileSystem.isDirectory(path)) {
 				if (FileSystem.isDirectory(path)) {
 					browse(path);
 					browse(path);
-				} else if (file.endsWith(".hxml") && !file.endsWith("-each.hxml")) {
+				} else if (file.endsWith(".hxml") && !file.endsWith("-each.hxml") && filterRegex.match(path)) {
 					var old = Sys.getCwd();
 					var old = Sys.getCwd();
 					Sys.setCwd(dirPath);
 					Sys.setCwd(dirPath);
 					Sys.println('Running haxe $path');
 					Sys.println('Running haxe $path');