osrm-backend/unit_tests/library/fixture.hpp

22 lines
522 B
C++
Raw Normal View History

#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.
2016-03-24 12:45:14 -04:00
inline osrm::OSRM getOSRM(const std::string &base_path)
{
2016-03-24 12:45:14 -04:00
osrm::EngineConfig config;
config.storage_config = {base_path};
config.use_shared_memory = false;
return osrm::OSRM{config};
}
#endif