Implement test-runner PoC (#8)

This commit is contained in:
minsung
2026-04-07 15:21:03 +09:00
parent 836afea5ee
commit 96df2ef65d
12 changed files with 665 additions and 0 deletions

View 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);
}
}