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
f4a65655
Commit
f4a65655
authored
Jul 28, 2015
by
Matthias Vallentin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Repair unit test watchdog parameterization
parent
72833346
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
libcaf_test/caf/test/unit_test_impl.hpp
libcaf_test/caf/test/unit_test_impl.hpp
+10
-9
No files found.
libcaf_test/caf/test/unit_test_impl.hpp
View file @
f4a65655
...
...
@@ -39,14 +39,14 @@ namespace test {
class
watchdog
{
public:
static
void
start
();
static
void
start
(
int
secs
);
static
void
stop
();
private:
watchdog
()
{
thread_
=
std
::
thread
{[
&
]
{
watchdog
(
int
secs
)
{
thread_
=
std
::
thread
{[
=
]
{
auto
tp
=
std
::
chrono
::
high_resolution_clock
::
now
()
+
std
::
chrono
::
seconds
(
30
);
std
::
chrono
::
high_resolution_clock
::
now
()
+
std
::
chrono
::
seconds
(
secs
);
std
::
unique_lock
<
std
::
mutex
>
guard
{
mtx_
};
while
(
!
canceled_
&&
cv_
.
wait_until
(
guard
,
tp
)
!=
std
::
cv_status
::
timeout
)
{
...
...
@@ -54,7 +54,8 @@ private:
}
if
(
!
canceled_
)
{
logger
::
instance
().
error
()
<<
"WATCHDOG: unit test did finish within 10s, abort
\n
"
;
<<
"WATCHDOG: unit test did not finish within "
<<
secs
<<
"s, abort
\n
"
;
abort
();
}
}};
...
...
@@ -76,8 +77,8 @@ private:
namespace
{
watchdog
*
s_watchdog
;
}
void
watchdog
::
start
()
{
s_watchdog
=
new
watchdog
();
void
watchdog
::
start
(
int
secs
)
{
s_watchdog
=
new
watchdog
(
secs
);
}
void
watchdog
::
stop
()
{
...
...
@@ -263,7 +264,7 @@ bool engine::run(bool colorize,
const
std
::
string
&
log_file
,
int
verbosity_console
,
int
verbosity_file
,
int
,
// TODO: max runtime
int
max_runtime
,
const
std
::
string
&
suites_str
,
const
std
::
string
&
not_suites_str
,
const
std
::
string
&
tests_str
,
...
...
@@ -359,7 +360,7 @@ bool engine::run(bool colorize,
log
.
verbose
()
<<
color
(
yellow
)
<<
"- "
<<
color
(
reset
)
<<
t
->
name
()
<<
'\n'
;
auto
start
=
std
::
chrono
::
high_resolution_clock
::
now
();
watchdog
::
start
();
watchdog
::
start
(
max_runtime
);
try
{
t
->
run
();
}
catch
(
const
detail
::
require_error
&
)
{
...
...
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