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

Function test_ret_code_comm

test/test_ret_code.cc:24–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22}
23
24void test_ret_code_comm()
25{
26 using namespace sp;
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 std::cout << "retcode: " << cut.retcode() << std::endl;
34}
35
36void test_ret_code_check_output()
37{

Callers 1

mainFunction · 0.85

Calls 4

PopenClass · 0.85
retcodeMethod · 0.80
outputMethod · 0.45
communicateMethod · 0.45

Tested by

no test coverage detected