Skip to content

Commit

Permalink
Only extract berlin.osm.pbf once and fix windows builds
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMarex committed Mar 21, 2017
1 parent 6b941d8 commit 886dca3
Show file tree
Hide file tree
Showing 13 changed files with 70 additions and 60 deletions.
21 changes: 11 additions & 10 deletions appveyor-build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -134,21 +134,22 @@ IF %ERRORLEVEL% NEQ 0 GOTO ERROR

ECHO running library-tests.exe ...
SET test_region=berlin
SET test_region_ch=ch\berlin
SET test_region_corech=corech\berlin
SET test_region_mld=mld\berlin
SET test_osm=%test_region%.osm.pbf
SET test_osm_ch=%test_region%_CH.osm.pbf
SET test_osm_corech=%test_region%_CoreCH.osm.pbf
SET test_osm_mld=%test_region%_MLD.osm.pbf
IF NOT EXIST %test_osm% powershell Invoke-WebRequest https://s3.amazonaws.com/mapbox/osrm/testing/berlin.osm.pbf -OutFile %test_osm%
COPY %test_osm% %test_osm_ch%
COPY %test_osm% %test_osm_corech%
COPY %test_osm% %test_osm_mld%
%Configuration%\osrm-extract.exe -p ../profiles/car.lua %test_osm_ch%
%Configuration%\osrm-extract.exe -p ../profiles/car.lua %test_osm_corech%
%Configuration%\osrm-extract.exe -p ../profiles/car.lua %test_osm_mld%
%Configuration%\osrm-extract.exe -p ../profiles/car.lua %test_osm%
MKDIR ch
XCOPY %test_region%.osrm %test_region%.osrm.* ch\
MKDIR corech
XCOPY %test_region%.osrm %test_region%.osrm.* corech\
MKDIR mld
XCOPY %test_region%.osrm %test_region%.osrm.* mld\
%Configuration%\osrm-contract.exe %test_region_ch%.osrm
%Configuration%\osrm-contract.exe --core 0.8 %test_region_corech%.osrm
%Configuration%\osrm-contract.exe %test_region_mld%.osrm
%Configuration%\osrm-partition.exe %test_region_mld%.osrm
%Configuration%\osrm-customize.exe %test_region_mld%.osrm
unit_tests\%Configuration%\library-tests.exe

IF NOT "%APPVEYOR_REPO_BRANCH%"=="master" GOTO DONE
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ build_script:
before_test:
- node --version
- npm --version
- npm install
- npm install --ignore-scripts
- npm link
- SET PATH=%CD%\osrm-deps\libs\bin;%PATH%
- SET OSRM_BUILD_DIR=build\%Configuration%
Expand Down
2 changes: 1 addition & 1 deletion scripts/poly2req.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ let fs = require('fs'); // Node 4.x required!

