LCOV - code coverage report
Current view: top level - test - MatrixTest.h (source / functions) Hit Total Coverage
Test: coverage.info.cleaned Lines: 13 13 100.0 %
Date: 2016-06-29 12:30:40 Functions: 4 5 80.0 %

          Line data    Source code
       1             : #ifndef DASH__TEST__MATRIX_TEST_H_
       2             : #define DASH__TEST__MATRIX_TEST_H_
       3             : 
       4             : #include <gtest/gtest.h>
       5             : #include <libdash.h>
       6             : 
       7             : #include <string>
       8             : 
       9             : /**
      10             :  * Test fixture for class dash::Matrix
      11             :  */
      12             : class MatrixTest : public ::testing::Test {
      13             : protected:
      14             :   size_t _dash_id;
      15             :   size_t _dash_size;
      16             : 
      17          60 :   MatrixTest()
      18             :   : _dash_id(0),
      19          60 :     _dash_size(0) {
      20             :     LOG_MESSAGE(">>> Test suite: MatrixTest");
      21             :     LOG_MESSAGE(">>> Hostname: %s PID: %d", _hostname().c_str(), _pid());
      22          60 :   }
      23             : 
      24          60 :   virtual ~MatrixTest() {
      25             :     LOG_MESSAGE("<<< Closing test suite: MatrixTest");
      26          60 :   }
      27             : 
      28          60 :   virtual void SetUp() {
      29          60 :     dash::Team::All().barrier();
      30          60 :     _dash_id   = dash::myid();
      31          60 :     _dash_size = dash::size();
      32             :     LOG_MESSAGE("===> Running test case with %d units ...",
      33             :                 _dash_size);
      34          60 :   }
      35             : 
      36          60 :   virtual void TearDown() {
      37          60 :     dash::Team::All().barrier();
      38             :     LOG_MESSAGE("<=== Finished test case with %d units",
      39             :                 _dash_size);
      40          60 :   }
      41             : 
      42             : protected:
      43             :   std::string _hostname() {
      44             :     char hostname[100];
      45             :     gethostname(hostname, 100);
      46             :     return std::string(hostname);
      47             :   }
      48             : 
      49             :   int _pid() {
      50             :     return static_cast<int>(getpid());
      51             :   }
      52             : 
      53             : };
      54             : 
      55             : #endif // DASH__TEST__MATRIX_TEST_H_

Generated by: LCOV version 1.12