| 5 | using namespace TinyProcessLib; |
| 6 | |
| 7 | int main() { |
| 8 | bool stdout_error=false; |
| 9 | for(size_t c=0;c<10000;c++) { |
| 10 | Process process("echo Hello World "+to_string(c), "", [&stdout_error, c](const char *bytes, size_t n) { |
| 11 | if(string(bytes, n)!="Hello World "+to_string(c)+"\n") |
| 12 | stdout_error=true; |
| 13 | }, [](const char *, size_t) { |
| 14 | }, true); |
| 15 | auto exit_status=process.get_exit_status(); |
| 16 | if(exit_status!=0) { |
| 17 | cerr << "Process returned failure." << endl; |
| 18 | return 1; |
| 19 | } |
| 20 | if(stdout_error) { |
| 21 | cerr << "Wrong output to stdout." << endl; |
| 22 | return 1; |
| 23 | } |
| 24 | } |
| 25 | |
| 26 | return 0; |
| 27 | } |
nothing calls this directly
no test coverage detected