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
827149d9
Commit
827149d9
authored
Apr 21, 2016
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add CLI query for test names to unit test binary
parent
99aad0ea
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
5 deletions
+23
-5
libcaf_test/caf/test/unit_test.hpp
libcaf_test/caf/test/unit_test.hpp
+2
-0
libcaf_test/caf/test/unit_test_impl.hpp
libcaf_test/caf/test/unit_test_impl.hpp
+21
-5
No files found.
libcaf_test/caf/test/unit_test.hpp
View file @
827149d9
...
@@ -305,6 +305,8 @@ public:
...
@@ -305,6 +305,8 @@ public:
static
std
::
vector
<
std
::
string
>
available_suites
();
static
std
::
vector
<
std
::
string
>
available_suites
();
static
std
::
vector
<
std
::
string
>
available_tests
(
const
std
::
string
&
suite
);
private:
private:
engine
()
=
default
;
engine
()
=
default
;
...
...
libcaf_test/caf/test/unit_test_impl.hpp
View file @
827149d9
...
@@ -514,9 +514,18 @@ test* engine::current_test() {
...
@@ -514,9 +514,18 @@ test* engine::current_test() {
std
::
vector
<
std
::
string
>
engine
::
available_suites
()
{
std
::
vector
<
std
::
string
>
engine
::
available_suites
()
{
std
::
vector
<
std
::
string
>
result
;
std
::
vector
<
std
::
string
>
result
;
for
(
auto
&
kvp
:
instance
().
suites_
)
{
for
(
auto
&
kvp
:
instance
().
suites_
)
result
.
push_back
(
kvp
.
first
);
result
.
push_back
(
kvp
.
first
);
}
return
result
;
}
std
::
vector
<
std
::
string
>
engine
::
available_tests
(
const
std
::
string
&
suite
)
{
std
::
vector
<
std
::
string
>
result
;
auto
i
=
instance
().
suites_
.
find
(
suite
);
if
(
i
==
instance
().
suites_
.
end
())
return
result
;
for
(
auto
&
ptr
:
i
->
second
)
result
.
push_back
(
ptr
->
name
());
return
result
;
return
result
;
}
}
...
@@ -546,6 +555,7 @@ int main(int argc, char** argv) {
...
@@ -546,6 +555,7 @@ int main(int argc, char** argv) {
std
::
string
not_suites
;
std
::
string
not_suites
;
std
::
string
tests
=
".*"
;
std
::
string
tests
=
".*"
;
std
::
string
not_tests
;
std
::
string
not_tests
;
std
::
string
suite_query
;
// use all arguments after '--' for the test engine.
// use all arguments after '--' for the test engine.
std
::
string
delimiter
=
"--"
;
std
::
string
delimiter
=
"--"
;
auto
divider
=
argc
;
auto
divider
=
argc
;
...
@@ -570,17 +580,23 @@ int main(int argc, char** argv) {
...
@@ -570,17 +580,23 @@ int main(int argc, char** argv) {
{
"not-suites,S"
,
"exclude suites"
,
not_suites
},
{
"not-suites,S"
,
"exclude suites"
,
not_suites
},
{
"tests,t"
,
"set tests"
,
tests
},
{
"tests,t"
,
"set tests"
,
tests
},
{
"not-tests,T"
,
"exclude tests"
,
not_tests
},
{
"not-tests,T"
,
"exclude tests"
,
not_tests
},
{
"available-suites,a"
,
"print available suites"
}
{
"available-suites,a"
,
"print available suites"
},
{
"available-tests,A"
,
"print available tests for given suite"
,
suite_query
}
});
});
if
(
res
.
opts
.
count
(
"help"
)
>
0
)
{
if
(
res
.
opts
.
count
(
"help"
)
>
0
)
{
std
::
cout
<<
res
.
helptext
<<
std
::
endl
;
std
::
cout
<<
res
.
helptext
<<
std
::
endl
;
return
0
;
return
0
;
}
}
if
(
!
suite_query
.
empty
())
{
std
::
cout
<<
"available tests in suite "
<<
suite_query
<<
":"
<<
std
::
endl
;
for
(
auto
&
t
:
engine
::
available_tests
(
suite_query
))
std
::
cout
<<
" - "
<<
t
<<
std
::
endl
;
return
0
;
}
if
(
res
.
opts
.
count
(
"available-suites"
)
>
0
)
{
if
(
res
.
opts
.
count
(
"available-suites"
)
>
0
)
{
std
::
cout
<<
"available suites:"
<<
std
::
endl
;
std
::
cout
<<
"available suites:"
<<
std
::
endl
;
for
(
auto
&
s
:
engine
::
available_suites
())
{
for
(
auto
&
s
:
engine
::
available_suites
())
std
::
cout
<<
" - "
<<
s
<<
std
::
endl
;
std
::
cout
<<
" - "
<<
s
<<
std
::
endl
;
}
return
0
;
return
0
;
}
}
if
(
!
res
.
remainder
.
empty
())
{
if
(
!
res
.
remainder
.
empty
())
{
...
...
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