Distinguish between Run and RunAll
This commit is contained in:
@@ -9,7 +9,7 @@ namespace xunit.runner.data
|
||||
public static class Constants
|
||||
{
|
||||
public const string ActionDiscover = "discover";
|
||||
public const string ActionRun = "run";
|
||||
public const string ActionRunAll = "runall";
|
||||
public static readonly Encoding Encoding = Encoding.UTF8;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace xunit.runner.worker
|
||||
case Constants.ActionDiscover:
|
||||
Discover(stream, argument);
|
||||
break;
|
||||
case Constants.ActionRun:
|
||||
case Constants.ActionRunAll:
|
||||
Run(stream, argument);
|
||||
break;
|
||||
default:
|
||||
@@ -81,7 +81,7 @@ namespace xunit.runner.worker
|
||||
private static void Run(Stream stream, string assemblyPath)
|
||||
{
|
||||
Console.WriteLine($"run started: {assemblyPath}");
|
||||
RunUtil.Go(assemblyPath, stream);
|
||||
RunUtil.RunAll(assemblyPath, stream);
|
||||
Console.WriteLine("run ended");
|
||||
}
|
||||
|
||||
|
||||
@@ -63,12 +63,12 @@ namespace xunit.runner.worker
|
||||
}
|
||||
}
|
||||
|
||||
internal static void Go(string assemblyPath, Stream stream)
|
||||
internal static void RunAll(string assemblyPath, Stream stream)
|
||||
{
|
||||
using (AssemblyHelper.SubscribeResolve())
|
||||
using (var xunit = new XunitFrontController(
|
||||
assemblyFileName: assemblyPath,
|
||||
useAppDomain: true,
|
||||
useAppDomain: false,
|
||||
shadowCopy: false,
|
||||
diagnosticMessageSink: new MessageVisitor()))
|
||||
using (var writer = new ClientWriter(stream))
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace xunit.runner.wpf
|
||||
/// <summary>
|
||||
/// Begin a run of a unit test for the given assembly.
|
||||
/// </summary>
|
||||
ITestRunSession Run(string assemblyPath, CancellationToken cancellationToken = default(CancellationToken));
|
||||
ITestRunSession RunAll(string assemblyPath, CancellationToken cancellationToken = default(CancellationToken));
|
||||
}
|
||||
|
||||
internal interface ITestSession
|
||||
|
||||
@@ -51,9 +51,9 @@ namespace xunit.runner.wpf.Impl
|
||||
return new DiscoverSession(connection, _dispatcher, cancellationToken);
|
||||
}
|
||||
|
||||
private RunSession Run(string assemblyPath, CancellationToken cancellationToken)
|
||||
private RunSession RunAll(string assemblyPath, CancellationToken cancellationToken)
|
||||
{
|
||||
var connection = StartWorkerProcess(Constants.ActionRun, assemblyPath);
|
||||
var connection = StartWorkerProcess(Constants.ActionRunAll, assemblyPath);
|
||||
return new RunSession(connection, _dispatcher, cancellationToken);
|
||||
}
|
||||
|
||||
@@ -64,9 +64,9 @@ namespace xunit.runner.wpf.Impl
|
||||
return Discover(assemblyPath, cancellationToken);
|
||||
}
|
||||
|
||||
ITestRunSession ITestUtil.Run(string assemblyPath, CancellationToken cancellationToken)
|
||||
ITestRunSession ITestUtil.RunAll(string assemblyPath, CancellationToken cancellationToken)
|
||||
{
|
||||
return Run(assemblyPath, cancellationToken);
|
||||
return RunAll(assemblyPath, cancellationToken);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -336,7 +336,7 @@ namespace xunit.runner.wpf.ViewModel
|
||||
this.cancellationTokenSource = new CancellationTokenSource();
|
||||
foreach (var assemblyPath in TestCases.Select(x => x.AssemblyFileName).Distinct())
|
||||
{
|
||||
var session = this.testUtil.Run(assemblyPath, this.cancellationTokenSource.Token);
|
||||
var session = this.testUtil.RunAll(assemblyPath, this.cancellationTokenSource.Token);
|
||||
session.TestFinished += OnTestFinished;
|
||||
session.SessionFinished += delegate { OnTestSessionFinished(session); };
|
||||
this.testSessionList.Add(session);
|
||||
|
||||
Reference in New Issue
Block a user