let VERSION = "route_5.0";
let SAMPLE_SIZE = 20;
let NUM_REQUEST = 1000;
let NUM_REQUEST = 100;
let NUM_COORDS = 2;
let PORT = 5000;
let url_templates = {
Expand Down
33 changes: 21 additions & 12 deletions test/data/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ PROFILE:=$(PROFILE_ROOT)/car.lua

all: data

data: $(DATA_NAME)_CH.osrm.hsgr $(DATA_NAME)_CoreCH.osrm.hsgr $(DATA_NAME)_MLD.osrm.partition
data: ch/$(DATA_NAME).osrm.hsgr corech/$(DATA_NAME).osrm.hsgr mld/$(DATA_NAME).osrm.partition

clean:
-rm $(DATA_NAME).*
Expand All @@ -25,27 +25,36 @@ clean:
$(DATA_NAME).osm.pbf:
wget $(DATA_URL) -O $(DATA_NAME).osm.pbf

$(DATA_NAME)_%.osm.pbf: $(DATA_NAME).osm.pbf
cp $< $@

$(DATA_NAME).poly:
wget $(DATA_POLY_URL) -O $(DATA_NAME).poly

$(DATA_NAME)_%.osrm: $(DATA_NAME)_%.osm.pbf $(DATA_NAME).poly $(PROFILE) $(OSRM_EXTRACT)
ch/$(DATA_NAME).osrm: $(DATA_NAME).osrm
mkdir -p ch
cp $(DATA_NAME).osrm $(DATA_NAME).osrm.* ch/

corech/$(DATA_NAME).osrm: $(DATA_NAME).osrm
mkdir -p corech
cp $(DATA_NAME).osrm $(DATA_NAME).osrm.* corech/

mld/$(DATA_NAME).osrm: $(DATA_NAME).osrm
mkdir -p mld
cp $(DATA_NAME).osrm $(DATA_NAME).osrm.* mld/

$(DATA_NAME).osrm: $(DATA_NAME).osm.pbf $(DATA_NAME).poly $(PROFILE) $(OSRM_EXTRACT)
@echo "Verifiyng data file integrity..."
$(MD5SUM) -c data.md5sum
@echo "Running osrm-extract..."
$(TIMER) "osrm-extract\t$@" $(OSRM_EXTRACT) $< -p $(PROFILE)

$(DATA_NAME)_CH.osrm.hsgr: $(DATA_NAME)_CH.osrm $(PROFILE) $(OSRM_CONTRACT)
ch/$(DATA_NAME).osrm.hsgr: ch/$(DATA_NAME).osrm $(PROFILE) $(OSRM_CONTRACT)
@echo "Running osrm-contract..."
$(TIMER) "osrm-contract\t$@" $(OSRM_CONTRACT) $<

$(DATA_NAME)_CoreCH.osrm.hsgr: $(DATA_NAME)_CoreCH.osrm $(PROFILE) $(OSRM_CONTRACT)
corech/$(DATA_NAME).osrm.hsgr: corech/$(DATA_NAME).osrm $(PROFILE) $(OSRM_CONTRACT)
@echo "Running osrm-contract..."
$(TIMER) "osrm-contract\t$@" $(OSRM_CONTRACT) --core=0.2 $<
$(TIMER) "osrm-contract\t$@" $(OSRM_CONTRACT) --core=0.5 $<

$(DATA_NAME)_MLD.osrm.partition: $(DATA_NAME)_MLD.osrm $(PROFILE) $(OSRM_PARTITION)
mld/$(DATA_NAME).osrm.partition: mld/$(DATA_NAME).osrm $(PROFILE) $(OSRM_PARTITION)
@echo "Running osrm-partition..."
$(TIMER) "osrm-partition\t$@" $(OSRM_PARTITION) $<
$(TIMER) "osrm-customize\t$@" $(OSRM_CUSTOMIZE) $<
Expand All @@ -55,17 +64,17 @@ $(DATA_NAME).requests: $(DATA_NAME).poly

benchmark: data $(DATA_NAME).requests
@echo "Running benchmark..."
@/bin/sh -c '$(OSRM_ROUTED) --algorithm=CH $(DATA_NAME)_CH.osrm > /dev/null & echo "$$!" > osrm-routed.pid'
@/bin/sh -c '$(OSRM_ROUTED) --algorithm=CH ch/$(DATA_NAME).osrm > /dev/null & echo "$$!" > osrm-routed.pid'
@sleep 1
$(TIMER) "queries\tCH" "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 > /dev/null & echo "$$!" > osrm-routed.pid'
@/bin/sh -c '$(OSRM_ROUTED) --algorithm=CoreCH corech/$(DATA_NAME).osrm > /dev/null & echo "$$!" > osrm-routed.pid'
@sleep 1
$(TIMER) "queries\tCoreCH" "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 > /dev/null & echo "$$!" > osrm-routed.pid'
@/bin/sh -c '$(OSRM_ROUTED) --algorithm=MLD mld/$(DATA_NAME).osrm > /dev/null & echo "$$!" > osrm-routed.pid'
@sleep 1
$(TIMER) "queries\tMLD" "cat $(DATA_NAME).requests | xargs curl &> /dev/null"
@cat osrm-routed.pid | xargs kill
Expand Down
4 changes: 2 additions & 2 deletions test/nodejs/osrm-data-path.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
var path = require('path');

if (process.env.OSRM_DATA_PATH !== undefined) {
exports.data_path = path.join(path.resolve(process.env.OSRM_DATA_PATH), "berlin_CH.osrm");
exports.data_path = path.join(path.resolve(process.env.OSRM_DATA_PATH), "ch/berlin.osrm");
console.log('Setting custom data path to ' + exports.data_path);
} else {
exports.data_path = path.resolve(path.join(__dirname, "../data/berlin_CH.osrm"));
exports.data_path = path.resolve(path.join(__dirname, "../data/ch/berlin.osrm"));
}
10 changes: 5 additions & 5 deletions unit_tests/library/limits.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ BOOST_AUTO_TEST_CASE(test_trip_limits)
using namespace osrm;

EngineConfig config;
config.storage_config = {OSRM_TEST_DATA_DIR "/berlin_CH.osrm"};
config.storage_config = {OSRM_TEST_DATA_DIR "/ch/berlin.osrm"};
config.use_shared_memory = false;
config.max_locations_trip = 2;

Expand All @@ -55,7 +55,7 @@ BOOST_AUTO_TEST_CASE(test_route_limits)
using namespace osrm;

EngineConfig config;
config.storage_config = {OSRM_TEST_DATA_DIR "/berlin_CH.osrm"};
config.storage_config = {OSRM_TEST_DATA_DIR "/ch/berlin.osrm"};
config.use_shared_memory = false;
config.max_locations_viaroute = 2;

Expand All @@ -82,7 +82,7 @@ BOOST_AUTO_TEST_CASE(test_table_limits)
using namespace osrm;

EngineConfig config;
config.storage_config = {OSRM_TEST_DATA_DIR "/berlin_CH.osrm"};
config.storage_config = {OSRM_TEST_DATA_DIR "/ch/berlin.osrm"};
config.use_shared_memory = false;
config.max_locations_distance_table = 2;

Expand All @@ -109,7 +109,7 @@ BOOST_AUTO_TEST_CASE(test_match_limits)
using namespace osrm;

EngineConfig config;
config.storage_config = {OSRM_TEST_DATA_DIR "/berlin_CH.osrm"};
config.storage_config = {OSRM_TEST_DATA_DIR "/ch/berlin.osrm"};
config.use_shared_memory = false;
config.max_locations_map_matching = 2;

Expand All @@ -136,7 +136,7 @@ BOOST_AUTO_TEST_CASE(test_nearest_limits)
using namespace osrm;

EngineConfig config;
config.storage_config = {OSRM_TEST_DATA_DIR "/berlin_CH.osrm"};
config.storage_config = {OSRM_TEST_DATA_DIR "/ch/berlin.osrm"};
config.use_shared_memory = false;
config.max_results_nearest = 2;

Expand Down
2 changes: 1 addition & 1 deletion unit_tests/library/match.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ BOOST_AUTO_TEST_CASE(test_match)
{
using namespace osrm;

auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/berlin_CH.osrm");
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/ch/berlin.osrm");

MatchParameters params;
params.coordinates.push_back(get_dummy_location());
Expand Down
8 changes: 4 additions & 4 deletions unit_tests/library/nearest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ BOOST_AUTO_TEST_SUITE(nearest)

BOOST_AUTO_TEST_CASE(test_nearest_response)
{
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/berlin_CH.osrm");
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/ch/berlin.osrm");

using namespace osrm;

Expand All @@ -43,7 +43,7 @@ BOOST_AUTO_TEST_CASE(test_nearest_response)

BOOST_AUTO_TEST_CASE(test_nearest_response_no_coordinates)
{
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/berlin_CH.osrm");
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/ch/berlin.osrm");

using namespace osrm;

Expand All @@ -59,7 +59,7 @@ BOOST_AUTO_TEST_CASE(test_nearest_response_no_coordinates)

BOOST_AUTO_TEST_CASE(test_nearest_response_multiple_coordinates)
{
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/berlin_CH.osrm");
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/ch/berlin.osrm");

using namespace osrm;

Expand All @@ -77,7 +77,7 @@ BOOST_AUTO_TEST_CASE(test_nearest_response_multiple_coordinates)

BOOST_AUTO_TEST_CASE(test_nearest_response_for_location_in_small_component)
{
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/berlin_CH.osrm");
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/ch/berlin.osrm");

using namespace osrm;

Expand Down
6 changes: 3 additions & 3 deletions unit_tests/library/options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ BOOST_AUTO_TEST_CASE(test_ch)
using namespace osrm;
EngineConfig config;
config.use_shared_memory = false;
config.storage_config = storage::StorageConfig(OSRM_TEST_DATA_DIR "/berlin_CH.osrm");
config.storage_config = storage::StorageConfig(OSRM_TEST_DATA_DIR "/ch/berlin.osrm");
config.algorithm = EngineConfig::Algorithm::CH;
OSRM osrm{config};
}
Expand All @@ -24,7 +24,7 @@ BOOST_AUTO_TEST_CASE(test_corech)
using namespace osrm;
EngineConfig config;
config.use_shared_memory = false;
config.storage_config = storage::StorageConfig(OSRM_TEST_DATA_DIR "/berlin_CoreCH.osrm");
config.storage_config = storage::StorageConfig(OSRM_TEST_DATA_DIR "/corech/berlin.osrm");
config.algorithm = EngineConfig::Algorithm::CoreCH;
OSRM osrm{config};
}
Expand All @@ -34,7 +34,7 @@ BOOST_AUTO_TEST_CASE(test_mld)
using namespace osrm;
EngineConfig config;
config.use_shared_memory = false;
config.storage_config = storage::StorageConfig(OSRM_TEST_DATA_DIR "/berlin_MLD.osrm");
config.storage_config = storage::StorageConfig(OSRM_TEST_DATA_DIR "/mld/berlin.osrm");
config.algorithm = EngineConfig::Algorithm::MLD;
OSRM osrm{config};
}
Expand Down
16 changes: 8 additions & 8 deletions unit_tests/library/route.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ BOOST_AUTO_TEST_SUITE(route)

BOOST_AUTO_TEST_CASE(test_route_same_coordinates_fixture)
{
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/berlin_CH.osrm");
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/ch/berlin.osrm");

using namespace osrm;

Expand Down Expand Up @@ -97,7 +97,7 @@ BOOST_AUTO_TEST_CASE(test_route_same_coordinates_fixture)

BOOST_AUTO_TEST_CASE(test_route_same_coordinates)
{
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/berlin_CH.osrm");
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/ch/berlin.osrm");

using namespace osrm;

Expand Down Expand Up @@ -249,7 +249,7 @@ BOOST_AUTO_TEST_CASE(test_route_same_coordinates)

BOOST_AUTO_TEST_CASE(test_route_response_for_locations_in_small_component)
{
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/berlin_CH.osrm");
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/ch/berlin.osrm");

using namespace osrm;

Expand Down Expand Up @@ -284,7 +284,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)
{
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/berlin_CH.osrm");
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/ch/berlin.osrm");

using namespace osrm;

Expand Down Expand Up @@ -319,7 +319,7 @@ BOOST_AUTO_TEST_CASE(test_route_response_for_locations_in_big_component)

BOOST_AUTO_TEST_CASE(test_route_response_for_locations_across_components)
{
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/berlin_CH.osrm");
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/ch/berlin.osrm");

using namespace osrm;

Expand Down Expand Up @@ -356,7 +356,7 @@ BOOST_AUTO_TEST_CASE(test_route_response_for_locations_across_components)

BOOST_AUTO_TEST_CASE(test_route_user_disables_generating_hints)
{
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/berlin_CH.osrm");
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/ch/berlin.osrm");

using namespace osrm;

Expand All @@ -376,7 +376,7 @@ BOOST_AUTO_TEST_CASE(test_route_user_disables_generating_hints)

BOOST_AUTO_TEST_CASE(speed_annotation_matches_duration_and_distance)
{
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/berlin_CH.osrm");
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/ch/berlin.osrm");

using namespace osrm;

Expand Down Expand Up @@ -410,7 +410,7 @@ BOOST_AUTO_TEST_CASE(speed_annotation_matches_duration_and_distance)

BOOST_AUTO_TEST_CASE(test_manual_setting_of_annotations_property)
{
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/berlin_CH.osrm");
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/ch/berlin.osrm");

using namespace osrm;

Expand Down
6 changes: 3 additions & 3 deletions unit_tests/library/table.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ BOOST_AUTO_TEST_CASE(test_table_three_coords_one_source_one_dest_matrix)
{
using namespace osrm;

auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/berlin_CH.osrm");
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/ch/berlin.osrm");

TableParameters params;
params.coordinates.push_back(get_dummy_location());
Expand Down Expand Up @@ -66,7 +66,7 @@ BOOST_AUTO_TEST_CASE(test_table_three_coords_one_source_matrix)
{
using namespace osrm;

auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/berlin_CH.osrm");
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/ch/berlin.osrm");

TableParameters params;
params.coordinates.push_back(get_dummy_location());
Expand Down Expand Up @@ -113,7 +113,7 @@ BOOST_AUTO_TEST_CASE(test_table_three_coordinates_matrix)
{
using namespace osrm;

auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/berlin_CH.osrm");
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/ch/berlin.osrm");

TableParameters params;
params.coordinates.push_back(get_dummy_location());
Expand Down
6 changes: 3 additions & 3 deletions unit_tests/library/tile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ BOOST_AUTO_TEST_CASE(test_tile)
{
using namespace osrm;

auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/berlin_CH.osrm");
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/ch/berlin.osrm");

// Tile within Berlin dataset at Hackescher Markt (13.40294, 52.52330)
TileParameters params{140831, 85967, 18};
Expand Down Expand Up @@ -216,7 +216,7 @@ BOOST_AUTO_TEST_CASE(test_tile_turns)
{
using namespace osrm;

auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/berlin_CH.osrm");
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/ch/berlin.osrm");

// Tile within Berlin dataset at Hackescher Markt (13.40294, 52.52330)
TileParameters params{140831, 85967, 18};
Expand Down Expand Up @@ -366,7 +366,7 @@ BOOST_AUTO_TEST_CASE(test_tile_speeds)
{
using namespace osrm;

auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/berlin_CH.osrm");
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/ch/berlin.osrm");

// Small tile so we can test all the values
// TileParameters params{272953, 191177, 19};
Expand Down
Loading

0 comments on commit 886dca3

Please sign in to comment.