osrm-prepare -> osrm-contract
This commit is contained in:
committed by
Daniel J. Hofmann
parent
96a5e594b3
commit
085bab749f
@@ -1,5 +1,5 @@
|
||||
@prepare @options @files
|
||||
Feature: osrm-prepare command line options: files
|
||||
Feature: osrm-contract command line options: files
|
||||
# expansions:
|
||||
# {extracted_base} => path to current extracted input file
|
||||
# {profile} => path to current profile script
|
||||
@@ -13,18 +13,13 @@ Feature: osrm-prepare command line options: files
|
||||
| ab |
|
||||
And the data has been extracted
|
||||
|
||||
Scenario: osrm-prepare - Passing base file
|
||||
When I run "osrm-prepare {extracted_base}.osrm --profile {profile}"
|
||||
Scenario: osrm-contract - Passing base file
|
||||
When I run "osrm-contract {extracted_base}.osrm"
|
||||
Then stderr should be empty
|
||||
And it should exit with code 0
|
||||
|
||||
Scenario: osrm-prepare - Order of options should not matter
|
||||
When I run "osrm-prepare --profile {profile} {extracted_base}.osrm"
|
||||
Then stderr should be empty
|
||||
And it should exit with code 0
|
||||
|
||||
Scenario: osrm-prepare - Missing input file
|
||||
When I run "osrm-prepare over-the-rainbow.osrm --profile {profile}"
|
||||
Scenario: osrm-contract - Missing input file
|
||||
When I run "osrm-contract over-the-rainbow.osrm"
|
||||
And stderr should contain "over-the-rainbow.osrm"
|
||||
And stderr should contain "not found"
|
||||
And it should exit with code 1
|
||||
@@ -1,53 +1,47 @@
|
||||
@prepare @options @help
|
||||
Feature: osrm-prepare command line options: help
|
||||
Feature: osrm-contract command line options: help
|
||||
|
||||
Background:
|
||||
Given the profile "testbot"
|
||||
|
||||
Scenario: osrm-prepare - Help should be shown when no options are passed
|
||||
When I run "osrm-prepare"
|
||||
Scenario: osrm-contract - Help should be shown when no options are passed
|
||||
When I run "osrm-contract"
|
||||
Then stderr should be empty
|
||||
And stdout should contain "osrm-prepare <input.osrm> [options]:"
|
||||
And stdout should contain "osrm-contract <input.osrm> [options]:"
|
||||
And stdout should contain "Options:"
|
||||
And stdout should contain "--version"
|
||||
And stdout should contain "--help"
|
||||
And stdout should contain "Configuration:"
|
||||
And stdout should contain "--profile"
|
||||
And stdout should contain "--threads"
|
||||
And stdout should contain "--core"
|
||||
And stdout should contain "--level-cache"
|
||||
And stdout should contain "--segment-speed-file"
|
||||
And stdout should contain 18 lines
|
||||
And stdout should contain 17 lines
|
||||
And it should exit with code 1
|
||||
|
||||
Scenario: osrm-prepare - Help, short
|
||||
When I run "osrm-prepare -h"
|
||||
Scenario: osrm-contract - Help, short
|
||||
When I run "osrm-contract -h"
|
||||
Then stderr should be empty
|
||||
And stdout should contain "osrm-prepare <input.osrm> [options]:"
|
||||
And stdout should contain "osrm-contract <input.osrm> [options]:"
|
||||
And stdout should contain "Options:"
|
||||
And stdout should contain "--version"
|
||||
And stdout should contain "--help"
|
||||
And stdout should contain "Configuration:"
|
||||
And stdout should contain "--profile"
|
||||
And stdout should contain "--threads"
|
||||
And stdout should contain "--core"
|
||||
And stdout should contain "--level-cache"
|
||||
And stdout should contain "--segment-speed-file"
|
||||
And stdout should contain 18 lines
|
||||
And stdout should contain 17 lines
|
||||
And it should exit with code 0
|
||||
|
||||
Scenario: osrm-prepare - Help, long
|
||||
When I run "osrm-prepare --help"
|
||||
Scenario: osrm-contract - Help, long
|
||||
When I run "osrm-contract --help"
|
||||
Then stderr should be empty
|
||||
And stdout should contain "osrm-prepare <input.osrm> [options]:"
|
||||
And stdout should contain "osrm-contract <input.osrm> [options]:"
|
||||
And stdout should contain "Options:"
|
||||
And stdout should contain "--version"
|
||||
And stdout should contain "--help"
|
||||
And stdout should contain "Configuration:"
|
||||
And stdout should contain "--profile"
|
||||
And stdout should contain "--threads"
|
||||
And stdout should contain "--core"
|
||||
And stdout should contain "--level-cache"
|
||||
And stdout should contain "--segment-speed-file"
|
||||
And stdout should contain 18 lines
|
||||
And stdout should contain 17 lines
|
||||
And it should exit with code 0
|
||||
+3
-3
@@ -1,11 +1,11 @@
|
||||
@prepare @options @invalid
|
||||
Feature: osrm-prepare command line options: invalid options
|
||||
Feature: osrm-contract command line options: invalid options
|
||||
|
||||
Background:
|
||||
Given the profile "testbot"
|
||||
|
||||
Scenario: osrm-prepare - Non-existing option
|
||||
When I run "osrm-prepare --fly-me-to-the-moon"
|
||||
Scenario: osrm-contract - Non-existing option
|
||||
When I run "osrm-contract --fly-me-to-the-moon"
|
||||
Then stdout should be empty
|
||||
And stderr should contain "option"
|
||||
And stderr should contain "fly-me-to-the-moon"
|
||||
+5
-5
@@ -1,5 +1,5 @@
|
||||
@prepare @options @version
|
||||
Feature: osrm-prepare command line options: version
|
||||
Feature: osrm-contract command line options: version
|
||||
# the regex will match these two formats:
|
||||
# v0.3.7.0 # this is the normal format when you build from a git clone
|
||||
# -128-NOTFOUND # if you build from a shallow clone (used on Travis)
|
||||
@@ -7,15 +7,15 @@ Feature: osrm-prepare command line options: version
|
||||
Background:
|
||||
Given the profile "testbot"
|
||||
|
||||
Scenario: osrm-prepare - Version, short
|
||||
When I run "osrm-prepare --v"
|
||||
Scenario: osrm-contract - Version, short
|
||||
When I run "osrm-contract --v"
|
||||
Then stderr should be empty
|
||||
And stdout should contain 1 line
|
||||
And stdout should contain /(v\d{1,2}\.\d{1,2}\.\d{1,2}|\w*-\d+-\w+)/
|
||||
And it should exit with code 0
|
||||
|
||||
Scenario: osrm-prepare - Version, long
|
||||
When I run "osrm-prepare --version"
|
||||
Scenario: osrm-contract - Version, long
|
||||
When I run "osrm-contract --version"
|
||||
Then stderr should be empty
|
||||
And stdout should contain 1 line
|
||||
And stdout should contain /(v\d{1,2}\.\d{1,2}\.\d{1,2}|\w*-\d+-\w+)/
|
||||
@@ -32,7 +32,7 @@ Feature: Raster - weights
|
||||
Scenario: Weighting not based on raster sources
|
||||
Given the profile "testbot"
|
||||
When I run "osrm-extract {osm_base}.osm -p {profile}"
|
||||
And I run "osrm-prepare {osm_base}.osm"
|
||||
And I run "osrm-contract {osm_base}.osm"
|
||||
And I route I should get
|
||||
| from | to | route | speed |
|
||||
| a | b | ab | 36 km/h |
|
||||
@@ -45,7 +45,7 @@ Feature: Raster - weights
|
||||
Given the profile "rasterbot"
|
||||
When I run "osrm-extract {osm_base}.osm -p {profile}"
|
||||
Then stdout should contain "evaluating segment"
|
||||
And I run "osrm-prepare {osm_base}.osm"
|
||||
And I run "osrm-contract {osm_base}.osm"
|
||||
And I route I should get
|
||||
| from | to | route | speed |
|
||||
| a | b | ab | 8 km/h |
|
||||
@@ -63,7 +63,7 @@ Feature: Raster - weights
|
||||
Given the profile "rasterbot-interp"
|
||||
When I run "osrm-extract {osm_base}.osm -p {profile}"
|
||||
Then stdout should contain "evaluating segment"
|
||||
And I run "osrm-prepare {osm_base}.osm"
|
||||
And I run "osrm-contract {osm_base}.osm"
|
||||
And I route I should get
|
||||
| from | to | route | speed |
|
||||
| a | b | ab | 8 km/h |
|
||||
|
||||
@@ -10,8 +10,8 @@ When(/^I run "osrm\-extract\s?(.*?)"$/) do |options|
|
||||
run_bin 'osrm-extract', options
|
||||
end
|
||||
|
||||
When(/^I run "osrm\-prepare\s?(.*?)"$/) do |options|
|
||||
run_bin 'osrm-prepare', options
|
||||
When(/^I run "osrm\-contract\s?(.*?)"$/) do |options|
|
||||
run_bin 'osrm-contract', options
|
||||
end
|
||||
|
||||
When(/^I run "osrm\-datastore\s?(.*?)"$/) do |options|
|
||||
|
||||
@@ -277,9 +277,9 @@ def prepare_data
|
||||
Dir.chdir TEST_FOLDER do
|
||||
log_preprocess_info
|
||||
log "== Preparing #{extracted_file}.osm...", :preprocess
|
||||
unless system "#{LOAD_LIBRARIES}#{BIN_PATH}/osrm-prepare #{extracted_file}.osrm --profile #{PROFILES_PATH}/#{@profile}.lua >>#{PREPROCESS_LOG_FILE} 2>&1"
|
||||
unless system "#{LOAD_LIBRARIES}#{BIN_PATH}/osrm-contract #{extracted_file}.osrm >>#{PREPROCESS_LOG_FILE} 2>&1"
|
||||
log "*** Exited with code #{$?.exitstatus}.", :preprocess
|
||||
raise PrepareError.new $?.exitstatus, "osrm-prepare exited with code #{$?.exitstatus}."
|
||||
raise PrepareError.new $?.exitstatus, "osrm-contract exited with code #{$?.exitstatus}."
|
||||
end
|
||||
begin
|
||||
["osrm.hsgr","osrm.fileIndex","osrm.geometry","osrm.nodes","osrm.ramIndex","osrm.core","osrm.edges"].each do |file|
|
||||
|
||||
@@ -81,7 +81,7 @@ def verify_osrm_is_not_running
|
||||
end
|
||||
|
||||
def verify_existance_of_binaries
|
||||
["osrm-extract", "osrm-prepare", "osrm-routed"].each do |bin|
|
||||
["osrm-extract", "osrm-contract", "osrm-routed"].each do |bin|
|
||||
unless File.exists? "#{BIN_PATH}/#{bin}#{EXE}"
|
||||
raise "*** #{BIN_PATH}/#{bin}#{EXE} is missing. Build failed?"
|
||||
end
|
||||
|
||||
@@ -45,7 +45,7 @@ end
|
||||
|
||||
class PrepareError < OSRMError
|
||||
def initialize code, msg
|
||||
super 'osrm-prepare', code, msg, PREPROCESS_LOG_FILE, 3
|
||||
super 'osrm-contract', code, msg, PREPROCESS_LOG_FILE, 3
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ def bin_extract_hash
|
||||
end
|
||||
|
||||
def bin_prepare_hash
|
||||
@bin_prepare_hash ||= hash_of_files "#{BIN_PATH}/osrm-prepare#{EXE}"
|
||||
@bin_prepare_hash ||= hash_of_files "#{BIN_PATH}/osrm-contract#{EXE}"
|
||||
end
|
||||
|
||||
def bin_routed_hash
|
||||
|
||||
@@ -25,4 +25,4 @@ def run_bin bin, options
|
||||
@stderr = File.read 'error.log'
|
||||
@exit_code = $?.exitstatus
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user