Revert "disable mld tests for now"
This reverts commit 3ecf673f91ca7ab381a0a4a2c5fe1e2c52653cd8. Revert "no mld" This reverts commit 29464f40ccb86a5ed5de7a31e4f136329c33718e. Revert "comment out MLD tests" This reverts commit b81cc7010cc5454d9c03d07609d1b1a3477e5de3. Revert "uncommenting parts of test makefile" This reverts commit de152a821e524eaf7a337c34994fdcef174eafda. uncomment mld data creation in test make file uncomment a few nodejs mld tests as they pass now
This commit is contained in:
parent
f10ad15bb4
commit
5961037dff
@ -18,7 +18,7 @@
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "node ./node_modules/eslint/bin/eslint.js -c ./.eslintrc features/step_definitions/ features/support/",
|
||||
"test": "npm run lint && node ./node_modules/cucumber/bin/cucumber.js features/ -p verify",
|
||||
"test": "npm run lint && node ./node_modules/cucumber/bin/cucumber.js features/ -p verify && node ./node_modules/cucumber/bin/cucumber.js features/ -p mld",
|
||||
"clean": "rm -rf test/cache",
|
||||
"docs": "./scripts/build_api_docs.sh",
|
||||
"install": "node-pre-gyp install --fallback-to-build=false || ./scripts/node_install.sh",
|
||||
|
||||
@ -6,8 +6,12 @@ var fs = require('fs');
|
||||
var name = process.argv[2];
|
||||
var cmd = process.argv.slice(3).join(' ');
|
||||
var start = Date.now();
|
||||
exec(cmd, (err) => {
|
||||
if (err) return console.log(err);
|
||||
exec(cmd, (err, stdout, stderr) => {
|
||||
if (err) {
|
||||
console.log(stdout);
|
||||
console.log(stderr);
|
||||
return process.exit(err.code);
|
||||
}
|
||||
var stop = +new Date();
|
||||
var time = (stop - start) / 1000.;
|
||||
fs.appendFileSync('/tmp/osrm.timings', `${name}\t${time}`, 'utf-8');
|
||||
|
||||
@ -74,11 +74,11 @@ benchmark: data $(DATA_NAME).requests
|
||||
$(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 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
|
||||
# @rm 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
|
||||
@rm osrm-routed.pid
|
||||
@echo "**** timings ***"
|
||||
@cat /tmp/osrm.timings
|
||||
@echo "****************"
|
||||
|
||||
@ -23,14 +23,14 @@ test('constructor: does not accept more than one parameter', function(assert) {
|
||||
/Only accepts one parameter/);
|
||||
});
|
||||
|
||||
// test('constructor: throws if necessary files do not exist', function(assert) {
|
||||
// assert.plan(2);
|
||||
// assert.throws(function() { new OSRM('missing.osrm'); },
|
||||
// /Required files are missing, cannot continue/);
|
||||
test('constructor: throws if necessary files do not exist', function(assert) {
|
||||
assert.plan(2);
|
||||
assert.throws(function() { new OSRM('missing.osrm'); },
|
||||
/Required files are missing, cannot continue/);
|
||||
|
||||
// assert.throws(function() { new OSRM({path: 'missing.osrm', algorithm: 'MLD'}); },
|
||||
// /Required files are missing, cannot continue/);
|
||||
// });
|
||||
assert.throws(function() { new OSRM({path: 'missing.osrm', algorithm: 'MLD'}); },
|
||||
/Required files are missing, cannot continue/);
|
||||
});
|
||||
|
||||
test('constructor: takes a shared memory argument', function(assert) {
|
||||
assert.plan(1);
|
||||
@ -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'/);
|
||||
});
|
||||
|
||||
// test('constructor: loads MLD if given as algorithm', function(assert) {
|
||||
// assert.plan(1);
|
||||
// var osrm = new OSRM({algorithm: 'MLD', path: monaco_mld_path});
|
||||
// assert.ok(osrm);
|
||||
// });
|
||||
test('constructor: loads MLD if given as algorithm', function(assert) {
|
||||
assert.plan(1);
|
||||
var osrm = new OSRM({algorithm: 'MLD', path: monaco_mld_path});
|
||||
assert.ok(osrm);
|
||||
});
|
||||
|
||||
test('constructor: loads CH if given as algorithm', function(assert) {
|
||||
assert.plan(1);
|
||||
@ -98,12 +98,12 @@ test('constructor: autoswitches to CoreCH for a CH dataset if capable', function
|
||||
assert.ok(osrm);
|
||||
});
|
||||
|
||||
// test('constructor: throws if data doesn\'t match algorithm', function(assert) {
|
||||
// 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.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');
|
||||
// });
|
||||
test('constructor: throws if data doesn\'t match algorithm', function(assert) {
|
||||
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.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');
|
||||
});
|
||||
|
||||
test('constructor: throws if dataset_name is not a string', function(assert) {
|
||||
assert.plan(3);
|
||||
@ -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');
|
||||
});
|
||||
|
||||
// test('constructor: parses custom limits', function(assert) {
|
||||
// assert.plan(1);
|
||||
// var osrm = new OSRM({
|
||||
// path: monaco_mld_path,
|
||||
// algorithm: 'MLD',
|
||||
// max_locations_trip: 1,
|
||||
// max_locations_viaroute: 1,
|
||||
// max_locations_distance_table: 1,
|
||||
// max_locations_map_matching: 1,
|
||||
// max_results_nearest: 1,
|
||||
// max_alternatives: 1,
|
||||
// });
|
||||
// assert.ok(osrm);
|
||||
// });
|
||||
test('constructor: parses custom limits', function(assert) {
|
||||
assert.plan(1);
|
||||
var osrm = new OSRM({
|
||||
path: monaco_mld_path,
|
||||
algorithm: 'MLD',
|
||||
max_locations_trip: 1,
|
||||
max_locations_viaroute: 1,
|
||||
max_locations_distance_table: 1,
|
||||
max_locations_map_matching: 1,
|
||||
max_results_nearest: 1,
|
||||
max_alternatives: 1,
|
||||
});
|
||||
assert.ok(osrm);
|
||||
});
|
||||
|
||||
// test('constructor: throws on invalid custom limits', function(assert) {
|
||||
// assert.plan(1);
|
||||
// assert.throws(function() {
|
||||
// var osrm = new OSRM({
|
||||
// path: monaco_mld_path,
|
||||
// algorithm: 'MLD',
|
||||
// max_locations_trip: 'unlimited',
|
||||
// max_locations_viaroute: true,
|
||||
// max_locations_distance_table: false,
|
||||
// max_locations_map_matching: 'a lot',
|
||||
// max_results_nearest: null,
|
||||
// max_alternatives: '10'
|
||||
// })
|
||||
// });
|
||||
// });
|
||||
test('constructor: throws on invalid custom limits', function(assert) {
|
||||
assert.plan(1);
|
||||
assert.throws(function() {
|
||||
var osrm = new OSRM({
|
||||
path: monaco_mld_path,
|
||||
algorithm: 'MLD',
|
||||
max_locations_trip: 'unlimited',
|
||||
max_locations_viaroute: true,
|
||||
max_locations_distance_table: false,
|
||||
max_locations_map_matching: 'a lot',
|
||||
max_results_nearest: null,
|
||||
max_alternatives: '10'
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
require('./route.js');
|
||||
require('./trip.js');
|
||||
|
||||
@ -247,29 +247,29 @@ test('match: throws on invalid tidy param', function(assert) {
|
||||
/tidy must be of type Boolean/);
|
||||
});
|
||||
|
||||
// test('match: throws on invalid config param', function(assert) {
|
||||
// assert.plan(1);
|
||||
// var osrm = new OSRM({path: mld_data_path, algorithm: 'MLD'});
|
||||
// var options = {
|
||||
// coordinates: three_test_coordinates,
|
||||
// };
|
||||
// assert.throws(function() { osrm.match(options, { format: 'invalid' }, function(err, response) {}) },
|
||||
// /format must be a string:/);
|
||||
// });
|
||||
test('match: throws on invalid config param', function(assert) {
|
||||
assert.plan(1);
|
||||
var osrm = new OSRM({path: mld_data_path, algorithm: 'MLD'});
|
||||
var options = {
|
||||
coordinates: three_test_coordinates,
|
||||
};
|
||||
assert.throws(function() { osrm.match(options, { format: 'invalid' }, function(err, response) {}) },
|
||||
/format must be a string:/);
|
||||
});
|
||||
|
||||
// test('match: match in Monaco without motorways', function(assert) {
|
||||
// assert.plan(3);
|
||||
// var osrm = new OSRM({path: mld_data_path, algorithm: 'MLD'});
|
||||
// var options = {
|
||||
// coordinates: three_test_coordinates,
|
||||
// exclude: ['motorway']
|
||||
// };
|
||||
// osrm.match(options, function(err, response) {
|
||||
// assert.ifError(err);
|
||||
// assert.equal(response.tracepoints.length, 3);
|
||||
// assert.equal(response.matchings.length, 1);
|
||||
// });
|
||||
// });
|
||||
test('match: match in Monaco without motorways', function(assert) {
|
||||
assert.plan(3);
|
||||
var osrm = new OSRM({path: mld_data_path, algorithm: 'MLD'});
|
||||
var options = {
|
||||
coordinates: three_test_coordinates,
|
||||
exclude: ['motorway']
|
||||
};
|
||||
osrm.match(options, function(err, response) {
|
||||
assert.ifError(err);
|
||||
assert.equal(response.tracepoints.length, 3);
|
||||
assert.equal(response.matchings.length, 1);
|
||||
});
|
||||
});
|
||||
|
||||
test('match: throws on invalid waypoints values needs at least two', function(assert) {
|
||||
assert.plan(1);
|
||||
|
||||
@ -73,15 +73,15 @@ test('nearest: throws on invalid args', function(assert) {
|
||||
/format must be a string:/);
|
||||
});
|
||||
|
||||
// test('nearest: nearest in Monaco without motorways', function(assert) {
|
||||
// assert.plan(2);
|
||||
// var osrm = new OSRM({path: mld_data_path, algorithm: 'MLD'});
|
||||
// var options = {
|
||||
// coordinates: [two_test_coordinates[0]],
|
||||
// exclude: ['motorway']
|
||||
// };
|
||||
// osrm.nearest(options, function(err, response) {
|
||||
// assert.ifError(err);
|
||||
// assert.equal(response.waypoints.length, 1);
|
||||
// });
|
||||
// });
|
||||
test('nearest: nearest in Monaco without motorways', function(assert) {
|
||||
assert.plan(2);
|
||||
var osrm = new OSRM({path: mld_data_path, algorithm: 'MLD'});
|
||||
var options = {
|
||||
coordinates: [two_test_coordinates[0]],
|
||||
exclude: ['motorway']
|
||||
};
|
||||
osrm.nearest(options, function(err, response) {
|
||||
assert.ifError(err);
|
||||
assert.equal(response.waypoints.length, 1);
|
||||
});
|
||||
});
|
||||
|
||||
@ -592,17 +592,17 @@ test('route: throws on bad approaches', function(assert) {
|
||||
// });
|
||||
// });
|
||||
|
||||
// test('route: route in Monaco without motorways', function(assert) {
|
||||
// assert.plan(3);
|
||||
// var osrm = new OSRM({path: monaco_mld_path, algorithm: 'MLD'});
|
||||
// var options = {
|
||||
// coordinates: two_test_coordinates,
|
||||
// exclude: ['motorway']
|
||||
// };
|
||||
// osrm.route(options, function(err, response) {
|
||||
// assert.ifError(err);
|
||||
// assert.equal(response.waypoints.length, 2);
|
||||
// assert.equal(response.routes.length, 1);
|
||||
// });
|
||||
// });
|
||||
test('route: route in Monaco without motorways', function(assert) {
|
||||
assert.plan(3);
|
||||
var osrm = new OSRM({path: monaco_mld_path, algorithm: 'MLD'});
|
||||
var options = {
|
||||
coordinates: two_test_coordinates,
|
||||
exclude: ['motorway']
|
||||
};
|
||||
osrm.route(options, function(err, response) {
|
||||
assert.ifError(err);
|
||||
assert.equal(response.waypoints.length, 2);
|
||||
assert.equal(response.routes.length, 1);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@ -233,17 +233,17 @@ tables.forEach(function(annotation) {
|
||||
});
|
||||
});
|
||||
|
||||
// test('table: ' + annotation + ' table in Monaco without motorways', function(assert) {
|
||||
// assert.plan(1);
|
||||
// var osrm = new OSRM({path: mld_data_path, algorithm: 'MLD'});
|
||||
// var options = {
|
||||
// coordinates: two_test_coordinates,
|
||||
// exclude: ['motorway'],
|
||||
// annotations: [annotation.slice(0,-1)]
|
||||
// };
|
||||
// osrm.table(options, function(err, response) {
|
||||
// assert.equal(response[annotation].length, 2);
|
||||
// });
|
||||
// });
|
||||
test('table: ' + annotation + ' table in Monaco without motorways', function(assert) {
|
||||
assert.plan(1);
|
||||
var osrm = new OSRM({path: mld_data_path, algorithm: 'MLD'});
|
||||
var options = {
|
||||
coordinates: two_test_coordinates,
|
||||
exclude: ['motorway'],
|
||||
annotations: [annotation.slice(0,-1)]
|
||||
};
|
||||
osrm.table(options, function(err, response) {
|
||||
assert.equal(response[annotation].length, 2);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@ -342,17 +342,17 @@ test('trip: fixed start and end combinations', function(assert) {
|
||||
assert.end();
|
||||
});
|
||||
|
||||
// test('trip: trip in Monaco without motorways', function(assert) {
|
||||
// assert.plan(3);
|
||||
// var osrm = new OSRM({path: mld_data_path, algorithm: 'MLD'});
|
||||
// var options = {
|
||||
// coordinates: two_test_coordinates,
|
||||
// exclude: ['motorway']
|
||||
// };
|
||||
// osrm.trip(options, function(err, response) {
|
||||
// assert.ifError(err);
|
||||
// assert.equal(response.waypoints.length, 2);
|
||||
// assert.equal(response.trips.length, 1);
|
||||
// });
|
||||
// });
|
||||
test('trip: trip in Monaco without motorways', function(assert) {
|
||||
assert.plan(3);
|
||||
var osrm = new OSRM({path: mld_data_path, algorithm: 'MLD'});
|
||||
var options = {
|
||||
coordinates: two_test_coordinates,
|
||||
exclude: ['motorway']
|
||||
};
|
||||
osrm.trip(options, function(err, response) {
|
||||
assert.ifError(err);
|
||||
assert.equal(response.waypoints.length, 2);
|
||||
assert.equal(response.trips.length, 1);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@ -16,13 +16,13 @@ BOOST_AUTO_TEST_CASE(test_extract_with_invalid_config)
|
||||
std::exception); // including osrm::util::exception, osmium::io_error, etc.
|
||||
}
|
||||
|
||||
// BOOST_AUTO_TEST_CASE(test_extract_with_valid_config)
|
||||
// {
|
||||
// osrm::ExtractorConfig config;
|
||||
// config.input_path = OSRM_TEST_DATA_DIR "/monaco.osm.pbf";
|
||||
// config.UseDefaultOutputNames(OSRM_TEST_DATA_DIR "/monaco.osm.pbf");
|
||||
// config.requested_num_threads = tbb::task_scheduler_init::default_num_threads();
|
||||
// BOOST_CHECK_NO_THROW(osrm::extract(config));
|
||||
// }
|
||||
BOOST_AUTO_TEST_CASE(test_extract_with_valid_config)
|
||||
{
|
||||
osrm::ExtractorConfig config;
|
||||
config.input_path = OSRM_TEST_DATA_DIR "/monaco.osm.pbf";
|
||||
config.UseDefaultOutputNames(OSRM_TEST_DATA_DIR "/monaco.osm.pbf");
|
||||
config.requested_num_threads = tbb::task_scheduler_init::default_num_threads();
|
||||
BOOST_CHECK_NO_THROW(osrm::extract(config));
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user