Преглед на файлове

allow custom filter in UnitBuilder

Simon Krajewski преди 11 години
родител
ревизия
866821eef5
променени са 1 файла, в които са добавени 2 реда и са изтрити 2 реда
  1. 2 2
      tests/unit/UnitBuilder.hx

+ 2 - 2
tests/unit/UnitBuilder.hx

@@ -29,7 +29,7 @@ using StringTools;
 
 
 class UnitBuilder {
 class UnitBuilder {
 	
 	
-	static public macro function build(basePath:String):Array<Field> {
+	static public macro function build(basePath:String, filter:String = ".unit.hx"):Array<Field> {
 		var ret = Context.getBuildFields();
 		var ret = Context.getBuildFields();
 		var numFiles = 0;
 		var numFiles = 0;
 			
 			
@@ -38,7 +38,7 @@ class UnitBuilder {
 			path = path.endsWith("\\") || path.endsWith("/") ? path : path + "/";
 			path = path.endsWith("\\") || path.endsWith("/") ? path : path + "/";
 			for (file in dir) {
 			for (file in dir) {
 				var filePath = path + file;
 				var filePath = path + file;
-				if (file.endsWith(".unit.hx")) {
+				if (file.endsWith(filter)) {
 					numFiles++;
 					numFiles++;
 					var func = {
 					var func = {
 						args: [],
 						args: [],