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
@@ -1,5 +1,5 @@
@routing @options
Feature: Command line options: version
@extract @options
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)
@@ -7,14 +7,14 @@ Feature: Command line options: version
Background:
Given the profile "testbot"
Scenario: Version, short
Scenario: osrm-extract - Version, short
When I run "osrm-routed --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: Version, long
Scenario: osrm-extract - Version, long
When I run "osrm-routed --version"
Then stderr should be empty
And stdout should contain 1 line
+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
+35
View File
@@ -0,0 +1,35 @@
@prepare @options @files
Feature: osrm-prepare 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 extracted
Scenario: osrm-prepare - Passing base file
When I run "osrm-extract {base}.osm --profile {profile}"
Then stderr should be empty
And it should exit with code 0
When I run "osrm-prepare {base}.osrm --profile {profile}"
Then stderr should be empty
And it should exit with code 0
@todo
Scenario: osrm-prepare - Order of options should not matter
When I run "osrm-prepare --profile {profile} {base}.osm"
Then stderr should be empty
And it should exit with code 0
@todo
Scenario: osrm-prepare - Missing input file
When I run "osrm-prepare 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
+51
View File
@@ -0,0 +1,51 @@
@prepare @options @help
Feature: osrm-prepare command line options: help
Background:
Given the profile "testbot"
@todo
Scenario: osrm-prepare - Help should be shown when no options are passed
When I run "osrm-prepare"
Then stderr should be empty
And stdout should contain "osrm-prepare <input.osrm> [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 "--restrictions"
And stdout should contain "--profile"
And stdout should contain "--threads"
And stdout should contain 15 lines
And it should exit with code 0
Scenario: osrm-prepare - Help, short
When I run "osrm-prepare -h"
Then stderr should be empty
And stdout should contain "osrm-prepare <input.osrm> [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 "--restrictions"
And stdout should contain "--profile"
And stdout should contain "--threads"
And stdout should contain 15 lines
And it should exit with code 0
Scenario: osrm-prepare - Help, long
When I run "osrm-prepare --help"
Then stderr should be empty
And stdout should contain "osrm-prepare <input.osrm> [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 "--restrictions"
And stdout should contain "--profile"
And stdout should contain "--threads"
And stdout should contain 15 lines
And it should exit with code 0
+13
View File
@@ -0,0 +1,13 @@
@prepare @options @invalid
Feature: osrm-prepare command line options: invalid options
Background:
Given the profile "testbot"
@todo
Scenario: osrm-prepare - Non-existing option
When I run "osrm-prepare --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 @@
@prepare @options @version
Feature: osrm-prepare 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-prepare - Version, short
When I run "osrm-prepare --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-prepare - Version, long
When I run "osrm-prepare --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
@@ -1,5 +1,5 @@
@routing @options @files
Feature: Command line options: files
@routed @options @files
Feature: osrm-routed command line options: files
# Normally when launching osrm-routed, it will keep running as a server until it's shut down.
# For testing program options, the --trial option is used, which causes osrm-routed to quit
# immediately after initialization. This makes testing easier and faster.
@@ -14,9 +14,9 @@ Feature: Command line options: files
And the ways
| nodes |
| ab |
And I preprocess data
And the data has been prepared
Scenario: Passing base file
Scenario: osrm-routed - Passing base file
When I run "osrm-routed {base}.osrm --trial"
Then stdout should contain /^\[info\] starting up engines/
And stdout should contain /\d{1,2}\.\d{1,2}\.\d{1,2}/
@@ -24,4 +24,4 @@ Feature: Command line options: files
And stdout should contain /^\[info\] loaded plugin: viaroute/
And stdout should contain /^\[info\] trial run/
And stdout should contain /^\[info\] shutdown completed/
And it should exit with code 0
And it should exit with code 0
@@ -1,10 +1,10 @@
@routing @options
Feature: Command line options: help
@routed @options @help
Feature: osrm-routed command line options: help
Background:
Given the profile "testbot"
Scenario: Help should be shown when no options are passed
Scenario: osrm-routed - Help should be shown when no options are passed
When I run "osrm-routed"
Then stderr should be empty
And stdout should contain "osrm-routed <base.osrm> [<options>]:"
@@ -25,9 +25,10 @@ Feature: Command line options: help
And stdout should contain "--port"
And stdout should contain "--threads"
And stdout should contain "--sharedmemory"
And stdout should contain 21 lines
And it should exit with code 0
Scenario: Help, short
Scenario: osrm-routed - Help, short
When I run "osrm-routed -h"
Then stderr should be empty
And stdout should contain "osrm-routed <base.osrm> [<options>]:"
@@ -48,9 +49,10 @@ Feature: Command line options: help
And stdout should contain "--port"
And stdout should contain "--threads"
And stdout should contain "--sharedmemory"
And stdout should contain 21 lines
And it should exit with code 0
Scenario: Help, long
Scenario: osrm-routed - Help, long
When I run "osrm-routed --help"
Then stderr should be empty
And stdout should contain "osrm-routed <base.osrm> [<options>]:"
@@ -71,4 +73,5 @@ Feature: Command line options: help
And stdout should contain "--port"
And stdout should contain "--threads"
And stdout should contain "--sharedmemory"
And stdout should contain 21 lines
And it should exit with code 0
@@ -1,17 +1,17 @@
@routing @options
Feature: Command line options: invalid options
@routed @options @invalid
Feature: osrm-routed command line options: invalid options
Background:
Given the profile "testbot"
Scenario: Non-existing option
Scenario: osrm-routed - Non-existing option
When I run "osrm-routed --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
Scenario: Missing file
Scenario: osrm-routed - Missing file
When I run "osrm-routed over-the-rainbow.osrm"
Then stdout should contain "over-the-rainbow.osrm"
And stderr should contain "exception"
+22
View File
@@ -0,0 +1,22 @@
@routed @options @version
Feature: osrm-routed 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-routed - Version, short
When I run "osrm-routed --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-routed - Version, long
When I run "osrm-routed --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