Skip to content

Commit 1284f5d

Browse files
committed
Only extract berlin.osm.pbf once and fix windows builds
1 parent 6b941d8 commit 1284f5d

File tree

12 files changed

+69
-59
lines changed

12 files changed

+69
-59
lines changed

appveyor-build.bat

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -134,21 +134,22 @@ IF %ERRORLEVEL% NEQ 0 GOTO ERROR
134134

135135
ECHO running library-tests.exe ...
136136
SET test_region=berlin
137+
SET test_region_ch=ch\berlin
138+
SET test_region_corech=corech\berlin
139+
SET test_region_mld=mld\berlin
137140
SET test_osm=%test_region%.osm.pbf
138-
SET test_osm_ch=%test_region%_CH.osm.pbf
139-
SET test_osm_corech=%test_region%_CoreCH.osm.pbf
140-
SET test_osm_mld=%test_region%_MLD.osm.pbf
141141
IF NOT EXIST %test_osm% powershell Invoke-WebRequest https://s3.amazonaws.com/mapbox/osrm/testing/berlin.osm.pbf -OutFile %test_osm%
142-
COPY %test_osm% %test_osm_ch%
143-
COPY %test_osm% %test_osm_corech%
144-
COPY %test_osm% %test_osm_mld%
145-
%Configuration%\osrm-extract.exe -p ../profiles/car.lua %test_osm_ch%
146-
%Configuration%\osrm-extract.exe -p ../profiles/car.lua %test_osm_corech%
147-
%Configuration%\osrm-extract.exe -p ../profiles/car.lua %test_osm_mld%
142+
%Configuration%\osrm-extract.exe -p ../profiles/car.lua %test_osm%
143+
MKDIR ch
144+
XCOPY %test_region%.osrm %test_region%.osrm.* ch\
145+
MKDIR corech
146+
XCOPY %test_region%.osrm %test_region%.osrm.* corech\
147+
MKDIR mld
148+
XCOPY %test_region%.osrm %test_region%.osrm.* mld\
148149
%Configuration%\osrm-contract.exe %test_region_ch%.osrm
149150
%Configuration%\osrm-contract.exe --core 0.8 %test_region_corech%.osrm
150-
%Configuration%\osrm-contract.exe %test_region_mld%.osrm
151151
%Configuration%\osrm-partition.exe %test_region_mld%.osrm
152+
%Configuration%\osrm-customize.exe %test_region_mld%.osrm
152153
unit_tests\%Configuration%\library-tests.exe
153154

154155
IF NOT "%APPVEYOR_REPO_BRANCH%"=="master" GOTO DONE

scripts/poly2req.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ let fs = require('fs'); // Node 4.x required!
66

