GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: tests/test-mt.cpp Lines: 9 9 100.0 %
Date: 2023-03-15 12:04:10 Branches: 41 80 51.2 %

Line Branch Exec Source
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
















4
BOOST_AUTO_TEST_CASE(testMt) {
25
4
  dynamicgraph::CPU::System aSystem;
26
27
  // create and open a character archive for output
28
4
  std::ofstream ofs("cpu_state.dat");
29
4
  boost::archive::text_oarchive oa(ofs);
30
2
  oa << aSystem;
31
32
22
  for (unsigned int i = 0; i < 10; i++) {
33
20
    usleep(100000);
34
20
    aSystem.readProcStat();
35
  }
36
2
}