Hardcode path to test data dir for library-tests

This was needed because we now need multiple datasets for testing.
CMake will automatically prepare these over the makefile in test/data.
This commit is contained in:
Patrick Niklaus 2017-03-05 22:53:41 +00:00 committed by Patrick Niklaus
parent 8ad9a0aa9a
commit fc9b5938e6
12 changed files with 77 additions and 158 deletions

View File

@ -195,13 +195,11 @@ install:
script: script:
- if [[ $TARGET_ARCH == armhf ]] ; then echo "Skip tests for $TARGET_ARCH" && exit 0 ; fi - if [[ $TARGET_ARCH == armhf ]] ; then echo "Skip tests for $TARGET_ARCH" && exit 0 ; fi
- echo "travis_fold:start:BENCHMARK"
- make -C test/data benchmark - make -C test/data benchmark
- echo "travis_fold:end:BENCHMARK"
- ./example/build/osrm-example test/data/monaco.osrm - ./example/build/osrm-example test/data/monaco.osrm
# All tests assume to be run from the build directory # All tests assume to be run from the build directory
- pushd ${OSRM_BUILD_DIR} - pushd ${OSRM_BUILD_DIR}
- ./unit_tests/library-tests ../test/data/monaco.osrm - ./unit_tests/library-tests
- ./unit_tests/extractor-tests - ./unit_tests/extractor-tests
- ./unit_tests/engine-tests - ./unit_tests/engine-tests
- ./unit_tests/util-tests - ./unit_tests/util-tests

View File

