Changing Executor interface to allow for more flexible tasks down the road

This commit is contained in:
Ian Roddis
2021-08-23 12:03:16 -03:00
parent a83da567d0
commit 6b9baffe27
5 changed files with 13 additions and 13 deletions

View File

@@ -9,9 +9,9 @@ TEST_CASE("Basic Execution", "[forking_executor]") {
daggy::executors::task::ForkingTaskExecutor ex(10);
SECTION("Simple Run") {
std::vector<std::string> cmd{"/usr/bin/echo", "abc", "123"};
daggy::Task task{.command{"/usr/bin/echo", "abc", "123"}};
auto rec = ex.runCommand(cmd);
auto rec = ex.runCommand(task);
REQUIRE(rec.rc == 0);
REQUIRE(rec.outputLog == "abc 123\n");
@@ -19,9 +19,9 @@ TEST_CASE("Basic Execution", "[forking_executor]") {
}
SECTION("Error Run") {
std::vector<std::string> cmd{"/usr/bin/expr", "1", "+", "+"};
daggy::Task task{.command{"/usr/bin/expr", "1", "+", "+"}};
auto rec = ex.runCommand(cmd);
auto rec = ex.runCommand(task);
REQUIRE(rec.rc == 2);
REQUIRE(rec.errorLog == "/usr/bin/expr: syntax error: missing argument after +\n");
@@ -36,9 +36,9 @@ TEST_CASE("Basic Execution", "[forking_executor]") {
for (const auto &bigFile : BIG_FILES) {
if (!std::filesystem::exists(bigFile)) continue;
std::vector<std::string> cmd{"/usr/bin/cat", bigFile};
daggy::Task task{.command{"/usr/bin/cat", bigFile}};
auto rec = ex.runCommand(cmd);
auto rec = ex.runCommand(task);
REQUIRE(rec.rc == 0);
REQUIRE(rec.outputLog.size() == std::filesystem::file_size(bigFile));