2014-04-21 09:24:42 -04:00
|
|
|
def run_bin bin, options
|
|
|
|
Dir.chdir TEST_FOLDER do
|
|
|
|
opt = options.dup
|
2014-10-17 08:48:52 -04:00
|
|
|
|
|
|
|
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}"
|
2014-04-21 09:24:42 -04:00
|
|
|
end
|
|
|
|
|
2014-10-17 08:48:52 -04:00
|
|
|
if opt.include? '{prepared_base}'
|
|
|
|
raise "*** {prepared_base} is missing" unless prepared_file
|
|
|
|
opt.gsub! "{prepared_base}", "#{prepared_file}"
|
|
|
|
end
|
2014-04-21 09:24:42 -04:00
|
|
|
if opt.include? '{profile}'
|
|
|
|
opt.gsub! "{profile}", "#{PROFILES_PATH}/#{@profile}.lua"
|
|
|
|
end
|
2014-04-30 04:30:51 -04:00
|
|
|
|
2014-10-09 08:30:06 -04:00
|
|
|
cmd = "#{QQ}#{BIN_PATH}/#{bin}#{EXE}#{QQ} #{opt} 2>error.log"
|
|
|
|
@stdout = `#{cmd}`
|
2014-04-21 09:24:42 -04:00
|
|
|
@stderr = File.read 'error.log'
|
|
|
|
@exit_code = $?.exitstatus
|
|
|
|
end
|
|
|
|
end
|