Skip to content

Commit

Permalink
Adjust perf test selector layout
Browse files Browse the repository at this point in the history
  • Loading branch information
ocoanet committed Feb 14, 2024
1 parent 372c62b commit ac7423b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Disruptor.PerfTests/PerfTestTypeSelector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public List<Type> GetPerfTestTypes()
if (_options.Target.Equals("all", StringComparison.OrdinalIgnoreCase))
return GetAllTestTypes();

return GetMatchingTestTypes(_options.Target);
return GetMatchingTestTypes(_options.Target, LoadValidTestTypes());
}

private List<Type> PrintAndSelectTestTypes()
Expand Down Expand Up @@ -52,7 +52,7 @@ private List<Type> PrintAndSelectTestTypes()
return new() { printableTypes[index].Type };
}

return GetMatchingTestTypes(target);
return GetMatchingTestTypes(target, testTypes);
}

private static void PrintGroup(int level, List<PrintableType> types)
Expand All @@ -66,7 +66,7 @@ private static void PrintGroup(int level, List<PrintableType> types)

foreach (var type in types.Where(x => x.Namespace.Length == level))
{
Console.WriteLine($"{padding}- {type.Index}: {type.Name}");
Console.WriteLine($"{padding}{type.Index}: {type.Name}");
}
}

Expand Down Expand Up @@ -98,11 +98,11 @@ bool IsIncluded(Type type)
}
}

private static List<Type> GetMatchingTestTypes(string target)
private static List<Type> GetMatchingTestTypes(string target, List<Type> testTypes)
{
var regex = CreateTargetRegex(target);

return LoadValidTestTypes().Where(x => regex.IsMatch(x.Name)).ToList();
return testTypes.Where(x => regex.IsMatch(x.Name)).ToList();

static Regex CreateTargetRegex(string target)
{
Expand Down

0 comments on commit ac7423b

Please sign in to comment.