[osrm] 04/12: Imported Upstream version 4.8.1

Sebastiaan Couwenberg sebastic at moszumanska.debian.org
Mon Oct 19 20:50:22 UTC 2015


This is an automated email from the git hooks/post-receive script.

sebastic pushed a commit to branch master
in repository osrm.

commit 628c9f7d4a9b2a00d6bdc04039948b4f94377d19
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date:   Mon Oct 19 21:39:55 2015 +0200

    Imported Upstream version 4.8.1
---
 descriptors/json_descriptor.hpp      |  2 +-
 features/step_definitions/routing.rb |  4 ++++
 features/testbot/via.feature         | 25 +++++++++++++++++++++++++
 scripts/bisect_cucumber.sh           | 27 +++++++++++++++++++++++++++
 4 files changed, 57 insertions(+), 1 deletion(-)

diff --git a/descriptors/json_descriptor.hpp b/descriptors/json_descriptor.hpp
index 4904e85..eb5edbf 100644
--- a/descriptors/json_descriptor.hpp
+++ b/descriptors/json_descriptor.hpp
@@ -214,7 +214,7 @@ template <class DataFacadeT> class JSONDescriptor final : public BaseDescriptor<
             osrm::json::Array json_current_alt_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_result.values["alternative_instructions"] = json_alt_instructions;
             }
diff --git a/features/step_definitions/routing.rb b/features/step_definitions/routing.rb
index 6a73d86..21fcf48 100644
--- a/features/step_definitions/routing.rb
+++ b/features/step_definitions/routing.rb
@@ -82,6 +82,10 @@ When /^I route I should get$/ do |table|
         end
         if table.headers.include? 'route'
           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 row['distance']!=''
               raise "*** Distance must be specied in meters. (ex: 250m)" unless row['distance'] =~ /\d+m/
diff --git a/features/testbot/via.feature b/features/testbot/via.feature
index a70ee9f..393e1d0 100644
--- a/features/testbot/via.feature
+++ b/features/testbot/via.feature
@@ -52,6 +52,31 @@ Feature: Via points
             | a,c,f     | ab,bcd,bcd,de,efg        |
             | 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
         Given the node map
             | x |   |   |   |   |   |
diff --git a/scripts/bisect_cucumber.sh b/scripts/bisect_cucumber.sh
new file mode 100755
index 0000000..38c2b8c
--- /dev/null
+++ b/scripts/bisect_cucumber.sh
@@ -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

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/osrm.git



More information about the Pkg-grass-devel mailing list