Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Guilhem Saurel
dynamic-graph
Commits
1bcf9a54
Commit
1bcf9a54
authored
Jul 24, 2019
by
Olivier Stasse
Browse files
Add test to follow multi-threading.
parent
d5ad4065
Pipeline
#10176
failed with stage
in 2 minutes and 23 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
tests/test-mt.cpp
0 → 100644
View file @
1bcf9a54
/* Copyright 2019, LAAS-CNRS
*
* Olivier Stasse
*
*/
#include
<sstream>
#include
<fstream>
#include
<iostream>
#include
<unistd.h>
#include
<dynamic-graph/process-list.hh>
#define BOOST_TEST_MODULE debug-trace
#include
<boost/test/unit_test.hpp>
#include
<boost/test/output_test_stream.hpp>
using
boost
::
test_tools
::
output_test_stream
;
BOOST_AUTO_TEST_CASE
(
testMt
)
{
dynamicgraph
::
CPU
::
System
aSystem
;
// create and open a character archive for output
std
::
ofstream
ofs
(
"cpu_state.dat"
);
boost
::
archive
::
text_oarchive
oa
(
ofs
);
oa
<<
aSystem
;
for
(
unsigned
int
i
=
0
;
i
<
10
;
i
++
)
{
usleep
(
100000
);
aSystem
.
readProcStat
();
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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