jmmv/atf — pull request #10 by cemeyer (2014-07-31 15:20:07+00:00)
Title: Add -r timeout[:interval] option to atf-check.

Sponsored by: EMC / Isilon storage division

[PR notes, not for commit log:

I'm mostly soliciting feedback, I don't expect this to be merged as-is (although that would be fine with me). Let me know why it's horrible and I can try and clean it up.

I looked a little bit at trying to make this less noisy (currently each iteration produces the failed status, stdout, and stderr output), but lots of `atf-check.cpp` is hardcoded to write directly out to `std::cout` or `std::cerr`. Changing this would be pretty invasive, and doing it appropriately is probably beyond my C++ abilities.

Doing it right should just be a matter of directing `atf-check.cpp` output to a `stringstream` for each of stdout, stderr; on repeat (the `if ()` clause where we `usleep()`), clear the buffers with `.str("")` and `.clear()`. On exiting the `do { ... } while (...)` loop, print the contents of each buffer to its appropriate stream. This won't interleave exactly the same, but I hope we were not relying on that.

Thanks for taking a look.]