2016-03-16 09:53:14 -04:00
|
|
|
#ifndef OSRM_LIBRARY_TEST_FIXTURE
|
|
|
|
#define OSRM_LIBRARY_TEST_FIXTURE
|
|
|
|
|
|
|
|
#include "osrm/engine_config.hpp"
|
|
|
|
#include "osrm/osrm.hpp"
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
// I couldn't get Boost.UnitTest to provide a test suite level fixture with custom
|
|
|
|
// arguments per test suite (osrm base path from argv), so this has to suffice.
|
|
|
|
|
2017-06-05 18:58:50 -04:00
|
|
|
inline osrm::OSRM
|
|
|
|
getOSRM(const std::string &base_path,
|
|
|
|
osrm::EngineConfig::Algorithm algorithm = osrm::EngineConfig::Algorithm::CH)
|
2016-03-16 09:53:14 -04:00
|
|
|
{
|
2016-03-24 12:45:14 -04:00
|
|
|
osrm::EngineConfig config;
|
2017-06-16 04:45:24 -04:00
|
|
|
config.storage_config.UseDefaultOutputNames(base_path);
|
2016-03-16 09:53:14 -04:00
|
|
|
config.use_shared_memory = false;
|
2017-06-05 18:58:50 -04:00
|
|
|
config.algorithm = algorithm;
|
2016-03-16 09:53:14 -04:00
|
|
|
|
|
|
|
return osrm::OSRM{config};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|