OpenFPM_pdata  1.1.0
Project that contain the implementation of distributed structures
 All Data Structures Namespaces Functions Variables Typedefs Enumerations Friends Pages
unit_test_init_cleanup.hpp
1 /*
2  * unit_test_init_cleanup.hpp
3  *
4  * Created on: Apr 17, 2015
5  * Author: Pietro Incardona
6  */
7 
8 #ifndef UNIT_TEST_INIT_CLEANUP_HPP_
9 #define UNIT_TEST_INIT_CLEANUP_HPP_
10 
12 struct ut_start
13 {
14 
17  {
18 #ifdef PERFORMANCE_TEST
19  test_dir = getenv("OPENFPM_PERFORMANCE_TEST_DIR");
20 
21  if (test_dir == NULL)
22  {
23  std::cerr << "Error: " __FILE__ << ":" << __LINE__ << " in order to run the performance test you must set the environment variable $OPENFPM_PERFORMANCE_TEST_DIR to the test or an empty directory";
24  exit(1);
25  }
26 #endif
27 
28  }
29 
32  {
33 #ifdef PERFORMANCE_TEST
34  write_performance_report();
35 #endif
36  }
37 };
38 
39 //____________________________________________________________________________//
40 
41 BOOST_GLOBAL_FIXTURE( ut_start );
42 
43 
44 
45 #endif /* UNIT_TEST_INIT_CLEANUP_HPP_ */
ut_start()
start procedure before running the test
boost unit test fixation (start procedure to call before testing)
~ut_start()
post procedure to call after the test