tests
test-mt.cpp
Go to the documentation of this file.
1
/* Copyright 2019, LAAS-CNRS
2
*
3
* Olivier Stasse
4
*
5
*/
6
#include <unistd.h>
7
8
#include <
dynamic-graph/process-list.hh
>
9
#include <fstream>
10
#include <iostream>
11
#include <sstream>
12
13
#define BOOST_TEST_MODULE debug - trace
14
15
#if BOOST_VERSION >= 105900
16
#include <boost/test/tools/output_test_stream.hpp>
17
#else
18
#include <boost/test/output_test_stream.hpp>
19
#endif
20
#include <boost/test/unit_test.hpp>
21
22
using
boost::test_tools::output_test_stream;
23
24
BOOST_AUTO_TEST_CASE
(testMt) {
25
dynamicgraph::CPU::System
aSystem;
26
27
// create and open a character archive for output
28
std::ofstream ofs(
"cpu_state.dat"
);
29
boost::archive::text_oarchive oa(ofs);
30
oa << aSystem;
31
32
for
(
unsigned
int
i = 0; i < 10; i++) {
33
usleep(100000);
34
aSystem.readProcStat();
35
}
36
}
dynamicgraph::CPU::System
Definition:
process-list.hh:128
process-list.hh
BOOST_AUTO_TEST_CASE
BOOST_AUTO_TEST_CASE(testMt)
Definition:
test-mt.cpp:24
dynamic-graph
Author(s): Nicolas Mansard, Olivier Stasse
autogenerated on Fri Aug 2 2024 08:36:38