aboutsummaryrefslogtreecommitdiff
path: root/src/Commands/TestCommand.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Commands/TestCommand.cs')
-rw-r--r--src/Commands/TestCommand.cs31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/Commands/TestCommand.cs b/src/Commands/TestCommand.cs
new file mode 100644
index 0000000..d64fe64
--- /dev/null
+++ b/src/Commands/TestCommand.cs
@@ -0,0 +1,31 @@
+using System;
+using System.Threading.Tasks;
+
+using Typin.Console;
+using Typin.Attributes;
+
+using VNLib.Tools.Build.Executor.Model;
+using VNLib.Tools.Build.Executor.Constants;
+
+namespace VNLib.Tools.Build.Executor.Commands
+{
+ [Command("test", Description = "Executes tests steps within the pipline for all loaded modules")]
+ public sealed class TestCommand(BuildPipeline pipeline, ConfigManager cfg) : BaseCommand(pipeline, cfg)
+ {
+ private readonly BuildPipeline _pipeline = pipeline;
+
+ [CommandOption("--no-fail", Description = "Exit testing on the first test failure")]
+ public bool FailOnTestFail { get; set; } = true;
+
+ public override async ValueTask ExecStepsAsync(IConsole console)
+ {
+ console.Output.WriteLine("Begining test step");
+
+ await _pipeline.ExecuteTestsAsync(FailOnTestFail);
+
+ console.WithForegroundColor(ConsoleColor.Green, o => o.Output.WriteLine("Pipeline tests compled"));
+ }
+
+ public override IFeedManager[] Feeds => [];
+ }
+} \ No newline at end of file