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

Function test_ret_code

test/test_ret_code.cc:6–22  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4namespace sp = subprocess;
5
6void test_ret_code()
7{
8 std::cout << "Test::test_poll_ret_code" << std::endl;
9#ifdef __USING_WINDOWS__
10 auto p = sp::Popen({"cmd.exe", "/c", "exit", "1"});
11#else
12 auto p = sp::Popen({"/usr/bin/false"});
13#endif
14 while (p.poll() == -1) {
15#ifdef __USING_WINDOWS__
16 Sleep(100);
17#else
18 usleep(1000 * 100);
19#endif
20 }
21 assert (p.retcode() == 1);
22}
23
24void test_ret_code_comm()
25{

Callers 1

mainFunction · 0.85

Calls 3

PopenClass · 0.85
pollMethod · 0.80
retcodeMethod · 0.80

Tested by

no test coverage detected