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

Function test_ret_code_check_output

test/test_ret_code.cc:36–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34}
35
36void test_ret_code_check_output()
37{
38 using namespace sp;
39 bool caught = false;
40 try {
41 auto obuf = check_output({"/bin/false"}, shell{false});
42 assert(false); // Expected to throw
43 } catch (CalledProcessError &e) {
44 std::cout << "retcode: " << e.retcode << std::endl;
45 assert (e.retcode == 1);
46 caught = true;
47 }
48 assert(caught);
49}
50
51int main() {
52 test_ret_code();

Callers 1

mainFunction · 0.85

Calls 1

check_outputFunction · 0.85

Tested by

no test coverage detected