2016-03-16 07:42:26 -04:00
|
|
|
#ifndef OSRM_UNIT_TEST_ARGS
|
|
|
|
#define OSRM_UNIT_TEST_ARGS
|
|
|
|
|
|
|
|
#include <string>
|
2016-05-27 15:05:04 -04:00
|
|
|
#include <vector>
|
2017-02-13 09:58:46 -05:00
|
|
|
#include <iostream>
|
2016-03-16 07:42:26 -04:00
|
|
|
|
|
|
|
inline std::vector<std::string> get_args()
|
|
|
|
{
|
|
|
|
// Split off argv[0], store actual positional arguments in args
|
|
|
|
const auto argc = boost::unit_test::framework::master_test_suite().argc - 1;
|
|
|
|
const auto argv = boost::unit_test::framework::master_test_suite().argv + 1;
|
|
|
|
|
2017-02-13 09:58:46 -05:00
|
|
|
if (argc == 0)
|
|
|
|
{
|
|
|
|
std::cout << "You must provide a path to the test data, please see the unit testing docs" << std::endl;
|
|
|
|
}
|
|
|
|
|
2016-03-16 07:42:26 -04:00
|
|
|
return {argv, argv + argc};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|