MCPcopy Create free account
hub / github.com/arun11299/cpp-subprocess / test_piping

Function test_piping

test/test_subprocess.cc:25–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23}
24
25void test_piping()
26{
27 auto cat = Popen({"cat", "../subprocess.hpp"}, output{PIPE});
28 auto grep = Popen({"grep", "template"}, input{cat.output()}, output{PIPE});
29 auto cut = Popen({"cut", "-d,", "-f", "1"}, input{grep.output()}, output{PIPE});
30 auto res = cut.communicate().first;
31 std::cout << res.buf.data() << std::endl;
32}
33
34void test_easy_piping()
35{

Callers

nothing calls this directly

Calls 3

PopenClass · 0.85
outputMethod · 0.45
communicateMethod · 0.45

Tested by

no test coverage detected