Here are the examples of the csharp api Xunit.ConsoleClient.ConsoleRunner.GetAvailableRunnerReporters() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
1 Examples
19
Source : ConsoleRunner.cs
with MIT License
from dotnet
with MIT License
from dotnet
public int EntryPoint(string[] args)
{
commandLine = CommandLine.Parse(args);
try
{
var reporters = GetAvailableRunnerReporters();
if (args.Length == 0 || args[0] == "-?" || args[0] == "/?" || args[0] == "-h" || args[0] == "--help")
{
PrintHeader();
PrintUsage(reporters);
return 2;
}
if (commandLine.Project.replacedemblies.Count == 0)
throw new ArgumentException("must specify at least one replacedembly");
Console.CancelKeyPress += (sender, e) =>
{
if (!cancel)
{
Console.WriteLine("Canceling... (Press Ctrl+C again to terminate)");
cancel = true;
e.Cancel = true;
}
};
var defaultDirectory = Directory.GetCurrentDirectory();
if (!defaultDirectory.EndsWith(new string(new[] { Path.DirectorySeparatorChar }), StringComparison.Ordinal))
defaultDirectory += Path.DirectorySeparatorChar;
var reporter = commandLine.ChooseReporter(reporters);
#if DEBUG
if (commandLine.Pause)
{
Console.Write("Press any key to start execution...");
Console.ReadKey(true);
Console.WriteLine();
}
#endif
if (commandLine.Debug)
Debugger.Launch();
logger = new ConsoleRunnerLogger(!commandLine.NoColor, consoleLock);
reporterMessageHandler = MessageSinkWithTypesAdapter.Wrap(reporter.CreateMessageHandler(logger));
if (!commandLine.NoLogo)
PrintHeader();
var failCount = RunProject(commandLine.Project, commandLine.Serialize, commandLine.Parallelizereplacedemblies,
commandLine.ParallelizeTestCollections, commandLine.MaxParallelThreads,
commandLine.DiagnosticMessages, commandLine.NoColor, commandLine.AppDomains,
commandLine.FailSkips, commandLine.StopOnFail, commandLine.InternalDiagnosticMessages);
if (cancel)
return -1073741510; // 0xC000013A: The application terminated as a result of a CTRL+C
if (commandLine.Wait)
{
Console.WriteLine();
Console.Write("Press any key to continue...");
Console.ReadKey();
Console.WriteLine();
}
return failCount > 0 ? 1 : 0;
}
catch (Exception ex)
{
if (!commandLine.NoColor)
ConsoleHelper.SetForegroundColor(ConsoleColor.Red);
Console.WriteLine($"error: {ex.Message}");
if (commandLine.InternalDiagnosticMessages)
{
if (!commandLine.NoColor)
ConsoleHelper.SetForegroundColor(ConsoleColor.DarkGray);
Console.WriteLine(ex.StackTrace);
}
return ex is ArgumentException ? 3 : 4;
}
finally
{
if (!commandLine.NoColor)
ConsoleHelper.ResetColor();
}
}