Replace pstreams with Boost.Process

This commit is contained in:
Alexey Rybalchenko
2018-01-22 11:42:22 +01:00
committed by Mohammad Al-Turany
parent e462d6f597
commit 778c8e16bb
11 changed files with 110 additions and 78 deletions

View File

@@ -17,6 +17,7 @@ namespace
using namespace std;
using namespace fair::mq::test;
using namespace fair::mq::tools;
auto RunPubSub(string transport) -> void
{
@@ -25,7 +26,7 @@ auto RunPubSub(string transport) -> void
auto pub = execute_result{"", 0};
thread pub_thread([&]() {
stringstream cmd;
cmd << runTestDevice << " --id pub_" << transport << " --control static --severity DEBUG "
cmd << runTestDevice << " --id pub_" << transport << " --control static "
<< "--session " << session << " --color false --mq-config \"" << mqConfig << "\"";
pub = execute(cmd.str(), "[PUB]");
});
@@ -33,7 +34,7 @@ auto RunPubSub(string transport) -> void
auto sub1 = execute_result{"", 0};
thread sub1_thread([&]() {
stringstream cmd;
cmd << runTestDevice << " --id sub_1" << transport << " --control static --severity DEBUG "
cmd << runTestDevice << " --id sub_1" << transport << " --control static "
<< "--session " << session << " --color false --mq-config \"" << mqConfig << "\"";
sub1 = execute(cmd.str(), "[SUB1]");
});
@@ -41,7 +42,7 @@ auto RunPubSub(string transport) -> void
auto sub2 = execute_result{"", 0};
thread sub2_thread([&]() {
stringstream cmd;
cmd << runTestDevice << " --id sub_2" << transport << " --control static --severity DEBUG "
cmd << runTestDevice << " --id sub_2" << transport << " --control static "
<< "--session " << session << " --color false --mq-config \"" << mqConfig << "\"";
sub2 = execute(cmd.str(), "[SUB2]");
});
@@ -49,7 +50,7 @@ auto RunPubSub(string transport) -> void
pub_thread.join();
sub1_thread.join();
sub2_thread.join();
cerr << pub.error_out << sub1.error_out << sub2.error_out;
cerr << pub.console_out << sub1.console_out << sub2.console_out << endl;
exit(pub.exit_code + sub1.exit_code + sub2.exit_code);
}