Skip to content

Commit

Permalink
Merges test datasets: keeps Berlin, removes Monaco
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-j-h committed Mar 15, 2017
1 parent f4fdcca commit 720f8f3
Show file tree
Hide file tree
Showing 24 changed files with 146 additions and 346 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Thumbs.db
#######################
/build/
/example/build/
/test/data/monaco*
/test/data/berlin*
/test/bindings/node/data/berlin*
/cmake/postinst

Expand Down Expand Up @@ -87,7 +87,7 @@ stxxl.errlog
/test/cache
/test/speeds.csv
/test/penalties.csv
/test/data/monaco.*
/test/data/berlin.*
node_modules

# Deprecated config file #
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ install:
script:
- if [[ $TARGET_ARCH == armhf ]] ; then echo "Skip tests for $TARGET_ARCH" && exit 0 ; fi
- make -C test/data benchmark
- ./example/build/osrm-example test/data/monaco_CH.osrm
- ./example/build/osrm-example test/data/berlin_CH.osrm
# All tests assume to be run from the build directory
- pushd ${OSRM_BUILD_DIR}
- ./unit_tests/library-tests
Expand Down
4 changes: 2 additions & 2 deletions appveyor-build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,12 @@ unit_tests\%Configuration%\server-tests.exe
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

ECHO running library-tests.exe ...
SET test_region=monaco
SET test_region=berlin
SET test_osm=%test_region%.osm.pbf
SET test_osm_ch=%test_region%_CH.osm.pbf
SET test_osm_corech=%test_region%_CoreCH.osm.pbf
SET test_osm_mld=%test_region%_MLD.osm.pbf
IF NOT EXIST %test_osm% powershell Invoke-WebRequest https://s3.amazonaws.com/mapbox/osrm/testing/monaco.osm.pbf -OutFile %test_osm%
IF NOT EXIST %test_osm% powershell Invoke-WebRequest https://s3.amazonaws.com/mapbox/osrm/testing/berlin.osm.pbf -OutFile %test_osm%
COPY %test_osm% %test_osm_ch%
COPY %test_osm% %test_osm_corech%
COPY %test_osm% %test_osm_mld%
Expand Down
6 changes: 0 additions & 6 deletions docs/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,6 @@ You should see the compiled binaries in `build/unit_tests`, you can then run eac
./engine-tests
```

For `library-tests` you will need to provide a path to the test data:

```
./library-tests ../../test/data/monaco.osrm
```

## Cucumber

For a general introduction on cucumber in our testsuite, have a look at [the wiki](https://github.com/Project-OSRM/osrm-backend/wiki/Cucumber-Test-Suite).
Expand Down
8 changes: 4 additions & 4 deletions example/example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ int main(int argc, const char *argv[])
// The following shows how to use the Route service; configure this service
RouteParameters params;

// Route in monaco
params.coordinates.push_back({util::FloatLongitude{7.419758}, util::FloatLatitude{43.731142}});
params.coordinates.push_back({util::FloatLongitude{7.419505}, util::FloatLatitude{43.736825}});
// Route in Berlin: Alexanderplatz to Hackescher Markt
params.coordinates.push_back({util::FloatLongitude{13.414307}, util::FloatLatitude{52.521835}});
params.coordinates.push_back({util::FloatLongitude{13.402290}, util::FloatLatitude{52.523728}});

// Response is in JSON format
json::Object result;
Expand All @@ -59,7 +59,7 @@ int main(int argc, const char *argv[])
const auto duration = route.values["duration"].get<json::Number>().value;

// Warn users if extract does not contain the default Berlin coordinates from above
if (distance == 0 or duration == 0)
if (distance == 0 || duration == 0)
{
std::cout << "Note: distance or duration is zero. ";
std::cout << "You are probably doing a query outside of the OSM extract.\n\n";
Expand Down
4 changes: 2 additions & 2 deletions example/example.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ var OSRM = require('..');
var path = require('path');

var app = express();
var osrm = new OSRM(path.join(__dirname,"../test/data/monaco.osrm"));
var osrm = new OSRM(path.join(__dirname,"../test/data/berlin_CH.osrm"));

// Accepts a query like:
// http://localhost:8888?start=13.438640,52.519930&end=13.415852,52.513191
// http://localhost:8888?start=13.414307,52.521835&end=13.402290,52.523728
app.get('/', function(req, res) {
if (!req.query.start || !req.query.end) {
return res.json({"error":"invalid start and end query"});
Expand Down
4 changes: 2 additions & 2 deletions scripts/poly2req.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ else if (process.argv.length > 2 && process.argv[2] == "dc")
}
else if (process.argv.length > 2)
{
let monaco_poly_path = process.argv[2];
let poly_data = fs.readFileSync(monaco_poly_path, 'utf-8');
let poly_path = process.argv[2];
let poly_data = fs.readFileSync(poly_path, 'utf-8');

// lets assume there is only one ring
// cut of name and ring number and the two END statements
Expand Down
169 changes: 61 additions & 108 deletions src/benchmarks/match.cpp

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test/data/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
DATA_NAME:=monaco
DATA_NAME:=berlin
DATA_URL:=https://s3.amazonaws.com/mapbox/osrm/testing/$(DATA_NAME).osm.pbf
DATA_POLY_URL:=https://s3.amazonaws.com/mapbox/osrm/testing/$(DATA_NAME).poly
OSRM_BUILD_DIR?=../../build
Expand Down
4 changes: 2 additions & 2 deletions test/data/data.md5sum
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
2b8dd9343d5e615afc9c67bcc7028a63 monaco.osm.pbf
b0788991ab3791d53c1c20b6281f81ad monaco.poly
54707104e9f411d1a3032c00fb1276c6 berlin.osm.pbf
031d988f23fc2a30371c9ef8d2a49bae berlin.poly
32 changes: 0 additions & 32 deletions test/nodejs/data/Makefile

This file was deleted.

1 change: 0 additions & 1 deletion test/nodejs/data/data.md5sum

This file was deleted.

92 changes: 0 additions & 92 deletions test/nodejs/data/md5sum.js

This file was deleted.

4 changes: 2 additions & 2 deletions test/nodejs/osrm-data-path.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
var path = require('path');

if (process.env.OSRM_DATA_PATH !== undefined) {
exports.data_path = path.join(path.resolve(process.env.OSRM_DATA_PATH),"berlin-latest.osrm");
exports.data_path = path.join(path.resolve(process.env.OSRM_DATA_PATH), "berlin_CH.osrm");
console.log('Setting custom data path to ' + exports.data_path);
} else {
exports.data_path = path.resolve(path.join(__dirname,"data/berlin-latest.osrm"));
exports.data_path = path.resolve(path.join(__dirname, "../data/berlin_CH.osrm"));
}
16 changes: 8 additions & 8 deletions unit_tests/library/coordinates.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include <vector>

// Somewhere in 2b8dd9343d5e615afc9c67bcc7028a63 Monaco
// Somewhere in d41d8cd98f00b204e9800998ecf8427e Berlin

// Convenience aliases
using Longitude = osrm::util::FloatLongitude;
Expand All @@ -15,21 +15,21 @@ using Locations = std::vector<Location>;

inline Location get_dummy_location()
{
return {osrm::util::FloatLongitude{7.437069}, osrm::util::FloatLatitude{43.749249}};
return {osrm::util::FloatLongitude{13.388860}, osrm::util::FloatLatitude{52.517037}};
}

inline Locations get_locations_in_small_component()
{
return {{Longitude{7.438023}, Latitude{43.746465}},
{Longitude{7.439263}, Latitude{43.746543}},
{Longitude{7.438190}, Latitude{43.747560}}};
return {{Longitude{13.459765}, Latitude{52.543193}},
{Longitude{13.461455}, Latitude{52.542381}},
{Longitude{13.462940}, Latitude{52.541774}}};
}

inline Locations get_locations_in_big_component()
{
return {{Longitude{7.415800}, Latitude{43.734132}},
{Longitude{7.417710}, Latitude{43.736721}},
{Longitude{7.421315}, Latitude{43.738814}}};
return {{Longitude{13.442631}, Latitude{52.551110}},
{Longitude{13.441193}, Latitude{52.549506}},
{Longitude{13.439648}, Latitude{52.547705}}};
}

#endif
2 changes: 1 addition & 1 deletion unit_tests/library/extract.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ BOOST_AUTO_TEST_CASE(test_extract_with_invalid_config)
BOOST_AUTO_TEST_CASE(test_extract_with_valid_config)
{
osrm::ExtractorConfig config;
config.input_path = {OSRM_TEST_DATA_DIR "/monaco.osm.pbf"};
config.input_path = OSRM_TEST_DATA_DIR "/berlin.osm.pbf";
config.requested_num_threads = tbb::task_scheduler_init::default_num_threads();
BOOST_CHECK_NO_THROW(osrm::extract(config));
}
Expand Down
10 changes: 5 additions & 5 deletions unit_tests/library/limits.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ BOOST_AUTO_TEST_CASE(test_trip_limits)
using namespace osrm;

EngineConfig config;
config.storage_config = {OSRM_TEST_DATA_DIR "/monaco_CH.osrm"};
config.storage_config = {OSRM_TEST_DATA_DIR "/berlin_CH.osrm"};
config.use_shared_memory = false;
config.max_locations_trip = 2;

Expand All @@ -55,7 +55,7 @@ BOOST_AUTO_TEST_CASE(test_route_limits)
using namespace osrm;

EngineConfig config;
config.storage_config = {OSRM_TEST_DATA_DIR "/monaco_CH.osrm"};
config.storage_config = {OSRM_TEST_DATA_DIR "/berlin_CH.osrm"};
config.use_shared_memory = false;
config.max_locations_viaroute = 2;

Expand All @@ -82,7 +82,7 @@ BOOST_AUTO_TEST_CASE(test_table_limits)
using namespace osrm;

EngineConfig config;
config.storage_config = {OSRM_TEST_DATA_DIR "/monaco_CH.osrm"};
config.storage_config = {OSRM_TEST_DATA_DIR "/berlin_CH.osrm"};
config.use_shared_memory = false;
config.max_locations_distance_table = 2;

Expand All @@ -109,7 +109,7 @@ BOOST_AUTO_TEST_CASE(test_match_limits)
using namespace osrm;

EngineConfig config;
config.storage_config = {OSRM_TEST_DATA_DIR "/monaco_CH.osrm"};
config.storage_config = {OSRM_TEST_DATA_DIR "/berlin_CH.osrm"};
config.use_shared_memory = false;
config.max_locations_map_matching = 2;

Expand All @@ -136,7 +136,7 @@ BOOST_AUTO_TEST_CASE(test_nearest_limits)
using namespace osrm;

EngineConfig config;
config.storage_config = {OSRM_TEST_DATA_DIR "/monaco_CH.osrm"};
config.storage_config = {OSRM_TEST_DATA_DIR "/berlin_CH.osrm"};
config.use_shared_memory = false;
config.max_results_nearest = 2;

Expand Down
2 changes: 1 addition & 1 deletion unit_tests/library/match.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ BOOST_AUTO_TEST_CASE(test_match)
{
using namespace osrm;

auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/monaco_CH.osrm");
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/berlin_CH.osrm");

MatchParameters params;
params.coordinates.push_back(get_dummy_location());
Expand Down
8 changes: 4 additions & 4 deletions unit_tests/library/nearest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ BOOST_AUTO_TEST_SUITE(nearest)

BOOST_AUTO_TEST_CASE(test_nearest_response)
{
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/monaco_CH.osrm");
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/berlin_CH.osrm");

using namespace osrm;

Expand All @@ -43,7 +43,7 @@ BOOST_AUTO_TEST_CASE(test_nearest_response)

BOOST_AUTO_TEST_CASE(test_nearest_response_no_coordinates)
{
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/monaco_CH.osrm");
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/berlin_CH.osrm");

using namespace osrm;

Expand All @@ -59,7 +59,7 @@ BOOST_AUTO_TEST_CASE(test_nearest_response_no_coordinates)

BOOST_AUTO_TEST_CASE(test_nearest_response_multiple_coordinates)
{
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/monaco_CH.osrm");
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/berlin_CH.osrm");

using namespace osrm;

Expand All @@ -77,7 +77,7 @@ BOOST_AUTO_TEST_CASE(test_nearest_response_multiple_coordinates)

BOOST_AUTO_TEST_CASE(test_nearest_response_for_location_in_small_component)
{
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/monaco_CH.osrm");
auto osrm = getOSRM(OSRM_TEST_DATA_DIR "/berlin_CH.osrm");

using namespace osrm;

Expand Down
Loading

0 comments on commit 720f8f3

Please sign in to comment.