未验证 提交 d1a01514 编写于 作者: S Sam Harwell 提交者: GitHub

Merge pull request #44055 from sharwell/sequential-testing

Support sequential testing
......@@ -59,6 +59,7 @@ param (
[switch][Alias('test')]$testDesktop,
[switch]$testCoreClr,
[switch]$testIOperation,
[switch]$sequential,
[parameter(ValueFromRemainingArguments=$true)][string[]]$properties)
......@@ -436,6 +437,10 @@ function TestUsingOptimizedRunner() {
$args += " -test64"
}
if ($sequential) {
$args += " -sequential"
}
foreach ($dll in $dlls) {
$args += " $dll"
}
......
......@@ -196,19 +196,13 @@ internal AssemblyScheduler(Options options, int methodLimit = DefaultMethodLimit
_methodLimit = methodLimit;
}
internal IEnumerable<AssemblyInfo> Schedule(IEnumerable<string> assemblyPaths)
public IEnumerable<AssemblyInfo> Schedule(string assemblyPath, bool force = false)
{
var list = new List<AssemblyInfo>();
foreach (var assemblyPath in assemblyPaths)
if (_options.Sequential)
{
list.AddRange(Schedule(assemblyPath));
return new[] { CreateAssemblyInfo(assemblyPath) };
}
return list;
}
public IEnumerable<AssemblyInfo> Schedule(string assemblyPath, bool force = false)
{
var typeInfoList = GetTypeInfoList(assemblyPath);
var assemblyInfoList = new List<AssemblyInfo>();
var partitionList = new List<Partition>();
......
......@@ -76,6 +76,11 @@ internal class Options
/// </summary>
public bool UseProcDump { get; set; }
/// <summary>
/// Disable partitioning and parallelization across test assemblies.
/// </summary>
public bool Sequential { get; set; }
/// <summary>
/// The directory which contains procdump.exe.
/// </summary>
......@@ -214,6 +219,11 @@ bool isOption(string argument, string optionName, out string value)
opt.UseProcDump = false;
index++;
}
else if (comparer.Equals(current, "-sequential"))
{
opt.Sequential = true;
index++;
}
else
{
break;
......
......@@ -47,7 +47,7 @@ internal async Task<RunAllResult> RunAllAsync(IEnumerable<AssemblyInfo> assembly
// Use 1.5 times the number of processors for unit tests, but only 1 processor for the open integration tests
// since they perform actual UI operations (such as mouse clicks and sending keystrokes) and we don't want two
// tests to conflict with one-another.
var max = (_options.TestVsi) ? 1 : (int)(Environment.ProcessorCount * 1.5);
var max = (_options.TestVsi || _options.Sequential) ? 1 : (int)(Environment.ProcessorCount * 1.5);
var cacheCount = 0;
var waiting = new Stack<AssemblyInfo>(assemblyInfoList);
var running = new List<Task<TestResult>>();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册