Fixing things for programs with very large output.

This commit is contained in:
Ian Roddis
2021-06-15 14:43:47 -03:00
parent 81f0935f36
commit 40f6b283be
3 changed files with 32 additions and 17 deletions

View File

@@ -1,4 +1,5 @@
#include <iostream>
#include <filesystem>
#include "daggy/executors/ForkingExecutor.hpp"
@@ -26,4 +27,15 @@ TEST_CASE("Basic Execution", "[forking_executor]") {
REQUIRE(rec.error == "/usr/bin/expr: syntax error: missing argument after +\n");
REQUIRE(rec.output.empty());
}
SECTION("Large Output") {
const std::string BIG_FILE{"/usr/share/dict/cracklib-small"};
std::vector<std::string> cmd{"/usr/bin/cat", BIG_FILE};
auto rec = ex.runCommand(cmd);
REQUIRE(rec.rc == 0);
REQUIRE(rec.output.size() == std::filesystem::file_size(BIG_FILE));
REQUIRE(rec.error.empty());
}
}