From cc3646ca16e54e2bf7ca191ecad1bd2d489f8d6d Mon Sep 17 00:00:00 2001 From: Emil Tin Date: Fri, 17 Oct 2014 14:48:52 +0200 Subject: [PATCH] fix tests that use {base} expansion --- features/options/extract/files.feature | 6 +++--- features/options/prepare/files.feature | 6 +++--- features/options/routed/files.feature | 6 +++--- features/support/run.rb | 17 +++++++++++++---- 4 files changed, 22 insertions(+), 13 deletions(-) diff --git a/features/options/extract/files.feature b/features/options/extract/files.feature index 3061263e9..aceab19f7 100644 --- a/features/options/extract/files.feature +++ b/features/options/extract/files.feature @@ -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 diff --git a/features/options/prepare/files.feature b/features/options/prepare/files.feature index de356a82b..6e82a6b1b 100644 --- a/features/options/prepare/files.feature +++ b/features/options/prepare/files.feature @@ -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 diff --git a/features/options/routed/files.feature b/features/options/routed/files.feature index 574c22294..15ce679eb 100644 --- a/features/options/routed/files.feature +++ b/features/options/routed/files.feature @@ -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/ diff --git a/features/support/run.rb b/features/support/run.rb index a62e45042..42dc597a1 100644 --- a/features/support/run.rb +++ b/features/support/run.rb @@ -1,12 +1,21 @@ 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