Merge branch 'develop'

This commit is contained in:
Patrick Niklaus 2015-09-20 13:30:19 +02:00
commit 8f6fc0146b
4 changed files with 57 additions and 1 deletions

View File

@ -214,7 +214,7 @@ template <class DataFacadeT> class JSONDescriptor final : public BaseDescriptor<
osrm::json::Array json_current_alt_instructions; osrm::json::Array json_current_alt_instructions;
if (config.instructions) if (config.instructions)
{ {
json_alt_instructions = BuildTextualDescription(alternate_description_factory, alternative_path_segments); json_current_alt_instructions = BuildTextualDescription(alternate_description_factory, alternative_path_segments);
json_alt_instructions.values.push_back(json_current_alt_instructions); json_alt_instructions.values.push_back(json_current_alt_instructions);
json_result.values["alternative_instructions"] = json_alt_instructions; json_result.values["alternative_instructions"] = json_alt_instructions;
} }

View File

@ -82,6 +82,10 @@ When /^I route I should get$/ do |table|
end end
if table.headers.include? 'route' if table.headers.include? 'route'
got['route'] = (instructions || '').strip got['route'] = (instructions || '').strip
if table.headers.include?('alternative')
raise "*** No alternative found ***" unless json['found_alternative']
got['alternative'] = way_list json['alternative_instructions'].first
end
if table.headers.include?('distance') if table.headers.include?('distance')
if row['distance']!='' if row['distance']!=''
raise "*** Distance must be specied in meters. (ex: 250m)" unless row['distance'] =~ /\d+m/ raise "*** Distance must be specied in meters. (ex: 250m)" unless row['distance'] =~ /\d+m/

View File

@ -52,6 +52,31 @@ Feature: Via points
| a,c,f | ab,bcd,bcd,de,efg | | a,c,f | ab,bcd,bcd,de,efg |
| a,c,f,h | ab,bcd,bcd,de,efg,efg,gh | | a,c,f,h | ab,bcd,bcd,de,efg,efg,gh |
Scenario: Alternative via points
Given the node map
| | b | c | d | | |
| a | | | | | z |
| | g | h | i | j | |
And the ways
| nodes |
| ab |
| bc |
| cd |
| dz |
| ag |
| gh |
| hi |
| ij |
| jz |
And the query options
| alt | true |
When I route I should get
| waypoints | route | alternative |
| a,z | ab,bc,cd,dz | ag,gh,hi,ij,jz |
Scenario: Duplicate via point Scenario: Duplicate via point
Given the node map Given the node map
| x | | | | | | | x | | | | | |

27
scripts/bisect_cucumber.sh Executable file
View File

@ -0,0 +1,27 @@
#!/usr/bin/env bash
# Automates bisecting cucumber tests in a portable way; usage:
#
# git bisect start GOODGITSHA BADGITSHA
# git bisect run /path/to/bisect_cucumber.sh
#
# XXX: store this file outside source control first, e.g. by copying it over
# to /tmp, otherwise jumping through commits will change this script, too.
# e: exit on first error, x: print commands
set -ex
BUILD_DIR=build
cmake -E remove_directory $BUILD_DIR
cmake -E make_directory $BUILD_DIR
cmake -E chdir $BUILD_DIR cmake .. -DCMAKE_BUILD_TYPE=Release
cmake -E chdir $BUILD_DIR cmake --build .
cucumber -p verify
# notes on the return codes git bisect understands:
# - exit code 0 means okay
# - exit code 125 means skip this commit and try a commit nearby
# - every other exit code means bad