yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
test_cli_commands.h
Go to the documentation of this file.
1#ifndef YAZE_CLI_HANDLERS_TOOLS_TEST_CLI_COMMANDS_H
2#define YAZE_CLI_HANDLERS_TOOLS_TEST_CLI_COMMANDS_H
3
5
6namespace yaze::cli {
7
15 public:
16 std::string GetName() const override { return "test-list"; }
17
18 std::string GetDescription() const {
19 return "List available tests with labels and requirements";
20 }
21
22 std::string GetUsage() const override {
23 return "test-list [--format json|text] [--label <label>]";
24 }
25
26 std::string GetDefaultFormat() const override { return "text"; }
27
28 std::string GetOutputTitle() const override { return "Test Discovery"; }
29
30 bool RequiresRom() const override { return false; }
31
32 Descriptor Describe() const override {
33 Descriptor desc;
34 desc.display_name = "test-list";
35 desc.summary = "List available ctest labels, test counts, and requirements "
36 "for each test suite.";
37 desc.todo_reference = "todo#test-list";
38 return desc;
39 }
40
41 absl::Status ValidateArgs(
42 const resources::ArgumentParser& parser) override {
43 return absl::OkStatus();
44 }
45
46 absl::Status Execute(Rom* rom, const resources::ArgumentParser& parser,
47 resources::OutputFormatter& formatter) override;
48};
49
57 public:
58 std::string GetName() const override { return "test-run"; }
59
60 std::string GetDescription() const {
61 return "Run tests with structured output";
62 }
63
64 std::string GetUsage() const override {
65 return "test-run [--label <label>] [--preset <preset>] "
66 "[--format json|text] [--verbose]";
67 }
68
69 std::string GetDefaultFormat() const override { return "text"; }
70
71 std::string GetOutputTitle() const override { return "Test Run"; }
72
73 bool RequiresRom() const override { return false; }
74
75 Descriptor Describe() const override {
76 Descriptor desc;
77 desc.display_name = "test-run";
78 desc.summary = "Run ctest with specified label/preset and produce "
79 "structured output for agents.";
80 desc.todo_reference = "todo#test-run";
81 return desc;
82 }
83
84 absl::Status ValidateArgs(
85 const resources::ArgumentParser& parser) override {
86 return absl::OkStatus();
87 }
88
89 absl::Status Execute(Rom* rom, const resources::ArgumentParser& parser,
90 resources::OutputFormatter& formatter) override;
91};
92
100 public:
101 std::string GetName() const override { return "test-status"; }
102
103 std::string GetDescription() const {
104 return "Show test configuration status (ROM path, preset, enabled suites)";
105 }
106
107 std::string GetUsage() const override {
108 return "test-status [--format json|text]";
109 }
110
111 std::string GetDefaultFormat() const override { return "text"; }
112
113 std::string GetOutputTitle() const override { return "Test Status"; }
114
115 bool RequiresRom() const override { return false; }
116
117 Descriptor Describe() const override {
118 Descriptor desc;
119 desc.display_name = "test-status";
120 desc.summary = "Show current test configuration including ROM path, "
121 "active preset, and which test suites are enabled.";
122 desc.todo_reference = "todo#test-status";
123 return desc;
124 }
125
126 absl::Status ValidateArgs(
127 const resources::ArgumentParser& parser) override {
128 return absl::OkStatus();
129 }
130
131 absl::Status Execute(Rom* rom, const resources::ArgumentParser& parser,
132 resources::OutputFormatter& formatter) override;
133};
134
135} // namespace yaze::cli
136
137#endif // YAZE_CLI_HANDLERS_TOOLS_TEST_CLI_COMMANDS_H
138
The Rom class is used to load, save, and modify Rom data. This is a generic SNES ROM container and do...
Definition rom.h:24
List available tests with labels and requirements.
absl::Status Execute(Rom *rom, const resources::ArgumentParser &parser, resources::OutputFormatter &formatter) override
Execute the command business logic.
absl::Status ValidateArgs(const resources::ArgumentParser &parser) override
Validate command arguments.
std::string GetName() const override
Get the command name.
std::string GetDefaultFormat() const override
Get the default output format ("json" or "text")
std::string GetOutputTitle() const override
Get the output title for formatting.
std::string GetUsage() const override
Get the command usage string.
bool RequiresRom() const override
Check if the command requires a loaded ROM.
Descriptor Describe() const override
Provide metadata for TUI/help summaries.
Run tests with structured output.
Descriptor Describe() const override
Provide metadata for TUI/help summaries.
std::string GetUsage() const override
Get the command usage string.
absl::Status Execute(Rom *rom, const resources::ArgumentParser &parser, resources::OutputFormatter &formatter) override
Execute the command business logic.
std::string GetOutputTitle() const override
Get the output title for formatting.
absl::Status ValidateArgs(const resources::ArgumentParser &parser) override
Validate command arguments.
std::string GetDefaultFormat() const override
Get the default output format ("json" or "text")
bool RequiresRom() const override
Check if the command requires a loaded ROM.
std::string GetName() const override
Get the command name.
Show test configuration status.
std::string GetName() const override
Get the command name.
Descriptor Describe() const override
Provide metadata for TUI/help summaries.
std::string GetOutputTitle() const override
Get the output title for formatting.
absl::Status ValidateArgs(const resources::ArgumentParser &parser) override
Validate command arguments.
std::string GetUsage() const override
Get the command usage string.
absl::Status Execute(Rom *rom, const resources::ArgumentParser &parser, resources::OutputFormatter &formatter) override
Execute the command business logic.
bool RequiresRom() const override
Check if the command requires a loaded ROM.
std::string GetDefaultFormat() const override
Get the default output format ("json" or "text")
Utility for parsing common CLI argument patterns.
Base class for CLI command handlers.
Utility for consistent output formatting across commands.
Namespace for the command line interface.