Boost logo

Boost Users :

Subject: [Boost-users] [test] Init framework before dataset generation
From: Florian Lindner (mailinglists_at_[hidden])
Date: 2016-08-24 07:04:00


Hello,

I try to use boost test with data test cases:

std::vector<float> fibonacci() {
  std::cout << "Data Set" << std::endl;
  [...]
}

BOOST_DATA_TEST_CASE(datatest, boost::unit_test::data::make(fibonacci()), mapping)
{
  std::cout << "Datatype" << typeid(mapping).name() << std::endl;
}

The problem of that is, that fibonacci is initialized before anything else. The order of initializations is:

Data Set
main
init_unit_test
Global Fixture

That works fine here, but my fibonacci uses MPI which needs to initialized by MPI_Init. I want to do that initialization in the global fixture or int main or init_unit_tests, once for the entire test runner.

Is there anything I can do about that and belay initialization of Data Set after one of the others?

Thanks,
Florian


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net