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
0f9b3685
Commit
0f9b3685
authored
Oct 02, 2020
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Restore ref-syncing for config file input
parent
4f8609bd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
1 deletion
+43
-1
CHANGELOG.md
CHANGELOG.md
+4
-0
libcaf_core/src/detail/config_consumer.cpp
libcaf_core/src/detail/config_consumer.cpp
+1
-1
libcaf_core/test/actor_system_config.cpp
libcaf_core/test/actor_system_config.cpp
+38
-0
No files found.
CHANGELOG.md
View file @
0f9b3685
...
@@ -19,6 +19,10 @@ is based on [Keep a Changelog](https://keepachangelog.com).
...
@@ -19,6 +19,10 @@ is based on [Keep a Changelog](https://keepachangelog.com).
### Fixed
### Fixed
-
Setting an invalid credit policy no longer results in a segfault (#1140).
-
Setting an invalid credit policy no longer results in a segfault (#1140).
-
RC 1 of version 0.18 introduced a regression that prevented CAF from writing
parameters parsed from configuration files back to variables. The original
behavior has been restored, i.e., variables synchronize with user input from
configuration files and CLI arguments (#1145).
## [0.18.0-rc.1] - 2020-09-09
## [0.18.0-rc.1] - 2020-09-09
...
...
libcaf_core/src/detail/config_consumer.cpp
View file @
0f9b3685
...
@@ -129,7 +129,7 @@ void config_consumer::end_map() {
...
@@ -129,7 +129,7 @@ void config_consumer::end_map() {
}
}
std
::
string
config_consumer
::
qualified_key
()
{
std
::
string
config_consumer
::
qualified_key
()
{
if
(
category_
.
empty
())
if
(
category_
.
empty
()
||
category_
==
"global"
)
return
current_key_
;
return
current_key_
;
auto
result
=
category_
;
auto
result
=
category_
;
result
+=
'.'
;
result
+=
'.'
;
...
...
libcaf_core/test/actor_system_config.cpp
View file @
0f9b3685
...
@@ -118,6 +118,44 @@ CAF_TEST(parsing - with CLI cfg.remainder) {
...
@@ -118,6 +118,44 @@ CAF_TEST(parsing - with CLI cfg.remainder) {
CAF_MESSAGE
(
"invalid cfg.remainder"
);
CAF_MESSAGE
(
"invalid cfg.remainder"
);
}
}
CAF_TEST
(
file
input
overrides
defaults
but
CLI
args
always
win
)
{
const
char
*
file_input
=
R"__(
group1 {
arg1 = 'foobar'
}
group2 {
arg1 = 'hello world'
arg2 = 2
}
)__"
;
struct
grp
{
std
::
string
arg1
=
"default"
;
int
arg2
=
42
;
};
grp
grp1
;
grp
grp2
;
config_option_adder
{
cfg
.
custom_options
(),
"group1"
}
.
add
(
grp1
.
arg1
,
"arg1"
,
""
)
.
add
(
grp1
.
arg2
,
"arg2"
,
""
);
config_option_adder
{
cfg
.
custom_options
(),
"group2"
}
.
add
(
grp2
.
arg1
,
"arg1"
,
""
)
.
add
(
grp2
.
arg2
,
"arg2"
,
""
);
string_list
args
{
"--group1.arg2=123"
,
"--group2.arg1=bye"
};
std
::
istringstream
input
{
file_input
};
auto
err
=
cfg
.
parse
(
std
::
move
(
args
),
input
);
CAF_CHECK_EQUAL
(
err
,
error
{});
CAF_CHECK_EQUAL
(
grp1
.
arg1
,
"foobar"
);
CAF_CHECK_EQUAL
(
grp1
.
arg2
,
123
);
CAF_CHECK_EQUAL
(
grp2
.
arg1
,
"bye"
);
CAF_CHECK_EQUAL
(
grp2
.
arg2
,
2
);
settings
res
;
put
(
res
,
"group1.arg1"
,
"foobar"
);
put
(
res
,
"group1.arg2"
,
123
);
put
(
res
,
"group2.arg1"
,
"bye"
);
put
(
res
,
"group2.arg2"
,
2
);
CAF_CHECK_EQUAL
(
content
(
cfg
),
res
);
}
// Checks whether both a synced variable and the corresponding entry in
// Checks whether both a synced variable and the corresponding entry in
// content(cfg) are equal to `value`.
// content(cfg) are equal to `value`.
#define CHECK_SYNCED(var, value) \
#define CHECK_SYNCED(var, value) \
...
...
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