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) { ...@@ -263,6 +263,9 @@ CAF_TEST(triangle_setup) {
"both at the same time"); "both at the same time");
return; 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; auto use_asio = r.opts.count("use-asio") > 0;
# ifdef CAF_USE_ASIO # ifdef CAF_USE_ASIO
if (use_asio) { if (use_asio) {
...@@ -270,9 +273,6 @@ CAF_TEST(triangle_setup) { ...@@ -270,9 +273,6 @@ CAF_TEST(triangle_setup) {
set_middleman<network::asio_multiplexer>(); set_middleman<network::asio_multiplexer>();
} }
# endif // CAF_USE_ASIO # 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; auto as_server = r.opts.count("server") > 0;
if (is_mars) if (is_mars)
run_mars(port, publish_port); run_mars(port, publish_port);
......
...@@ -123,12 +123,12 @@ CAF_TEST(remote_spawn) { ...@@ -123,12 +123,12 @@ CAF_TEST(remote_spawn) {
return; return;
} }
auto use_asio = r.opts.count("use-asio") > 0; auto use_asio = r.opts.count("use-asio") > 0;
if (use_asio) {
# ifdef CAF_USE_ASIO # ifdef CAF_USE_ASIO
if (use_asio) {
CAF_MESSAGE("enable ASIO backend"); CAF_MESSAGE("enable ASIO backend");
io::set_middleman<io::network::asio_multiplexer>(); io::set_middleman<io::network::asio_multiplexer>();
# endif // CAF_USE_ASIO
} }
# endif // CAF_USE_ASIO
if (r.opts.count("client") > 0) { if (r.opts.count("client") > 0) {
auto serv = io::remote_actor("localhost", port); auto serv = io::remote_actor("localhost", port);
spawn(client, serv); spawn(client, serv);
...@@ -139,10 +139,13 @@ CAF_TEST(remote_spawn) { ...@@ -139,10 +139,13 @@ CAF_TEST(remote_spawn) {
port = io::publish(serv, port); port = io::publish(serv, port);
CAF_TEST_INFO("published server at port " << port); CAF_TEST_INFO("published server at port " << port);
if (r.opts.count("server") == 0) { if (r.opts.count("server") == 0) {
auto child = detail::run_program(invalid_actor, argv[0], "-n", "-s", CAF_TEST_VERBOSE("run client program");
CAF_XSTR(CAF_SUITE), "--", "-c", auto child = detail::run_program(invalid_actor, caf::test::engine::path(),
port, (use_asio ? "--use-asio" : "")); "-n", "-s", CAF_XSTR(CAF_SUITE), "--",
"-c", port,
(use_asio ? "--use-asio" : ""));
child.join(); child.join();
} }
await_all_actors_done(); 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