osrm-backend/test/data-tests/run-testdata-multipolygon.cmake
Patrick Niklaus 8511256779 Squashed 'third_party/libosmium/' content from commit 2282c84
git-subtree-dir: third_party/libosmium
git-subtree-split: 2282c8450bae55839372a2002db7ca754530d2fc
2016-03-01 17:56:55 +01:00

47 lines
1.4 KiB
CMake

#-----------------------------------------------------------------------------
#
# Helper script that runs the 'multipolygon' test.
#
#-----------------------------------------------------------------------------
# Remove files that might be left over from previous run
file(REMOVE multipolygon.db multipolygon-tests.json)
#-----------------------------------------------------------------------------
#
# Create multipolygons from test data.
#
#-----------------------------------------------------------------------------
execute_process(
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/testdata-multipolygon
${OSM_TESTDATA}/grid/data/all.osm
RESULT_VARIABLE _result
OUTPUT_FILE multipolygon.log
ERROR_FILE multipolygon.log
)
if(_result)
message(FATAL_ERROR "Error running testdata-multipolygon command")
endif()
#-----------------------------------------------------------------------------
#
# Compare created multipolygons with reference data.
#
#-----------------------------------------------------------------------------
execute_process(
COMMAND ${RUBY} ${OSM_TESTDATA}/bin/compare-areas.rb
${OSM_TESTDATA}/grid/data/tests.json
multipolygon-tests.json
RESULT_VARIABLE _result
)
if(_result)
message(FATAL_ERROR "Error running compare-areas command")
endif()
#-----------------------------------------------------------------------------