Commit 272db974 authored by Dominik Charousset's avatar Dominik Charousset

Fix argument handling in unit tests

parent 0cfec00d
......@@ -263,6 +263,9 @@ CAF_TEST(triangle_setup) {
"both at the same time");
return;
}
// enable automatic connections
anon_send(whereis(atom("ConfigServ")), put_atom::value,
"global.enable-automatic-connections", make_message(true));
auto use_asio = r.opts.count("use-asio") > 0;
# ifdef CAF_USE_ASIO
if (use_asio) {
......@@ -270,9 +273,6 @@ CAF_TEST(triangle_setup) {
set_middleman<network::asio_multiplexer>();
}
# endif // CAF_USE_ASIO
// enable automatic connections
anon_send(whereis(atom("ConfigServ")), put_atom::value,
"global.enable-automatic-connections", make_message(true));
auto as_server = r.opts.count("server") > 0;
if (is_mars)
run_mars(port, publish_port);
......
......@@ -123,12 +123,12 @@ CAF_TEST(remote_spawn) {
return;
}
auto use_asio = r.opts.count("use-asio") > 0;
if (use_asio) {
# ifdef CAF_USE_ASIO
if (use_asio) {
CAF_MESSAGE("enable ASIO backend");
io::set_middleman<io::network::asio_multiplexer>();
# endif // CAF_USE_ASIO
}
# endif // CAF_USE_ASIO
if (r.opts.count("client") > 0) {
auto serv = io::remote_actor("localhost", port);
spawn(client, serv);
......@@ -139,10 +139,13 @@ CAF_TEST(remote_spawn) {
port = io::publish(serv, port);
CAF_TEST_INFO("published server at port " << port);
if (r.opts.count("server") == 0) {
auto child = detail::run_program(invalid_actor, argv[0], "-n", "-s",
CAF_XSTR(CAF_SUITE), "--", "-c",
port, (use_asio ? "--use-asio" : ""));
CAF_TEST_VERBOSE("run client program");
auto child = detail::run_program(invalid_actor, caf::test::engine::path(),
"-n", "-s", CAF_XSTR(CAF_SUITE), "--",
"-c", port,
(use_asio ? "--use-asio" : ""));
child.join();
}
await_all_actors_done();
shutdown();
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment