Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
9df6a8e0
Unverified
Commit
9df6a8e0
authored
Jun 30, 2018
by
Dominik Charousset
Committed by
GitHub
Jun 30, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #715
Simplify UDP test, use dynamic ports
parents
36fb5045
38e0f0b9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
15 deletions
+14
-15
CMakeLists.txt
CMakeLists.txt
+1
-1
Jenkinsfile
Jenkinsfile
+1
-4
libcaf_io/test/remote_actor_udp.cpp
libcaf_io/test/remote_actor_udp.cpp
+12
-10
No files found.
CMakeLists.txt
View file @
9df6a8e0
...
@@ -621,7 +621,7 @@ if(NOT CAF_NO_UNIT_TESTS)
...
@@ -621,7 +621,7 @@ if(NOT CAF_NO_UNIT_TESTS)
macro
(
make_test suite
)
macro
(
make_test suite
)
string
(
REPLACE
" "
"_"
test_name
${
suite
}
)
string
(
REPLACE
" "
"_"
test_name
${
suite
}
)
set
(
caf_test
${
EXECUTABLE_OUTPUT_PATH
}
/caf-test
)
set
(
caf_test
${
EXECUTABLE_OUTPUT_PATH
}
/caf-test
)
add_test
(
${
test_name
}
${
caf_test
}
-n -v 5 -s
"
${
suite
}
"
${
ARGN
}
)
add_test
(
${
test_name
}
${
caf_test
}
-
r 300 -
n -v 5 -s
"
${
suite
}
"
${
ARGN
}
)
endmacro
()
endmacro
()
list
(
LENGTH suites num_suites
)
list
(
LENGTH suites num_suites
)
message
(
STATUS
"Found
${
num_suites
}
test suites"
)
message
(
STATUS
"Found
${
num_suites
}
test suites"
)
...
...
Jenkinsfile
View file @
9df6a8e0
...
@@ -203,10 +203,7 @@ pipeline {
...
@@ -203,10 +203,7 @@ pipeline {
steps
{
steps
{
deleteDir
()
deleteDir
()
dir
(
'caf-sources'
)
{
dir
(
'caf-sources'
)
{
git
([
checkout
scm
url:
'https://github.com/actor-framework/actor-framework.git'
,
branch:
'master'
,
])
}
}
stash
includes:
'caf-sources/**'
,
name:
'caf-sources'
stash
includes:
'caf-sources/**'
,
name:
'caf-sources'
}
}
...
...
libcaf_io/test/remote_actor_udp.cpp
View file @
9df6a8e0
...
@@ -196,7 +196,7 @@ CAF_TEST(remote_link_udp) {
...
@@ -196,7 +196,7 @@ CAF_TEST(remote_link_udp) {
CAF_TEST
(
multiple_endpoints_udp
)
{
CAF_TEST
(
multiple_endpoints_udp
)
{
config
cfg
;
config
cfg
;
//
setup server
//
Setup server.
CAF_MESSAGE
(
"creating server"
);
CAF_MESSAGE
(
"creating server"
);
actor_system
server_sys
{
cfg
};
actor_system
server_sys
{
cfg
};
auto
mirror
=
server_sys
.
spawn
([]()
->
behavior
{
auto
mirror
=
server_sys
.
spawn
([]()
->
behavior
{
...
@@ -207,7 +207,9 @@ CAF_TEST(multiple_endpoints_udp) {
...
@@ -207,7 +207,9 @@ CAF_TEST(multiple_endpoints_udp) {
}
}
};
};
});
});
server_sys
.
middleman
().
publish_udp
(
mirror
,
12345
);
auto
port
=
server_sys
.
middleman
().
publish_udp
(
mirror
,
0
);
CAF_REQUIRE
(
port
);
CAF_MESSAGE
(
"server running on port "
<<
port
);
auto
client_fun
=
[](
event_based_actor
*
self
)
->
behavior
{
auto
client_fun
=
[](
event_based_actor
*
self
)
->
behavior
{
return
{
return
{
[
=
](
actor
s
)
{
[
=
](
actor
s
)
{
...
@@ -220,29 +222,29 @@ CAF_TEST(multiple_endpoints_udp) {
...
@@ -220,29 +222,29 @@ CAF_TEST(multiple_endpoints_udp) {
}
}
};
};
};
};
//
setup client a
//
Setup a client.
CAF_MESSAGE
(
"creating first client"
);
CAF_MESSAGE
(
"creating first client"
);
config
client_cfg
;
config
client_cfg
;
actor_system
client_sys
{
client_cfg
};
actor_system
client_sys
{
client_cfg
};
auto
client
=
client_sys
.
spawn
(
client_fun
);
auto
client
=
client_sys
.
spawn
(
client_fun
);
//
acquire remote actor from the server
//
Acquire remote actor from the server.
auto
client_srv
=
client_sys
.
middleman
().
remote_actor_udp
(
"localhost"
,
12345
);
auto
client_srv
=
client_sys
.
middleman
().
remote_actor_udp
(
"localhost"
,
*
port
);
CAF_REQUIRE
(
client_srv
);
CAF_REQUIRE
(
client_srv
);
//
setup other clients
//
Setup other clients.
for
(
int
i
=
0
;
i
<
5
;
++
i
)
{
for
(
int
i
=
0
;
i
<
5
;
++
i
)
{
config
other_cfg
;
config
other_cfg
;
actor_system
other_sys
{
other_cfg
};
actor_system
other_sys
{
other_cfg
};
CAF_MESSAGE
(
"creating new client"
);
CAF_MESSAGE
(
"creating new client"
);
auto
other
=
other_sys
.
spawn
(
client_fun
);
auto
other
=
other_sys
.
spawn
(
client_fun
);
//
acquire remote actor from the server
//
Acquire remote actor from the new server.
auto
other_srv
=
other_sys
.
middleman
().
remote_actor_udp
(
"localhost"
,
12345
);
auto
other_srv
=
other_sys
.
middleman
().
remote_actor_udp
(
"localhost"
,
*
port
);
CAF_REQUIRE
(
other_srv
);
CAF_REQUIRE
(
other_srv
);
//
establish communication and exit
//
Establish communication and exit.
CAF_MESSAGE
(
"client contacts server and exits"
);
CAF_MESSAGE
(
"client contacts server and exits"
);
anon_send
(
other
,
*
other_srv
);
anon_send
(
other
,
*
other_srv
);
other_sys
.
await_all_actors_done
();
other_sys
.
await_all_actors_done
();
}
}
//
establish communication and exit
//
Start communicate from the first actor.
CAF_MESSAGE
(
"first client contacts server and exits"
);
CAF_MESSAGE
(
"first client contacts server and exits"
);
anon_send
(
client
,
*
client_srv
);
anon_send
(
client
,
*
client_srv
);
client_sys
.
await_all_actors_done
();
client_sys
.
await_all_actors_done
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment