| 34 | } |
| 35 | |
| 36 | void 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 | |
| 51 | int main() { |
| 52 | test_ret_code(); |