Skip to content

Commit

Permalink
Change watchAll to watch as CMD option
Browse files Browse the repository at this point in the history
  • Loading branch information
cegonse committed Nov 27, 2024
1 parent 5830ed7 commit a03c6c0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion runner/cmd-args.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ CmdArgs::CmdArgs(int argc, char* argv[]) : _path(Directory::cwd()), _watch(false

void CmdArgs::parseArg(const std::string& arg)
{
if (arg == "--watchAll")
if (arg == "--watch")
this->_watch = true;

if (arg == "--help")
Expand Down
4 changes: 2 additions & 2 deletions runner/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

static void showHelp()
{
std::cout << "cest-runner [(Optional) Search Path][--watchAll][--help]" << std::endl;
std::cout << "cest-runner [(Optional) Search Path][--watch][--help]" << std::endl;
std::cout << "Options:" << std::endl;
std::cout << " [Search Path]: Directory to look for test executables" << std::endl;
std::cout << " --watchAll: Run cest in watch mode" << std::endl;
std::cout << " --watch: Run cest in watch mode" << std::endl;
std::cout << " --help: Show this help message" << std::endl;
exit(0);
}
Expand Down
6 changes: 3 additions & 3 deletions runner/test/cmd-args.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe("CmdArgs", []() {

it("assumes non-first argument not starting with -- to be the path", []() {
std::string cmd_path = "/bin/test";
std::string watch_mode = "--watchAll";
std::string watch_mode = "--watch";
std::string path = "/home/tests";
std::array<char *, 3> argv = {
(char *)cmd_path.c_str(),
Expand All @@ -39,9 +39,9 @@ describe("CmdArgs", []() {
expect(cmd_args.watch()).toBeFalsy();
});

it("sets to true when --watchAll is passed", []() {
it("sets to true when --watch is passed", []() {
std::string cmd_path = "/bin/test";
std::string watch = "--watchAll";
std::string watch = "--watch";
std::array<char *, 2> argv = { (char *)cmd_path.c_str(), (char *)watch.c_str() };

auto cmd_args = CmdArgs(argv.size(), argv.data());
Expand Down

0 comments on commit a03c6c0

Please sign in to comment.