@ -13,40 +13,59 @@ MD5SUM:=$(SCRIPT_ROOT)/md5sum.js
TIMER:=$(SCRIPT_ROOT)/timer.sh TIMER:=$(SCRIPT_ROOT)/timer.sh
PROFILE:=$(PROFILE_ROOT)/car.lua PROFILE:=$(PROFILE_ROOT)/car.lua
all: $(DATA_NAME).osrm.hsgr $(DATA_NAME).osrm.partition all: data
data: $(DATA_NAME)_CH.osrm.hsgr $(DATA_NAME)_CoreCH.osrm.hsgr $(DATA_NAME)_MLD.osrm.partition
clean: clean:
-rm $(DATA_NAME).* -rm $(DATA_NAME).*
-rm $(DATA_NAME)_*
$(DATA_NAME).osm.pbf: $(DATA_NAME).osm.pbf:
wget $(DATA_URL) -O $(DATA_NAME).osm.pbf wget $(DATA_URL) -O $(DATA_NAME).osm.pbf
$(DATA_NAME)_%.osm.pbf: $(DATA_NAME).osm.pbf
cp $< $@
$(DATA_NAME).poly: $(DATA_NAME).poly:
wget $(DATA_POLY_URL) -O $(DATA_NAME).poly wget $(DATA_POLY_URL) -O $(DATA_NAME).poly
$(DATA_NAME).osrm: $(DATA_NAME).osm.pbf $(DATA_NAME).poly $(PROFILE) $(OSRM_EXTRACT) $(DATA_NAME)_%.osrm: $(DATA_NAME)_%.osm.pbf $(DATA_NAME).poly $(PROFILE) $(OSRM_EXTRACT)
@echo "Verifiyng data file integrity..." @echo "Verifiyng data file integrity..."
$(MD5SUM) -c data.md5sum $(MD5SUM) -c data.md5sum
@echo "Running osrm-extract..." @echo "Running osrm-extract..."
$(TIMER) "osrm-extract" $(OSRM_EXTRACT) $(DATA_NAME).osm.pbf -p $(PROFILE) $(TIMER) "osrm-extract" $(OSRM_EXTRACT) $< -p $(PROFILE)
$(DATA_NAME).osrm.hsgr: $(DATA_NAME).osrm $(PROFILE) $(OSRM_CONTRACT) $(DATA_NAME)_CH.osrm.hsgr: $(DATA_NAME)_CH.osrm $(PROFILE) $(OSRM_CONTRACT)
@echo "Running osrm-contract..." @echo "Running osrm-contract..."
$(TIMER) "osrm-contract" $(OSRM_CONTRACT) $(DATA_NAME).osrm $(TIMER) "osrm-contract" $(OSRM_CONTRACT) $<
$(DATA_NAME).osrm.partition: $(DATA_NAME).osrm $(PROFILE) $(OSRM_PARTITION) $(DATA_NAME)_CoreCH.osrm.hsgr: $(DATA_NAME)_CoreCH.osrm $(PROFILE) $(OSRM_CONTRACT)
@echo "Running osrm-contract..."
$(TIMER) "osrm-contract" $(OSRM_CONTRACT) --core=0.95 $<
$(DATA_NAME)_MLD.osrm.partition: $(DATA_NAME)_MLD.osrm $(PROFILE) $(OSRM_PARTITION)
@echo "Running osrm-partition..." @echo "Running osrm-partition..."
$(TIMER) "osrm-partition" $(OSRM_PARTITION) $(DATA_NAME).osrm $(TIMER) "osrm-contract" $(OSRM_CONTRACT) $<
$(TIMER) "osrm-partition" $(OSRM_PARTITION) $<
$(DATA_NAME).requests: $(DATA_NAME).poly $(DATA_NAME).requests: $(DATA_NAME).poly
$(POLY2REQ) $(DATA_NAME).poly > $(DATA_NAME).requests $(POLY2REQ) $(DATA_NAME).poly > $(DATA_NAME).requests
osrm-routed.pid: $(DATA_NAME).osrm.hsgr benchmark: data $(DATA_NAME).requests
@/bin/sh -c '$(OSRM_ROUTED) $(DATA_NAME).osrm& echo "$$!" > osrm-routed.pid'
sleep 1
benchmark: $(DATA_NAME).requests osrm-routed.pid
@echo "Running benchmark..." @echo "Running benchmark..."
@/bin/sh -c '$(OSRM_ROUTED) --algorithm=CH $(DATA_NAME)_CH.osrm& echo "$$!" > osrm-routed.pid'
@sleep 1
$(TIMER) "queries" "cat $(DATA_NAME).requests | xargs curl &> /dev/null"
@cat osrm-routed.pid | xargs kill
@rm osrm-routed.pid
@/bin/sh -c '$(OSRM_ROUTED) --algorithm=CoreCH $(DATA_NAME)_CoreCH.osrm& echo "$$!" > osrm-routed.pid'
@sleep 1
$(TIMER) "queries" "cat $(DATA_NAME).requests | xargs curl &> /dev/null"
@cat osrm-routed.pid | xargs kill
@rm osrm-routed.pid
@/bin/sh -c '$(OSRM_ROUTED) --algorithm=MLD $(DATA_NAME)_MLD.osrm& echo "$$!" > osrm-routed.pid'
@sleep 1
$(TIMER) "queries" "cat $(DATA_NAME).requests | xargs curl &> /dev/null" $(TIMER) "queries" "cat $(DATA_NAME).requests | xargs curl &> /dev/null"
@cat osrm-routed.pid | xargs kill @cat osrm-routed.pid | xargs kill
@rm osrm-routed.pid @rm osrm-routed.pid

View File