77
let VERSION = "route_5.0";
88
let SAMPLE_SIZE = 20;
9-
let NUM_REQUEST = 1000;
9+
let NUM_REQUEST = 100;
1010
let NUM_COORDS = 2;
1111
let PORT = 5000;
1212
let url_templates = {

test/data/Makefile

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ PROFILE:=$(PROFILE_ROOT)/car.lua
1616

1717
all: data
1818

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

2121
clean:
2222
-rm $(DATA_NAME).*
@@ -25,27 +25,36 @@ clean:
2525
$(DATA_NAME).osm.pbf:
2626
wget $(DATA_URL) -O $(DATA_NAME).osm.pbf
2727

28-
$(DATA_NAME)_%.osm.pbf: $(DATA_NAME).osm.pbf
29-
cp $< $@
30-
3128
$(DATA_NAME).poly:
3229
wget $(DATA_POLY_URL) -O $(DATA_NAME).poly
3330

34-
$(DATA_NAME)_%.osrm: $(DATA_NAME)_%.osm.pbf $(DATA_NAME).poly $(PROFILE) $(OSRM_EXTRACT)
31+
ch/$(DATA_NAME).osrm: $(DATA_NAME).osrm
32+
mkdir -p ch
33+
cp $(DATA_NAME).osrm $(DATA_NAME).osrm.* ch/
34+
35+
corech/$(DATA_NAME).osrm: $(DATA_NAME).osrm
36+
mkdir -p corech
37+
cp $(DATA_NAME).osrm $(DATA_NAME).osrm.* corech/
38+
39+
mld/$(DATA_NAME).osrm: $(DATA_NAME).osrm
40+
mkdir -p mld
41+
cp $(DATA_NAME).osrm $(DATA_NAME).osrm.* mld/
42+
43+
$(DATA_NAME).osrm: $(DATA_NAME).osm.pbf $(DATA_NAME).poly $(PROFILE) $(OSRM_EXTRACT)
3544
@echo "Verifiyng data file integrity..."
3645
$(MD5SUM) -c data.md5sum
3746
@echo "Running osrm-extract..."
3847
$(TIMER) "osrm-extract\t$@" $(OSRM_EXTRACT) $< -p $(PROFILE)
3948

40-
$(DATA_NAME)_CH.osrm.hsgr: $(DATA_NAME)_CH.osrm $(PROFILE) $(OSRM_CONTRACT)
49+
ch/$(DATA_NAME).osrm.hsgr: ch/$(DATA_NAME).osrm $(PROFILE) $(OSRM_CONTRACT)
4150
@echo "Running osrm-contract..."
4251
$(TIMER) "osrm-contract\t$@" $(OSRM_CONTRACT) $<
4352

44-
$(DATA_NAME)_CoreCH.osrm.hsgr: $(DATA_NAME)_CoreCH.osrm $(PROFILE) $(OSRM_CONTRACT)
53+
corech/$(DATA_NAME).osrm.hsgr: corech/$(DATA_NAME).osrm $(PROFILE) $(OSRM_CONTRACT)
4554
@echo "Running osrm-contract..."
46-
$(TIMER) "osrm-contract\t$@" $(OSRM_CONTRACT) --core=0.2 $<
55+
$(TIMER) "osrm-contract\t$@" $(OSRM_CONTRACT) --core=0.5 $<
4756

48-
$(DATA_NAME)_MLD.osrm.partition: $(DATA_NAME)_MLD.osrm $(PROFILE) $(OSRM_PARTITION)
57+
mld/$(DATA_NAME).osrm.partition: mld/$(DATA_NAME).osrm $(PROFILE) $(OSRM_PARTITION)
4958
@echo "Running osrm-partition..."
5059
$(TIMER) "osrm-partition\t$@" $(OSRM_PARTITION) $<
5160
$(TIMER) "osrm-customize\t$@" $(OSRM_CUSTOMIZE) $<
@@ -55,17 +64,17 @@ $(DATA_NAME).requests: $(DATA_NAME).poly
5564

5665
benchmark: data $(DATA_NAME).requests
5766
@echo "Running benchmark..."
58-
@/bin/sh -c '$(OSRM_ROUTED) --algorithm=CH $(DATA_NAME)_CH.osrm > /dev/null & echo "$$!" > osrm-routed.pid'
67+
@/bin/sh -c '$(OSRM_ROUTED) --algorithm=CH ch/$(DATA_NAME).osrm > /dev/null & echo "$$!" > osrm-routed.pid'
5968
@sleep 1
6069
$(TIMER) "queries\tCH" "cat $(DATA_NAME).requests | xargs curl &> /dev/null"
6170
@cat osrm-routed.pid | xargs kill
6271
@rm osrm-routed.pid
63-
@/bin/sh -c '$(OSRM_ROUTED) --algorithm=CoreCH $(DATA_NAME)_CoreCH.osrm > /dev/null & echo "$$!" > osrm-routed.pid'
72+
@/bin/sh -c '$(OSRM_ROUTED) --algorithm=CoreCH corech/$(DATA_NAME).osrm > /dev/null & echo "$$!" > osrm-routed.pid'
6473
@sleep 1
6574
$(TIMER) "queries\tCoreCH" "cat $(DATA_NAME).requests | xargs curl &> /dev/null"
6675
@cat osrm-routed.pid | xargs kill
6776
@rm osrm-routed.pid
68-
@/bin/sh -c '$(OSRM_ROUTED) --algorithm=MLD $(DATA_NAME)_MLD.osrm > /dev/null & echo "$$!" > osrm-routed.pid'
77+
@/bin/sh -c '$(OSRM_ROUTED) --algorithm=MLD mld/$(DATA_NAME).osrm > /dev/null & echo "$$!" > osrm-routed.pid'
6978
@sleep 1
7079
$(TIMER) "queries\tMLD" "cat $(DATA_NAME).requests | xargs curl &> /dev/null"
7180
@cat osrm-routed.pid | xargs kill

test/nodejs/osrm-data-path.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
var path = require('path');
22

33
if (process.env.OSRM_DATA_PATH !== undefined) {
4-
exports.data_path = path.join(path.resolve(process.env.OSRM_DATA_PATH), "berlin_CH.osrm");
4+
exports.data_path = path.join(path.resolve(process.env.OSRM_DATA_PATH), "ch/berlin.osrm");
55
console.log('Setting custom data path to ' + exports.data_path);
66
} else {
7-
exports.data_path = path.resolve(path.join(__dirname, "../data/berlin_CH.osrm"));
7+
exports.data_path = path.resolve(path.join(__dirname, "../data/ch/berlin.osrm"));
88
}

unit_tests/library/limits.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ BOOST_AUTO_TEST_CASE(test_trip_limits)
2828
using namespace osrm;
2929

3030
EngineConfig config;
31-
config.storage_config = {OSRM_TEST_DATA_DIR "/berlin_CH.osrm"};
31+
config.storage_config = {OSRM_TEST_DATA_DIR "/ch/berlin.osrm"};
3232
config.use_shared_memory = false;
3333
config.max_locations_trip = 2;
3434

@@ -55,7 +55,7 @@ BOOST_AUTO_TEST_CASE(test_route_limits)
5555
using namespace osrm;
5656

5757
EngineConfig config;
58-
config.storage_config = {OSRM_TEST_DATA_DIR "/berlin_CH.osrm"};
58+
config.storage_config = {OSRM_TEST_DATA_DIR "/ch/berlin.osrm"};
5959
config.use_shared_memory = false;
6060
config.max_locations_viaroute = 2;
6161

@@ -82,7 +82,7 @@ BOOST_AUTO_TEST_CASE(test_table_limits)
8282
using namespace osrm;
8383

8484
EngineConfig config;
85-
config.storage_config = {OSRM_TEST_DATA_DIR "/berlin_CH.osrm"};
85+
config.storage_config = {OSRM_TEST_DATA_DIR "/ch/berlin.osrm"};
8686
config.use_shared_memory = false;
8787
config.max_locations_distance_table = 2;
8888

@@ -109,7 +109,7 @@ BOOST_AUTO_TEST_CASE(test_match_limits)
109109
using namespace osrm;
110110

111111
EngineConfig config;
112-
config.storage_config = {OSRM_TEST_DATA_DIR "/berlin_CH.osrm"};
112+
config.storage_config = {OSRM_TEST_DATA_DIR "/ch/berlin.osrm"};
113113
config.use_shared_memory = false;
114114
config.max_locations_map_matching = 2;
115115

@@ -136,7 +136,7 @@ BOOST_AUTO_TEST_CASE(test_nearest_limits)
136136
using namespace osrm;
137137

138138
EngineConfig config;
139-
config.storage_config = {OSRM_TEST_DATA_DIR "/berlin_CH.osrm"};
139+
config.storage_config = {OSRM_TEST_DATA_DIR "/ch/berlin.osrm"};
140140
config.use_shared_memory = false;
141141
config.max_results_nearest = 2;
142142

unit_tests/library/match.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ BOOST_AUTO_TEST_CASE(test_match)
1919
{
2020
using namespace osrm;
2121

22-
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/berlin_CH.osrm");
22+
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/ch/berlin.osrm");
2323

2424
MatchParameters params;
2525
params.coordinates.push_back(get_dummy_location());

unit_tests/library/nearest.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ BOOST_AUTO_TEST_SUITE(nearest)
1616

1717
BOOST_AUTO_TEST_CASE(test_nearest_response)
1818
{
19-
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/berlin_CH.osrm");
19+
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/ch/berlin.osrm");
2020

2121
using namespace osrm;
2222

@@ -43,7 +43,7 @@ BOOST_AUTO_TEST_CASE(test_nearest_response)
4343

4444
BOOST_AUTO_TEST_CASE(test_nearest_response_no_coordinates)
4545
{
46-
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/berlin_CH.osrm");
46+
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/ch/berlin.osrm");
4747

4848
using namespace osrm;
4949

@@ -59,7 +59,7 @@ BOOST_AUTO_TEST_CASE(test_nearest_response_no_coordinates)
5959

6060
BOOST_AUTO_TEST_CASE(test_nearest_response_multiple_coordinates)
6161
{
62-
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/berlin_CH.osrm");
62+
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/ch/berlin.osrm");
6363

6464
using namespace osrm;
6565

@@ -77,7 +77,7 @@ BOOST_AUTO_TEST_CASE(test_nearest_response_multiple_coordinates)
7777

7878
BOOST_AUTO_TEST_CASE(test_nearest_response_for_location_in_small_component)
7979
{
80-
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/berlin_CH.osrm");
80+
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/ch/berlin.osrm");
8181

8282
using namespace osrm;
8383

unit_tests/library/options.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ BOOST_AUTO_TEST_CASE(test_ch)
1414
using namespace osrm;
1515
EngineConfig config;
1616
config.use_shared_memory = false;
17-
config.storage_config = storage::StorageConfig(OSRM_TEST_DATA_DIR "/berlin_CH.osrm");
17+
config.storage_config = storage::StorageConfig(OSRM_TEST_DATA_DIR "/ch/berlin.osrm");
1818
config.algorithm = EngineConfig::Algorithm::CH;
1919
OSRM osrm{config};
2020
}
@@ -24,7 +24,7 @@ BOOST_AUTO_TEST_CASE(test_corech)
2424
using namespace osrm;
2525
EngineConfig config;
2626
config.use_shared_memory = false;
27-
config.storage_config = storage::StorageConfig(OSRM_TEST_DATA_DIR "/berlin_CoreCH.osrm");
27+
config.storage_config = storage::StorageConfig(OSRM_TEST_DATA_DIR "/corech/berlin.osrm");
2828
config.algorithm = EngineConfig::Algorithm::CoreCH;
2929
OSRM osrm{config};
3030
}
@@ -34,7 +34,7 @@ BOOST_AUTO_TEST_CASE(test_mld)
3434
using namespace osrm;
3535
EngineConfig config;
3636
config.use_shared_memory = false;
37-
config.storage_config = storage::StorageConfig(OSRM_TEST_DATA_DIR "/berlin_MLD.osrm");
37+
config.storage_config = storage::StorageConfig(OSRM_TEST_DATA_DIR "/mld/berlin.osrm");
3838
config.algorithm = EngineConfig::Algorithm::MLD;
3939
OSRM osrm{config};
4040
}

unit_tests/library/route.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ BOOST_AUTO_TEST_SUITE(route)
1717

1818
BOOST_AUTO_TEST_CASE(test_route_same_coordinates_fixture)
1919
{
20-
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/berlin_CH.osrm");
20+
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/ch/berlin.osrm");
2121

2222
using namespace osrm;
2323

@@ -97,7 +97,7 @@ BOOST_AUTO_TEST_CASE(test_route_same_coordinates_fixture)
9797

9898
BOOST_AUTO_TEST_CASE(test_route_same_coordinates)
9999
{
100-
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/berlin_CH.osrm");
100+
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/ch/berlin.osrm");
101101

102102
using namespace osrm;
103103

@@ -249,7 +249,7 @@ BOOST_AUTO_TEST_CASE(test_route_same_coordinates)
249249

250250
BOOST_AUTO_TEST_CASE(test_route_response_for_locations_in_small_component)
251251
{
252-
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/berlin_CH.osrm");
252+
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/ch/berlin.osrm");
253253

254254
using namespace osrm;
255255

@@ -284,7 +284,7 @@ BOOST_AUTO_TEST_CASE(test_route_response_for_locations_in_small_component)
284284

285285
BOOST_AUTO_TEST_CASE(test_route_response_for_locations_in_big_component)
286286
{
287-
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/berlin_CH.osrm");
287+
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/ch/berlin.osrm");
288288

289289
using namespace osrm;
290290

@@ -319,7 +319,7 @@ BOOST_AUTO_TEST_CASE(test_route_response_for_locations_in_big_component)
319319

320320
BOOST_AUTO_TEST_CASE(test_route_response_for_locations_across_components)
321321
{
322-
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/berlin_CH.osrm");
322+
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/ch/berlin.osrm");
323323

324324
using namespace osrm;
325325

@@ -356,7 +356,7 @@ BOOST_AUTO_TEST_CASE(test_route_response_for_locations_across_components)
356356

357357
BOOST_AUTO_TEST_CASE(test_route_user_disables_generating_hints)
358358
{
359-
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/berlin_CH.osrm");
359+
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/ch/berlin.osrm");
360360

361361
using namespace osrm;
362362

@@ -376,7 +376,7 @@ BOOST_AUTO_TEST_CASE(test_route_user_disables_generating_hints)
376376

377377
BOOST_AUTO_TEST_CASE(speed_annotation_matches_duration_and_distance)
378378
{
379-
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/berlin_CH.osrm");
379+
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/ch/berlin.osrm");
380380

381381
using namespace osrm;
382382

@@ -410,7 +410,7 @@ BOOST_AUTO_TEST_CASE(speed_annotation_matches_duration_and_distance)
410410

411411
BOOST_AUTO_TEST_CASE(test_manual_setting_of_annotations_property)
412412
{
413-
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/berlin_CH.osrm");
413+
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/ch/berlin.osrm");
414414

415415
using namespace osrm;
416416

unit_tests/library/table.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ BOOST_AUTO_TEST_CASE(test_table_three_coords_one_source_one_dest_matrix)
1919
{
2020
using namespace osrm;
2121

22-
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/berlin_CH.osrm");
22+
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/ch/berlin.osrm");
2323

2424
TableParameters params;
2525
params.coordinates.push_back(get_dummy_location());
@@ -66,7 +66,7 @@ BOOST_AUTO_TEST_CASE(test_table_three_coords_one_source_matrix)
6666
{
6767
using namespace osrm;
6868

69-
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/berlin_CH.osrm");
69+
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/ch/berlin.osrm");
7070

7171
TableParameters params;
7272
params.coordinates.push_back(get_dummy_location());
@@ -113,7 +113,7 @@ BOOST_AUTO_TEST_CASE(test_table_three_coordinates_matrix)
113113
{
114114
using namespace osrm;
115115

116-
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/berlin_CH.osrm");
116+
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/ch/berlin.osrm");
117117

118118
TableParameters params;
119119
params.coordinates.push_back(get_dummy_location());

unit_tests/library/tile.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ BOOST_AUTO_TEST_CASE(test_tile)
2424
{
2525
using namespace osrm;
2626

27-
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/berlin_CH.osrm");
27+
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/ch/berlin.osrm");
2828

2929
// Tile within Berlin dataset at Hackescher Markt (13.40294, 52.52330)
3030
TileParameters params{140831, 85967, 18};
@@ -216,7 +216,7 @@ BOOST_AUTO_TEST_CASE(test_tile_turns)
216216
{
217217
using namespace osrm;
218218

219-
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/berlin_CH.osrm");
219+
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/ch/berlin.osrm");
220220

221221
// Tile within Berlin dataset at Hackescher Markt (13.40294, 52.52330)
222222
TileParameters params{140831, 85967, 18};
@@ -366,7 +366,7 @@ BOOST_AUTO_TEST_CASE(test_tile_speeds)
366366
{
367367
using namespace osrm;
368368

369-
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/berlin_CH.osrm");
369+
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/ch/berlin.osrm");
370370

371371
// Small tile so we can test all the values
372372
// TileParameters params{272953, 191177, 19};

0 commit comments

Comments
 (0)