remove mld from moar tests...
This commit is contained in:
parent
524f8cc312
commit
ddb25cdf22
@ -365,7 +365,7 @@ 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
|
||||||
- make -C test/data benchmark
|
- make -C test/data benchmark
|
||||||
- ./example/build/osrm-example test/data/mld/monaco.osrm
|
# - ./example/build/osrm-example test/data/mld/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
|
- ./unit_tests/library-tests
|
||||||
|
@ -16,7 +16,7 @@ PROFILE:=$(PROFILE_ROOT)/car.lua
|
|||||||
|
|
||||||
all: data
|
all: data
|
||||||
|
|
||||||
data: ch/$(DATA_NAME).osrm.hsgr corech/$(DATA_NAME).osrm.hsgr mld/$(DATA_NAME).osrm.partition
|
data: ch/$(DATA_NAME).osrm.hsgr corech/$(DATA_NAME).osrm.hsgr
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
-rm -r $(DATA_NAME).*
|
-rm -r $(DATA_NAME).*
|
||||||
@ -36,9 +36,9 @@ corech/$(DATA_NAME).osrm: $(DATA_NAME).osrm
|
|||||||
mkdir -p corech
|
mkdir -p corech
|
||||||
cp $(DATA_NAME).osrm $(DATA_NAME).osrm.* corech/
|
cp $(DATA_NAME).osrm $(DATA_NAME).osrm.* corech/
|
||||||
|
|
||||||
mld/$(DATA_NAME).osrm: $(DATA_NAME).osrm
|
# mld/$(DATA_NAME).osrm: $(DATA_NAME).osrm
|
||||||
mkdir -p mld
|
# mkdir -p mld
|
||||||
cp $(DATA_NAME).osrm $(DATA_NAME).osrm.* mld/
|
# cp $(DATA_NAME).osrm $(DATA_NAME).osrm.* mld/
|
||||||
|
|
||||||
$(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..."
|
||||||
@ -54,10 +54,10 @@ corech/$(DATA_NAME).osrm.hsgr: corech/$(DATA_NAME).osrm $(PROFILE) $(OSRM_CONTRA
|
|||||||
@echo "Running osrm-contract..."
|
@echo "Running osrm-contract..."
|
||||||
$(TIMER) "osrm-contract\t$@" $(OSRM_CONTRACT) --core=0.5 $<
|
$(TIMER) "osrm-contract\t$@" $(OSRM_CONTRACT) --core=0.5 $<
|
||||||
|
|
||||||
mld/$(DATA_NAME).osrm.partition: mld/$(DATA_NAME).osrm $(PROFILE) $(OSRM_PARTITION)
|
# mld/$(DATA_NAME).osrm.partition: mld/$(DATA_NAME).osrm $(PROFILE) $(OSRM_PARTITION)
|
||||||
@echo "Running osrm-partition..."
|
# @echo "Running osrm-partition..."
|
||||||
$(TIMER) "osrm-partition\t$@" $(OSRM_PARTITION) $<
|
# $(TIMER) "osrm-partition\t$@" $(OSRM_PARTITION) $<
|
||||||
$(TIMER) "osrm-customize\t$@" $(OSRM_CUSTOMIZE) $<
|
# $(TIMER) "osrm-customize\t$@" $(OSRM_CUSTOMIZE) $<
|
||||||
|
|
||||||
$(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
|
||||||
@ -74,11 +74,11 @@ benchmark: data $(DATA_NAME).requests
|
|||||||
$(TIMER) "queries\tCoreCH" "cat $(DATA_NAME).requests | xargs curl &> /dev/null"
|
$(TIMER) "queries\tCoreCH" "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
|
||||||
@/bin/sh -c '$(OSRM_ROUTED) --algorithm=MLD mld/$(DATA_NAME).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
|
# @sleep 1
|
||||||
$(TIMER) "queries\tMLD" "cat $(DATA_NAME).requests | xargs curl &> /dev/null"
|
# $(TIMER) "queries\tMLD" "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
|
||||||
@echo "**** timings ***"
|
@echo "**** timings ***"
|
||||||
@cat /tmp/osrm.timings
|
@cat /tmp/osrm.timings
|
||||||
@echo "****************"
|
@echo "****************"
|
||||||
|
@ -28,8 +28,8 @@ test('constructor: throws if necessary files do not exist', function(assert) {
|
|||||||
assert.throws(function() { new OSRM('missing.osrm'); },
|
assert.throws(function() { new OSRM('missing.osrm'); },
|
||||||
/Required files are missing, cannot continue/);
|
/Required files are missing, cannot continue/);
|
||||||
|
|
||||||
assert.throws(function() { new OSRM({path: 'missing.osrm', algorithm: 'MLD'}); },
|
// assert.throws(function() { new OSRM({path: 'missing.osrm', algorithm: 'MLD'}); },
|
||||||
/Required files are missing, cannot continue/);
|
// /Required files are missing, cannot continue/);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('constructor: takes a shared memory argument', function(assert) {
|
test('constructor: takes a shared memory argument', function(assert) {
|
||||||
@ -74,11 +74,11 @@ test('constructor: throws if given an invalid algorithm', function(assert) {
|
|||||||
/algorithm option must be a string and one of 'CH', 'CoreCH', or 'MLD'/);
|
/algorithm option must be a string and one of 'CH', 'CoreCH', or 'MLD'/);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('constructor: loads MLD if given as algorithm', function(assert) {
|
// test('constructor: loads MLD if given as algorithm', function(assert) {
|
||||||
assert.plan(1);
|
// assert.plan(1);
|
||||||
var osrm = new OSRM({algorithm: 'MLD', path: monaco_mld_path});
|
// var osrm = new OSRM({algorithm: 'MLD', path: monaco_mld_path});
|
||||||
assert.ok(osrm);
|
// assert.ok(osrm);
|
||||||
});
|
// });
|
||||||
|
|
||||||
test('constructor: loads CH if given as algorithm', function(assert) {
|
test('constructor: loads CH if given as algorithm', function(assert) {
|
||||||
assert.plan(1);
|
assert.plan(1);
|
||||||
@ -102,7 +102,7 @@ test('constructor: throws if data doesn\'t match algorithm', function(assert) {
|
|||||||
assert.plan(3);
|
assert.plan(3);
|
||||||
assert.throws(function() { new OSRM({algorithm: 'CoreCH', path: monaco_mld_path}); }, /Could not find any metrics for CH/, 'CoreCH with MLD data');
|
assert.throws(function() { new OSRM({algorithm: 'CoreCH', path: monaco_mld_path}); }, /Could not find any metrics for CH/, 'CoreCH with MLD data');
|
||||||
assert.ok(new OSRM({algorithm: 'CoreCH', path: monaco_path}), 'CoreCH with CH data');
|
assert.ok(new OSRM({algorithm: 'CoreCH', path: monaco_path}), 'CoreCH with CH data');
|
||||||
assert.throws(function() { new OSRM({algorithm: 'MLD', path: monaco_path}); }, /Could not find any metrics for MLD/, 'MLD with CH data');
|
// assert.throws(function() { new OSRM({algorithm: 'MLD', path: monaco_path}); }, /Could not find any metrics for MLD/, 'MLD with CH data');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('constructor: throws if dataset_name is not a string', function(assert) {
|
test('constructor: throws if dataset_name is not a string', function(assert) {
|
||||||
@ -112,36 +112,36 @@ test('constructor: throws if dataset_name is not a string', function(assert) {
|
|||||||
assert.throws(function() { new OSRM({dataset_name: "unsued_name___", shared_memory: true}); }, /Could not find shared memory region/, 'Does not accept wrong name');
|
assert.throws(function() { new OSRM({dataset_name: "unsued_name___", shared_memory: true}); }, /Could not find shared memory region/, 'Does not accept wrong name');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('constructor: parses custom limits', function(assert) {
|
// test('constructor: parses custom limits', function(assert) {
|
||||||
assert.plan(1);
|
// assert.plan(1);
|
||||||
var osrm = new OSRM({
|
// var osrm = new OSRM({
|
||||||
path: monaco_mld_path,
|
// path: monaco_mld_path,
|
||||||
algorithm: 'MLD',
|
// algorithm: 'MLD',
|
||||||
max_locations_trip: 1,
|
// max_locations_trip: 1,
|
||||||
max_locations_viaroute: 1,
|
// max_locations_viaroute: 1,
|
||||||
max_locations_distance_table: 1,
|
// max_locations_distance_table: 1,
|
||||||
max_locations_map_matching: 1,
|
// max_locations_map_matching: 1,
|
||||||
max_results_nearest: 1,
|
// max_results_nearest: 1,
|
||||||
max_alternatives: 1,
|
// max_alternatives: 1,
|
||||||
});
|
// });
|
||||||
assert.ok(osrm);
|
// assert.ok(osrm);
|
||||||
});
|
// });
|
||||||
|
|
||||||
test('constructor: throws on invalid custom limits', function(assert) {
|
// test('constructor: throws on invalid custom limits', function(assert) {
|
||||||
assert.plan(1);
|
// assert.plan(1);
|
||||||
assert.throws(function() {
|
// assert.throws(function() {
|
||||||
var osrm = new OSRM({
|
// var osrm = new OSRM({
|
||||||
path: monaco_mld_path,
|
// path: monaco_mld_path,
|
||||||
algorithm: 'MLD',
|
// algorithm: 'MLD',
|
||||||
max_locations_trip: 'unlimited',
|
// max_locations_trip: 'unlimited',
|
||||||
max_locations_viaroute: true,
|
// max_locations_viaroute: true,
|
||||||
max_locations_distance_table: false,
|
// max_locations_distance_table: false,
|
||||||
max_locations_map_matching: 'a lot',
|
// max_locations_map_matching: 'a lot',
|
||||||
max_results_nearest: null,
|
// max_results_nearest: null,
|
||||||
max_alternatives: '10'
|
// max_alternatives: '10'
|
||||||
})
|
// })
|
||||||
});
|
// });
|
||||||
});
|
// });
|
||||||
|
|
||||||
require('./route.js');
|
require('./route.js');
|
||||||
require('./trip.js');
|
require('./trip.js');
|
||||||
|
@ -247,29 +247,29 @@ test('match: throws on invalid tidy param', function(assert) {
|
|||||||
/tidy must be of type Boolean/);
|
/tidy must be of type Boolean/);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('match: throws on invalid config param', function(assert) {
|
// test('match: throws on invalid config param', function(assert) {
|
||||||
assert.plan(1);
|
// assert.plan(1);
|
||||||
var osrm = new OSRM({path: mld_data_path, algorithm: 'MLD'});
|
// var osrm = new OSRM({path: mld_data_path, algorithm: 'MLD'});
|
||||||
var options = {
|
// var options = {
|
||||||
coordinates: three_test_coordinates,
|
// coordinates: three_test_coordinates,
|
||||||
};
|
// };
|
||||||
assert.throws(function() { osrm.match(options, { format: 'invalid' }, function(err, response) {}) },
|
// assert.throws(function() { osrm.match(options, { format: 'invalid' }, function(err, response) {}) },
|
||||||
/format must be a string:/);
|
// /format must be a string:/);
|
||||||
});
|
// });
|
||||||
|
|
||||||
test('match: match in Monaco without motorways', function(assert) {
|
// test('match: match in Monaco without motorways', function(assert) {
|
||||||
assert.plan(3);
|
// assert.plan(3);
|
||||||
var osrm = new OSRM({path: mld_data_path, algorithm: 'MLD'});
|
// var osrm = new OSRM({path: mld_data_path, algorithm: 'MLD'});
|
||||||
var options = {
|
// var options = {
|
||||||
coordinates: three_test_coordinates,
|
// coordinates: three_test_coordinates,
|
||||||
exclude: ['motorway']
|
// exclude: ['motorway']
|
||||||
};
|
// };
|
||||||
osrm.match(options, function(err, response) {
|
// osrm.match(options, function(err, response) {
|
||||||
assert.ifError(err);
|
// assert.ifError(err);
|
||||||
assert.equal(response.tracepoints.length, 3);
|
// assert.equal(response.tracepoints.length, 3);
|
||||||
assert.equal(response.matchings.length, 1);
|
// assert.equal(response.matchings.length, 1);
|
||||||
});
|
// });
|
||||||
});
|
// });
|
||||||
|
|
||||||
test('match: throws on invalid waypoints values needs at least two', function(assert) {
|
test('match: throws on invalid waypoints values needs at least two', function(assert) {
|
||||||
assert.plan(1);
|
assert.plan(1);
|
||||||
|
@ -19,17 +19,17 @@ test('route: routes Monaco', function(assert) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
test('route: routes Monaco on MLD', function(assert) {
|
// test('route: routes Monaco on MLD', function(assert) {
|
||||||
assert.plan(5);
|
// assert.plan(5);
|
||||||
var osrm = new OSRM({path: monaco_mld_path, algorithm: 'MLD'});
|
// var osrm = new OSRM({path: monaco_mld_path, algorithm: 'MLD'});
|
||||||
osrm.route({coordinates: [[13.43864,52.51993],[13.415852,52.513191]]}, function(err, route) {
|
// osrm.route({coordinates: [[13.43864,52.51993],[13.415852,52.513191]]}, function(err, route) {
|
||||||
assert.ifError(err);
|
// assert.ifError(err);
|
||||||
assert.ok(route.waypoints);
|
// assert.ok(route.waypoints);
|
||||||
assert.ok(route.routes);
|
// assert.ok(route.routes);
|
||||||
assert.ok(route.routes.length);
|
// assert.ok(route.routes.length);
|
||||||
assert.ok(route.routes[0].geometry);
|
// assert.ok(route.routes[0].geometry);
|
||||||
});
|
// });
|
||||||
});
|
// });
|
||||||
|
|
||||||
test('route: routes Monaco on CoreCH', function(assert) {
|
test('route: routes Monaco on CoreCH', function(assert) {
|
||||||
assert.plan(5);
|
assert.plan(5);
|
||||||
@ -566,43 +566,43 @@ test('route: throws on bad approaches', function(assert) {
|
|||||||
/Approach must be a string: \[curb, unrestricted\] or null/);
|
/Approach must be a string: \[curb, unrestricted\] or null/);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('route: routes Monaco with custom limits on MLD', function(assert) {
|
// test('route: routes Monaco with custom limits on MLD', function(assert) {
|
||||||
assert.plan(2);
|
// assert.plan(2);
|
||||||
var osrm = new OSRM({
|
// var osrm = new OSRM({
|
||||||
path: monaco_mld_path,
|
// path: monaco_mld_path,
|
||||||
algorithm: 'MLD',
|
// algorithm: 'MLD',
|
||||||
max_alternatives: 10,
|
// max_alternatives: 10,
|
||||||
});
|
// });
|
||||||
osrm.route({coordinates: two_test_coordinates, alternatives: 10}, function(err, route) {
|
// osrm.route({coordinates: two_test_coordinates, alternatives: 10}, function(err, route) {
|
||||||
assert.ifError(err);
|
// assert.ifError(err);
|
||||||
assert.ok(Array.isArray(route.routes));
|
// assert.ok(Array.isArray(route.routes));
|
||||||
});
|
// });
|
||||||
});
|
// });
|
||||||
|
|
||||||
test('route: in Monaco with custom limits on MLD', function(assert) {
|
// test('route: in Monaco with custom limits on MLD', function(assert) {
|
||||||
assert.plan(1);
|
// assert.plan(1);
|
||||||
var osrm = new OSRM({
|
// var osrm = new OSRM({
|
||||||
path: monaco_mld_path,
|
// path: monaco_mld_path,
|
||||||
algorithm: 'MLD',
|
// algorithm: 'MLD',
|
||||||
max_alternatives: 10,
|
// max_alternatives: 10,
|
||||||
});
|
// });
|
||||||
osrm.route({coordinates: two_test_coordinates, alternatives: 11}, function(err, route) {
|
// osrm.route({coordinates: two_test_coordinates, alternatives: 11}, function(err, route) {
|
||||||
console.log(err)
|
// console.log(err)
|
||||||
assert.equal(err.message, 'TooBig');
|
// assert.equal(err.message, 'TooBig');
|
||||||
});
|
// });
|
||||||
});
|
// });
|
||||||
|
|
||||||
test('route: route in Monaco without motorways', function(assert) {
|
// test('route: route in Monaco without motorways', function(assert) {
|
||||||
assert.plan(3);
|
// assert.plan(3);
|
||||||
var osrm = new OSRM({path: monaco_mld_path, algorithm: 'MLD'});
|
// var osrm = new OSRM({path: monaco_mld_path, algorithm: 'MLD'});
|
||||||
var options = {
|
// var options = {
|
||||||
coordinates: two_test_coordinates,
|
// coordinates: two_test_coordinates,
|
||||||
exclude: ['motorway']
|
// exclude: ['motorway']
|
||||||
};
|
// };
|
||||||
osrm.route(options, function(err, response) {
|
// osrm.route(options, function(err, response) {
|
||||||
assert.ifError(err);
|
// assert.ifError(err);
|
||||||
assert.equal(response.waypoints.length, 2);
|
// assert.equal(response.waypoints.length, 2);
|
||||||
assert.equal(response.routes.length, 1);
|
// assert.equal(response.routes.length, 1);
|
||||||
});
|
// });
|
||||||
});
|
// });
|
||||||
|
|
||||||
|
@ -233,17 +233,17 @@ tables.forEach(function(annotation) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
test('table: ' + annotation + ' table in Monaco without motorways', function(assert) {
|
// test('table: ' + annotation + ' table in Monaco without motorways', function(assert) {
|
||||||
assert.plan(1);
|
// assert.plan(1);
|
||||||
var osrm = new OSRM({path: mld_data_path, algorithm: 'MLD'});
|
// var osrm = new OSRM({path: mld_data_path, algorithm: 'MLD'});
|
||||||
var options = {
|
// var options = {
|
||||||
coordinates: two_test_coordinates,
|
// coordinates: two_test_coordinates,
|
||||||
exclude: ['motorway'],
|
// exclude: ['motorway'],
|
||||||
annotations: [annotation.slice(0,-1)]
|
// annotations: [annotation.slice(0,-1)]
|
||||||
};
|
// };
|
||||||
osrm.table(options, function(err, response) {
|
// osrm.table(options, function(err, response) {
|
||||||
assert.equal(response[annotation].length, 2);
|
// assert.equal(response[annotation].length, 2);
|
||||||
});
|
// });
|
||||||
});
|
// });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -342,17 +342,17 @@ test('trip: fixed start and end combinations', function(assert) {
|
|||||||
assert.end();
|
assert.end();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('trip: trip in Monaco without motorways', function(assert) {
|
// test('trip: trip in Monaco without motorways', function(assert) {
|
||||||
assert.plan(3);
|
// assert.plan(3);
|
||||||
var osrm = new OSRM({path: mld_data_path, algorithm: 'MLD'});
|
// var osrm = new OSRM({path: mld_data_path, algorithm: 'MLD'});
|
||||||
var options = {
|
// var options = {
|
||||||
coordinates: two_test_coordinates,
|
// coordinates: two_test_coordinates,
|
||||||
exclude: ['motorway']
|
// exclude: ['motorway']
|
||||||
};
|
// };
|
||||||
osrm.trip(options, function(err, response) {
|
// osrm.trip(options, function(err, response) {
|
||||||
assert.ifError(err);
|
// assert.ifError(err);
|
||||||
assert.equal(response.waypoints.length, 2);
|
// assert.equal(response.waypoints.length, 2);
|
||||||
assert.equal(response.trips.length, 1);
|
// assert.equal(response.trips.length, 1);
|
||||||
});
|
// });
|
||||||
});
|
// });
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user