cuke: test options for osrm-extract and osrm-prepare

This commit is contained in:
Emil Tin
2014-04-21 15:24:42 +02:00
committed by Dennis Luxen
parent fc6607ce9e
commit a12209e61d
21 changed files with 392 additions and 83 deletions
+31
View File
@@ -0,0 +1,31 @@
@extract @options @files
Feature: osrm-extract command line options: files
# expansions:
# {base} => path to current input file
# {profile} => path to current profile script
Background:
Given the profile "testbot"
And the node map
| a | b |
And the ways
| nodes |
| ab |
And the data has been saved to disk
Scenario: osrm-extract - Passing base file
When I run "osrm-extract {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"
Then stderr should be empty
And it should exit with code 0
@todo
Scenario: osrm-extract - Missing input file
When I run "osrm-extract over-the-rainbow.osrm --profile {profile}"
And stderr should contain "over-the-rainbow.osrm"
And stderr should contain "not found"
And it should exit with code 1
+48
View File
@@ -0,0 +1,48 @@
@extract @options @help
Feature: osrm-extract command line options: help
Background:
Given the profile "testbot"
@todo
Scenario: osrm-extract - Help should be shown when no options are passed
When I run "osrm-extract"
Then stderr should be empty
And stdout should contain "osrm-extract <input.osm/.osm.bz2/.osm.pbf> [options]:"
And stdout should contain "Options:"
And stdout should contain "--version"
And stdout should contain "--help"
And stdout should contain "--config"
And stdout should contain "Configuration:"
And stdout should contain "--profile"
And stdout should contain "--threads"
And stdout should contain 12 lines
And it should exit with code 0
Scenario: osrm-extract - Help, short
When I run "osrm-extract -h"
Then stderr should be empty
And stdout should contain "osrm-extract <input.osm/.osm.bz2/.osm.pbf> [options]:"
And stdout should contain "Options:"
And stdout should contain "--version"
And stdout should contain "--help"
And stdout should contain "--config"
And stdout should contain "Configuration:"
And stdout should contain "--profile"
And stdout should contain "--threads"
And stdout should contain 12 lines
And it should exit with code 0
Scenario: osrm-extract - Help, long
When I run "osrm-extract --help"
Then stderr should be empty
And stdout should contain "osrm-extract <input.osm/.osm.bz2/.osm.pbf> [options]:"
And stdout should contain "Options:"
And stdout should contain "--version"
And stdout should contain "--help"
And stdout should contain "--config"
And stdout should contain "Configuration:"
And stdout should contain "--profile"
And stdout should contain "--threads"
And stdout should contain 12 lines
And it should exit with code 0
+13
View File
@@ -0,0 +1,13 @@
@extract @options @invalid
Feature: osrm-extract command line options: invalid options
Background:
Given the profile "testbot"
@todo
Scenario: osrm-extract - Non-existing option
When I run "osrm-extract --fly-me-to-the-moon"
Then stdout should be empty
And stderr should contain "exception"
And stderr should contain "fly-me-to-the-moon"
And it should exit with code 1
+22
View File
@@ -0,0 +1,22 @@
@extract @options @version
Feature: osrm-extract command line options: version
# the regex will match these two formats:
# v0.3.7.0 # this is the normal format when you build from a git clone
# -128-NOTFOUND # if you build from a shallow clone (used on Travis)
Background:
Given the profile "testbot"
Scenario: osrm-extract - Version, short
When I run "osrm-extract --v"
Then stderr should be empty
And stdout should contain 1 line
And stdout should contain /(v\d{1,2}\.\d{1,2}\.\d{1,2}|\w*-\d+-\w+)/
And it should exit with code 0
Scenario: osrm-extract - Version, long
When I run "osrm-extract --version"
Then stderr should be empty
And stdout should contain 1 line
And stdout should contain /(v\d{1,2}\.\d{1,2}\.\d{1,2}|\w*-\d+-\w+)/
And it should exit with code 0