Implement test-runner PoC (#8)
This commit is contained in:
42
src/Recordingtest.Runner/Program.cs
Normal file
42
src/Recordingtest.Runner/Program.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
namespace Recordingtest.Runner;
|
||||
|
||||
public static class Program
|
||||
{
|
||||
public static int Main(string[] args)
|
||||
{
|
||||
var options = new RunnerOptions();
|
||||
for (int i = 0; i < args.Length; i++)
|
||||
{
|
||||
switch (args[i])
|
||||
{
|
||||
case "--scenarios": options.ScenariosDir = args[++i]; break;
|
||||
case "--baselines": options.BaselinesDir = args[++i]; break;
|
||||
case "--out": options.OutDir = args[++i]; break;
|
||||
case "--profile": options.Profile = args[++i]; break;
|
||||
case "--no-launch": options.NoLaunch = true; break;
|
||||
case "-h":
|
||||
case "--help":
|
||||
Console.WriteLine("Usage: Recordingtest.Runner --scenarios <dir> --baselines <dir> --out <dir> [--profile <name>] [--no-launch]");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(options.ScenariosDir) ||
|
||||
string.IsNullOrEmpty(options.BaselinesDir) ||
|
||||
string.IsNullOrEmpty(options.OutDir))
|
||||
{
|
||||
Console.Error.WriteLine("Missing required args. Use --help.");
|
||||
return 2;
|
||||
}
|
||||
|
||||
var runner = new TestRunner();
|
||||
var report = runner.RunAll(
|
||||
options,
|
||||
new DefaultHostFactory(),
|
||||
new DefaultNormalizer(),
|
||||
new DefaultDiffer());
|
||||
|
||||
Console.WriteLine($"Total: {report.Total}, Passed: {report.Passed}, Failed: {report.Failed}, Errored: {report.Errored}");
|
||||
return TestRunner.ToExitCode(report);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user