fix tests that use {base} expansion
This commit is contained in:
parent
48333f73d5
commit
cc3646ca16
@ -1,7 +1,7 @@
|
||||
@extract @options @files
|
||||
Feature: osrm-extract command line options: files
|
||||
# expansions:
|
||||
# {base} => path to current input file
|
||||
# {osm_base} => path to current input file
|
||||
# {profile} => path to current profile script
|
||||
|
||||
Background:
|
||||
@ -14,12 +14,12 @@ Feature: osrm-extract command line options: files
|
||||
And the data has been saved to disk
|
||||
|
||||
Scenario: osrm-extract - Passing base file
|
||||
When I run "osrm-extract {base}.osm --profile {profile}"
|
||||
When I run "osrm-extract {osm_base}.osm --profile {profile}"
|
||||
Then stderr should be empty
|
||||
And it should exit with code 0
|
||||
|
||||
Scenario: osrm-extract - Order of options should not matter
|
||||
When I run "osrm-extract --profile {profile} {base}.osm"
|
||||
When I run "osrm-extract --profile {profile} {osm_base}.osm"
|
||||
Then stderr should be empty
|
||||
And it should exit with code 0
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
@prepare @options @files
|
||||
Feature: osrm-prepare command line options: files
|
||||
# expansions:
|
||||
# {base} => path to current input file
|
||||
# {extracted_base} => path to current extracted input file
|
||||
# {profile} => path to current profile script
|
||||
|
||||
Background:
|
||||
@ -14,12 +14,12 @@ Feature: osrm-prepare command line options: files
|
||||
And the data has been extracted
|
||||
|
||||
Scenario: osrm-prepare - Passing base file
|
||||
When I run "osrm-prepare {base}.osrm --profile {profile}"
|
||||
When I run "osrm-prepare {extracted_base}.osrm --profile {profile}"
|
||||
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} {base}.osrm"
|
||||
When I run "osrm-prepare --profile {profile} {extracted_base}.osrm"
|
||||
Then stderr should be empty
|
||||
And it should exit with code 0
|
||||
|
||||
|
@ -4,8 +4,8 @@ Feature: osrm-routed command line options: files
|
||||
# For testing program options, the --trial option is used, which causes osrm-routed to quit
|
||||
# immediately after initialization. This makes testing easier and faster.
|
||||
#
|
||||
# The {base} part of the options to osrm-routed will be expanded to the actual base path of
|
||||
# the preprocessed file.
|
||||
# The {prepared_base} part of the options to osrm-routed will be expanded to the actual base path of
|
||||
# the prepared input file.
|
||||
|
||||
# TODO
|
||||
# Since we're not using osmr-datastore for all testing, osrm-routed is kept running.
|
||||
@ -22,7 +22,7 @@ Feature: osrm-routed command line options: files
|
||||
And the data has been prepared
|
||||
|
||||
Scenario: osrm-routed - Passing base file
|
||||
When I run "osrm-routed {base}.osrm --trial"
|
||||
When I run "osrm-routed {prepared_base}.osrm --trial"
|
||||
Then stdout should contain /^\[info\] starting up engines/
|
||||
And stdout should contain /\d{1,2}\.\d{1,2}\.\d{1,2}/
|
||||
And stdout should contain /compiled at/
|
||||
|
@ -2,11 +2,20 @@ def run_bin bin, options
|
||||
Dir.chdir TEST_FOLDER do
|
||||
opt = options.dup
|
||||
|
||||
if opt.include? '{base}'
|
||||
raise "*** {base} is missing" unless prepared_file
|
||||
opt.gsub! "{base}", "#{prepared_file}"
|
||||
if opt.include? '{osm_base}'
|
||||
raise "*** {osm_base} is missing" unless osm_file
|
||||
opt.gsub! "{osm_base}", "#{osm_file}"
|
||||
end
|
||||
|
||||
if opt.include? '{extracted_base}'
|
||||
raise "*** {extracted_base} is missing" unless extracted_file
|
||||
opt.gsub! "{extracted_base}", "#{extracted_file}"
|
||||
end
|
||||
|
||||
if opt.include? '{prepared_base}'
|
||||
raise "*** {prepared_base} is missing" unless prepared_file
|
||||
opt.gsub! "{prepared_base}", "#{prepared_file}"
|
||||
end
|
||||
if opt.include? '{profile}'
|
||||
opt.gsub! "{profile}", "#{PROFILES_PATH}/#{@profile}.lua"
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user