@ -22,7 +22,6 @@ file(GLOB UtilTestsSources
util_tests.cpp util_tests.cpp
util/*.cpp) util/*.cpp)
add_executable(engine-tests add_executable(engine-tests
EXCLUDE_FROM_ALL EXCLUDE_FROM_ALL
${EngineTestsSources} ${EngineTestsSources}
@ -57,14 +56,18 @@ if(NOT WIN32 AND NOT Boost_USE_STATIC_LIBS)
add_definitions(-DBOOST_TEST_DYN_LINK) add_definitions(-DBOOST_TEST_DYN_LINK)
endif() endif()
set(TEST_DATA_DIR "${CMAKE_SOURCE_DIR}/test/data")
add_dependencies(library-tests osrm-extract osrm-contract osrm-partition)
add_custom_command(TARGET library-tests POST_BUILD COMMAND make -C ${TEST_DATA_DIR})
target_compile_definitions(extractor-tests PRIVATE COMPILE_DEFINITIONS OSRM_FIXTURES_DIR="${CMAKE_SOURCE_DIR}/unit_tests/fixtures") target_compile_definitions(extractor-tests PRIVATE COMPILE_DEFINITIONS OSRM_FIXTURES_DIR="${CMAKE_SOURCE_DIR}/unit_tests/fixtures")
target_compile_definitions(library-tests PRIVATE COMPILE_DEFINITIONS OSRM_TEST_DATA_DIR="${TEST_DATA_DIR}")
target_include_directories(engine-tests PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) target_include_directories(engine-tests PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_include_directories(library-tests PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) target_include_directories(library-tests PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_include_directories(util-tests PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) target_include_directories(util-tests PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_include_directories(partition-tests PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) target_include_directories(partition-tests PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(engine-tests ${ENGINE_LIBRARIES} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) target_link_libraries(engine-tests ${ENGINE_LIBRARIES} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
target_link_libraries(extractor-tests ${EXTRACTOR_LIBRARIES} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) target_link_libraries(extractor-tests ${EXTRACTOR_LIBRARIES} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
target_link_libraries(partition-tests ${PARTITIONER_LIBRARIES} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) target_link_libraries(partition-tests ${PARTITIONER_LIBRARIES} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
@ -72,7 +75,5 @@ target_link_libraries(library-tests osrm ${ENGINE_LIBRARIES} ${Boost_UNIT_TEST_F
target_link_libraries(server-tests osrm ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) target_link_libraries(server-tests osrm ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
target_link_libraries(util-tests ${UTIL_LIBRARIES} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) target_link_libraries(util-tests ${UTIL_LIBRARIES} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
add_custom_target(tests add_custom_target(tests
DEPENDS DEPENDS engine-tests extractor-tests partition-tests library-tests server-tests util-tests)
engine-tests extractor-tests partition-tests library-tests server-tests util-tests)

View File

@ -1,32 +0,0 @@
#ifndef OSRM_UNIT_TEST_ARGS
#define OSRM_UNIT_TEST_ARGS
#include "util/log.hpp"
#include <boost/filesystem.hpp>
#include <iostream>
#include <iostream>
#include <string>
#include <vector>
inline std::vector<std::string> get_args()
{
osrm::util::LogPolicy::GetInstance().Unmute();
if ((boost::unit_test::framework::master_test_suite().argc != 2) ||
(!boost::filesystem::is_regular_file(
boost::unit_test::framework::master_test_suite().argv[1])))
{
osrm::util::Log(logERROR) << "Please provide valid input osrm file";
osrm::util::Log(logERROR) << "Usage: "
<< boost::unit_test::framework::master_test_suite().argv[0]
<< " /path/to/input_osrm_file" << std::endl;
std::exit(EXIT_FAILURE);
}
// 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;
return {argv, argv + argc};
}
#endif

View File

@ -1,8 +1,6 @@
#include <boost/test/test_case_template.hpp> #include <boost/test/test_case_template.hpp>
#include <boost/test/unit_test.hpp> #include <boost/test/unit_test.hpp>
#include "args.hpp"
#include "osrm/match_parameters.hpp" #include "osrm/match_parameters.hpp"
#include "osrm/nearest_parameters.hpp" #include "osrm/nearest_parameters.hpp"
#include "osrm/route_parameters.hpp" #include "osrm/route_parameters.hpp"
@ -27,13 +25,10 @@ BOOST_AUTO_TEST_SUITE(limits)
BOOST_AUTO_TEST_CASE(test_trip_limits) BOOST_AUTO_TEST_CASE(test_trip_limits)
{ {
const auto args = get_args();
BOOST_REQUIRE_EQUAL(args.size(), 1);
using namespace osrm; using namespace osrm;
EngineConfig config; EngineConfig config;
config.storage_config = {args[0]}; config.storage_config = {OSRM_TEST_DATA_DIR "/monaco_CH.osrm"};
config.use_shared_memory = false; config.use_shared_memory = false;
config.max_locations_trip = 2; config.max_locations_trip = 2;
@ -57,13 +52,10 @@ BOOST_AUTO_TEST_CASE(test_trip_limits)
BOOST_AUTO_TEST_CASE(test_route_limits) BOOST_AUTO_TEST_CASE(test_route_limits)
{ {
const auto args = get_args();
BOOST_REQUIRE_EQUAL(args.size(), 1);
using namespace osrm; using namespace osrm;
EngineConfig config; EngineConfig config;
config.storage_config = {args[0]}; config.storage_config = {OSRM_TEST_DATA_DIR "/monaco_CH.osrm"};
config.use_shared_memory = false; config.use_shared_memory = false;
config.max_locations_viaroute = 2; config.max_locations_viaroute = 2;
@ -87,13 +79,10 @@ BOOST_AUTO_TEST_CASE(test_route_limits)
BOOST_AUTO_TEST_CASE(test_table_limits) BOOST_AUTO_TEST_CASE(test_table_limits)
{ {
const auto args = get_args();
BOOST_REQUIRE_EQUAL(args.size(), 1);
using namespace osrm; using namespace osrm;
EngineConfig config; EngineConfig config;
config.storage_config = {args[0]}; config.storage_config = {OSRM_TEST_DATA_DIR "/monaco_CH.osrm"};
config.use_shared_memory = false; config.use_shared_memory = false;
config.max_locations_distance_table = 2; config.max_locations_distance_table = 2;
@ -117,13 +106,10 @@ BOOST_AUTO_TEST_CASE(test_table_limits)
BOOST_AUTO_TEST_CASE(test_match_limits) BOOST_AUTO_TEST_CASE(test_match_limits)
{ {
const auto args = get_args();
BOOST_REQUIRE_EQUAL(args.size(), 1);
using namespace osrm; using namespace osrm;
EngineConfig config; EngineConfig config;
config.storage_config = {args[0]}; config.storage_config = {OSRM_TEST_DATA_DIR "/monaco_CH.osrm"};
config.use_shared_memory = false; config.use_shared_memory = false;
config.max_locations_map_matching = 2; config.max_locations_map_matching = 2;
@ -147,13 +133,10 @@ BOOST_AUTO_TEST_CASE(test_match_limits)
BOOST_AUTO_TEST_CASE(test_nearest_limits) BOOST_AUTO_TEST_CASE(test_nearest_limits)
{ {
const auto args = get_args();
BOOST_REQUIRE_EQUAL(args.size(), 1);
using namespace osrm; using namespace osrm;
EngineConfig config; EngineConfig config;
config.storage_config = {args[0]}; config.storage_config = {OSRM_TEST_DATA_DIR "/monaco_CH.osrm"};
config.use_shared_memory = false; config.use_shared_memory = false;
config.max_results_nearest = 2; config.max_results_nearest = 2;

View File

@ -1,7 +1,6 @@
#include <boost/test/test_case_template.hpp> #include <boost/test/test_case_template.hpp>
#include <boost/test/unit_test.hpp> #include <boost/test/unit_test.hpp>
#include "args.hpp"
#include "coordinates.hpp" #include "coordinates.hpp"
#include "fixture.hpp" #include "fixture.hpp"
#include "waypoint_check.hpp" #include "waypoint_check.hpp"
@ -18,12 +17,9 @@ BOOST_AUTO_TEST_SUITE(match)
BOOST_AUTO_TEST_CASE(test_match) BOOST_AUTO_TEST_CASE(test_match)
{ {
const auto args = get_args();
BOOST_REQUIRE_EQUAL(args.size(), 1);
using namespace osrm; using namespace osrm;
auto osrm = getOSRM(args[0]); auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/monaco_CH.osrm");
MatchParameters params; MatchParameters params;
params.coordinates.push_back(get_dummy_location()); params.coordinates.push_back(get_dummy_location());

View File

@ -1,7 +1,6 @@
#include <boost/test/test_case_template.hpp> #include <boost/test/test_case_template.hpp>
#include <boost/test/unit_test.hpp> #include <boost/test/unit_test.hpp>
#include "args.hpp"
#include "coordinates.hpp" #include "coordinates.hpp"
#include "fixture.hpp" #include "fixture.hpp"
@ -17,8 +16,7 @@ BOOST_AUTO_TEST_SUITE(nearest)
BOOST_AUTO_TEST_CASE(test_nearest_response) BOOST_AUTO_TEST_CASE(test_nearest_response)
{ {
const auto args = get_args(); auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/monaco_CH.osrm");
auto osrm = getOSRM(args.at(0));
using namespace osrm; using namespace osrm;
@ -45,8 +43,7 @@ BOOST_AUTO_TEST_CASE(test_nearest_response)
BOOST_AUTO_TEST_CASE(test_nearest_response_no_coordinates) BOOST_AUTO_TEST_CASE(test_nearest_response_no_coordinates)
{ {
const auto args = get_args(); auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/monaco_CH.osrm");
auto osrm = getOSRM(args.at(0));
using namespace osrm; using namespace osrm;
@ -62,8 +59,7 @@ BOOST_AUTO_TEST_CASE(test_nearest_response_no_coordinates)
BOOST_AUTO_TEST_CASE(test_nearest_response_multiple_coordinates) BOOST_AUTO_TEST_CASE(test_nearest_response_multiple_coordinates)
{ {
const auto args = get_args(); auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/monaco_CH.osrm");
auto osrm = getOSRM(args.at(0));
using namespace osrm; using namespace osrm;
@ -81,8 +77,7 @@ BOOST_AUTO_TEST_CASE(test_nearest_response_multiple_coordinates)
BOOST_AUTO_TEST_CASE(test_nearest_response_for_location_in_small_component) BOOST_AUTO_TEST_CASE(test_nearest_response_for_location_in_small_component)
{ {
const auto args = get_args(); auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/monaco_CH.osrm");
auto osrm = getOSRM(args.at(0));
using namespace osrm; using namespace osrm;

View File

@ -1,7 +1,6 @@
#include <boost/test/test_case_template.hpp> #include <boost/test/test_case_template.hpp>
#include <boost/test/unit_test.hpp> #include <boost/test/unit_test.hpp>
#include "args.hpp"
#include "coordinates.hpp" #include "coordinates.hpp"
#include "equal_json.hpp" #include "equal_json.hpp"
#include "fixture.hpp" #include "fixture.hpp"
@ -12,33 +11,30 @@ BOOST_AUTO_TEST_SUITE(options)
BOOST_AUTO_TEST_CASE(test_ch) BOOST_AUTO_TEST_CASE(test_ch)
{ {
const auto args = get_args();
using namespace osrm; using namespace osrm;
EngineConfig config; EngineConfig config;
config.storage_config = storage::StorageConfig(args.at(0)); config.use_shared_memory = false;
config.storage_config = storage::StorageConfig(OSRM_TEST_DATA_DIR "/monaco_CH.osrm");
config.algorithm = EngineConfig::Algorithm::CH; config.algorithm = EngineConfig::Algorithm::CH;
OSRM osrm{config}; OSRM osrm{config};
} }
BOOST_AUTO_TEST_CASE(test_corech) BOOST_AUTO_TEST_CASE(test_corech)
{ {
const auto args = get_args();
using namespace osrm; using namespace osrm;
EngineConfig config; EngineConfig config;
config.storage_config = storage::StorageConfig(args.at(0)); config.use_shared_memory = false;
config.storage_config = storage::StorageConfig(OSRM_TEST_DATA_DIR "/monaco_CoreCH.osrm");
config.algorithm = EngineConfig::Algorithm::CoreCH; config.algorithm = EngineConfig::Algorithm::CoreCH;
OSRM osrm{config}; OSRM osrm{config};
} }
BOOST_AUTO_TEST_CASE(test_mld) BOOST_AUTO_TEST_CASE(test_mld)
{ {
const auto args = get_args();
using namespace osrm; using namespace osrm;
EngineConfig config; EngineConfig config;
config.storage_config = storage::StorageConfig(args.at(0)); config.use_shared_memory = false;
config.storage_config = storage::StorageConfig(OSRM_TEST_DATA_DIR "/monaco_CoreCH.osrm");
config.algorithm = EngineConfig::Algorithm::MLD; config.algorithm = EngineConfig::Algorithm::MLD;
OSRM osrm{config}; OSRM osrm{config};
} }

View File

@ -1,7 +1,6 @@
#include <boost/test/test_case_template.hpp> #include <boost/test/test_case_template.hpp>
#include <boost/test/unit_test.hpp> #include <boost/test/unit_test.hpp>
#include "args.hpp"
#include "coordinates.hpp" #include "coordinates.hpp"
#include "equal_json.hpp" #include "equal_json.hpp"
#include "fixture.hpp" #include "fixture.hpp"
@ -18,8 +17,7 @@ BOOST_AUTO_TEST_SUITE(route)
BOOST_AUTO_TEST_CASE(test_route_same_coordinates_fixture) BOOST_AUTO_TEST_CASE(test_route_same_coordinates_fixture)
{ {
const auto args = get_args(); auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/monaco_CH.osrm");
auto osrm = getOSRM(args.at(0));
using namespace osrm; using namespace osrm;
@ -105,8 +103,7 @@ BOOST_AUTO_TEST_CASE(test_route_same_coordinates_fixture)
BOOST_AUTO_TEST_CASE(test_route_same_coordinates) BOOST_AUTO_TEST_CASE(test_route_same_coordinates)
{ {
const auto args = get_args(); auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/monaco_CH.osrm");
auto osrm = getOSRM(args.at(0));
using namespace osrm; using namespace osrm;
@ -258,8 +255,7 @@ BOOST_AUTO_TEST_CASE(test_route_same_coordinates)
BOOST_AUTO_TEST_CASE(test_route_response_for_locations_in_small_component) BOOST_AUTO_TEST_CASE(test_route_response_for_locations_in_small_component)
{ {
const auto args = get_args(); auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/monaco_CH.osrm");
auto osrm = getOSRM(args.at(0));
using namespace osrm; using namespace osrm;
@ -294,8 +290,7 @@ BOOST_AUTO_TEST_CASE(test_route_response_for_locations_in_small_component)
BOOST_AUTO_TEST_CASE(test_route_response_for_locations_in_big_component) BOOST_AUTO_TEST_CASE(test_route_response_for_locations_in_big_component)
{ {
const auto args = get_args(); auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/monaco_CH.osrm");
auto osrm = getOSRM(args.at(0));
using namespace osrm; using namespace osrm;
@ -330,8 +325,7 @@ BOOST_AUTO_TEST_CASE(test_route_response_for_locations_in_big_component)
BOOST_AUTO_TEST_CASE(test_route_response_for_locations_across_components) BOOST_AUTO_TEST_CASE(test_route_response_for_locations_across_components)
{ {
const auto args = get_args(); auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/monaco_CH.osrm");
auto osrm = getOSRM(args.at(0));
using namespace osrm; using namespace osrm;
@ -368,8 +362,7 @@ BOOST_AUTO_TEST_CASE(test_route_response_for_locations_across_components)
BOOST_AUTO_TEST_CASE(test_route_user_disables_generating_hints) BOOST_AUTO_TEST_CASE(test_route_user_disables_generating_hints)
{ {
const auto args = get_args(); auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/monaco_CH.osrm");
auto osrm = getOSRM(args.at(0));
using namespace osrm; using namespace osrm;
@ -389,8 +382,7 @@ BOOST_AUTO_TEST_CASE(test_route_user_disables_generating_hints)
BOOST_AUTO_TEST_CASE(speed_annotation_matches_duration_and_distance) BOOST_AUTO_TEST_CASE(speed_annotation_matches_duration_and_distance)
{ {
const auto args = get_args(); auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/monaco_CH.osrm");
auto osrm = getOSRM(args.at(0));
using namespace osrm; using namespace osrm;
@ -424,8 +416,7 @@ BOOST_AUTO_TEST_CASE(speed_annotation_matches_duration_and_distance)
BOOST_AUTO_TEST_CASE(test_manual_setting_of_annotations_property) BOOST_AUTO_TEST_CASE(test_manual_setting_of_annotations_property)
{ {
const auto args = get_args(); auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/monaco_CH.osrm");
auto osrm = getOSRM(args.at(0));
using namespace osrm; using namespace osrm;

View File

@ -1,7 +1,6 @@
#include <boost/test/test_case_template.hpp> #include <boost/test/test_case_template.hpp>
#include <boost/test/unit_test.hpp> #include <boost/test/unit_test.hpp>
#include "args.hpp"
#include "coordinates.hpp" #include "coordinates.hpp"
#include "fixture.hpp" #include "fixture.hpp"
#include "waypoint_check.hpp" #include "waypoint_check.hpp"
@ -18,12 +17,9 @@ BOOST_AUTO_TEST_SUITE(table)
BOOST_AUTO_TEST_CASE(test_table_three_coords_one_source_one_dest_matrix) BOOST_AUTO_TEST_CASE(test_table_three_coords_one_source_one_dest_matrix)
{ {
const auto args = get_args();
BOOST_REQUIRE_EQUAL(args.size(), 1);
using namespace osrm; using namespace osrm;
auto osrm = getOSRM(args[0]); auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/monaco_CH.osrm");
TableParameters params; TableParameters params;
params.coordinates.push_back(get_dummy_location()); params.coordinates.push_back(get_dummy_location());
@ -68,12 +64,9 @@ BOOST_AUTO_TEST_CASE(test_table_three_coords_one_source_one_dest_matrix)
BOOST_AUTO_TEST_CASE(test_table_three_coords_one_source_matrix) BOOST_AUTO_TEST_CASE(test_table_three_coords_one_source_matrix)
{ {
const auto args = get_args();
BOOST_REQUIRE_EQUAL(args.size(), 1);
using namespace osrm; using namespace osrm;
auto osrm = getOSRM(args[0]); auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/monaco_CH.osrm");
TableParameters params; TableParameters params;
params.coordinates.push_back(get_dummy_location()); params.coordinates.push_back(get_dummy_location());
@ -118,12 +111,9 @@ BOOST_AUTO_TEST_CASE(test_table_three_coords_one_source_matrix)
BOOST_AUTO_TEST_CASE(test_table_three_coordinates_matrix) BOOST_AUTO_TEST_CASE(test_table_three_coordinates_matrix)
{ {
const auto args = get_args();
BOOST_REQUIRE_EQUAL(args.size(), 1);
using namespace osrm; using namespace osrm;
auto osrm = getOSRM(args[0]); auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/monaco_CH.osrm");
TableParameters params; TableParameters params;
params.coordinates.push_back(get_dummy_location()); params.coordinates.push_back(get_dummy_location());

View File

@ -1,7 +1,6 @@
#include <boost/test/test_case_template.hpp> #include <boost/test/test_case_template.hpp>
#include <boost/test/unit_test.hpp> #include <boost/test/unit_test.hpp>
#include "args.hpp"
#include "fixture.hpp" #include "fixture.hpp"
#include "osrm/tile_parameters.hpp" #include "osrm/tile_parameters.hpp"
@ -23,11 +22,10 @@ BOOST_AUTO_TEST_SUITE(tile)
BOOST_AUTO_TEST_CASE(test_tile) BOOST_AUTO_TEST_CASE(test_tile)
{ {
const auto args = get_args();
auto osrm = getOSRM(args.at(0));
using namespace osrm; using namespace osrm;
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/monaco_CH.osrm");
// This tile should contain most of monaco // This tile should contain most of monaco
TileParameters params{17059, 11948, 15}; TileParameters params{17059, 11948, 15};
@ -213,11 +211,9 @@ BOOST_AUTO_TEST_CASE(test_tile)
BOOST_AUTO_TEST_CASE(test_tile_turns) BOOST_AUTO_TEST_CASE(test_tile_turns)
{ {
const auto args = get_args();
auto osrm = getOSRM(args.at(0));
using namespace osrm; using namespace osrm;
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/monaco_CH.osrm");
// Small tile where we can test all the values // Small tile where we can test all the values
TileParameters params{272953, 191177, 19}; TileParameters params{272953, 191177, 19};
@ -363,11 +359,10 @@ BOOST_AUTO_TEST_CASE(test_tile_turns)
BOOST_AUTO_TEST_CASE(test_tile_speeds) BOOST_AUTO_TEST_CASE(test_tile_speeds)
{ {
const auto args = get_args();
auto osrm = getOSRM(args.at(0));
using namespace osrm; using namespace osrm;
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/monaco_CH.osrm");
// Small tile so we can test all the values // Small tile so we can test all the values
// TileParameters params{272953, 191177, 19}; // TileParameters params{272953, 191177, 19};
TileParameters params{136477, 95580, 18}; TileParameters params{136477, 95580, 18};

View File

@ -1,7 +1,6 @@
#include <boost/test/test_case_template.hpp> #include <boost/test/test_case_template.hpp>
#include <boost/test/unit_test.hpp> #include <boost/test/unit_test.hpp>
#include "args.hpp"
#include "coordinates.hpp" #include "coordinates.hpp"
#include "fixture.hpp" #include "fixture.hpp"
@ -17,11 +16,9 @@ BOOST_AUTO_TEST_SUITE(trip)
BOOST_AUTO_TEST_CASE(test_roundtrip_response_for_locations_in_small_component) BOOST_AUTO_TEST_CASE(test_roundtrip_response_for_locations_in_small_component)
{ {
const auto args = get_args();
auto osrm = getOSRM(args.at(0));
using namespace osrm; using namespace osrm;
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/monaco_CH.osrm");
const auto locations = get_locations_in_small_component(); const auto locations = get_locations_in_small_component();
TripParameters params; TripParameters params;
@ -61,11 +58,9 @@ BOOST_AUTO_TEST_CASE(test_roundtrip_response_for_locations_in_small_component)
BOOST_AUTO_TEST_CASE(test_roundtrip_response_for_locations_in_big_component) BOOST_AUTO_TEST_CASE(test_roundtrip_response_for_locations_in_big_component)
{ {
const auto args = get_args();
auto osrm = getOSRM(args.at(0));
using namespace osrm; using namespace osrm;
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/monaco_CH.osrm");
const auto locations = get_locations_in_big_component(); const auto locations = get_locations_in_big_component();
TripParameters params; TripParameters params;
@ -105,11 +100,9 @@ BOOST_AUTO_TEST_CASE(test_roundtrip_response_for_locations_in_big_component)
BOOST_AUTO_TEST_CASE(test_roundtrip_response_for_locations_across_components) BOOST_AUTO_TEST_CASE(test_roundtrip_response_for_locations_across_components)
{ {
const auto args = get_args();
auto osrm = getOSRM(args.at(0));
using namespace osrm; using namespace osrm;
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/monaco_CH.osrm");
const auto small = get_locations_in_small_component(); const auto small = get_locations_in_small_component();
const auto big = get_locations_in_big_component(); const auto big = get_locations_in_big_component();
@ -153,11 +146,9 @@ BOOST_AUTO_TEST_CASE(test_roundtrip_response_for_locations_across_components)
BOOST_AUTO_TEST_CASE(test_tfse_1) BOOST_AUTO_TEST_CASE(test_tfse_1)
{ {
const auto args = get_args();
auto osrm = getOSRM(args.at(0));
using namespace osrm; using namespace osrm;
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/monaco_CH.osrm");
const auto locations = get_locations_in_small_component(); const auto locations = get_locations_in_small_component();
TripParameters params; TripParameters params;
@ -201,11 +192,9 @@ BOOST_AUTO_TEST_CASE(test_tfse_1)
BOOST_AUTO_TEST_CASE(test_tfse_2) BOOST_AUTO_TEST_CASE(test_tfse_2)
{ {
const auto args = get_args();
auto osrm = getOSRM(args.at(0));
using namespace osrm; using namespace osrm;
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/monaco_CH.osrm");
const auto locations = get_locations_in_big_component(); const auto locations = get_locations_in_big_component();
TripParameters params; TripParameters params;
@ -274,10 +263,9 @@ void CheckOk(const osrm::OSRM &osrm, osrm::TripParameters &params)
BOOST_AUTO_TEST_CASE(test_tfse_illegal_parameters) BOOST_AUTO_TEST_CASE(test_tfse_illegal_parameters)
{ {
const auto args = get_args();
auto osrm = getOSRM(args.at(0));
using namespace osrm; using namespace osrm;
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/monaco_CH.osrm");
const auto locations = get_locations_in_big_component(); const auto locations = get_locations_in_big_component();
auto params = osrm::TripParameters(); auto params = osrm::TripParameters();
@ -326,9 +314,8 @@ BOOST_AUTO_TEST_CASE(test_tfse_illegal_parameters)
BOOST_AUTO_TEST_CASE(test_tfse_legal_parameters) BOOST_AUTO_TEST_CASE(test_tfse_legal_parameters)
{ {
const auto args = get_args();
auto osrm = getOSRM(args.at(0));
using namespace osrm; using namespace osrm;
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/monaco_CH.osrm");
const auto locations = get_locations_in_big_component(); const auto locations = get_locations_in_big_component();
json::Object result; json::Object result;
TripParameters params; TripParameters params;