I'm building a test automation solution for a test process. I ran into a link, but my C++ competency isn't that great. Could someone please explain the syntax below?
void read_loop(bp::async_pipe& p, mutable_buffer buf) {
p.async_read_some(buf, [&p,buf](std::error_code ec, size_t n) {
std::cout << "Received " << n << " bytes (" << ec.message() << "): '";
std::cout.write(boost::asio::buffer_cast<char const*>(buf), n) << "'" << std::endl;
if (!ec) read_loop(p, buf);
});
}
How to retrieve program output as soon as it printed?
My solution needs to orchestrate binaries, that monitor data traffic. There are two main programs. One manages other programs, call it B
. Program A
just stores all data. The testing process should inspect the outputs and match some keywords. If matched, test passes. The high level solution should do I/O to all programs--manipulating states, and matching 'outputs'.