From cff5dd526edebd8aefa4405e7a9ddf7914fd79fc Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Sun, 5 Jan 2020 22:55:01 +0100 Subject: Make sure tests pass if extra grids are present Should fix the issue reported in https://lists.osgeo.org/pipermail/proj/2020-January/009188.html Some extra north-american grids present in data/ can affect the results of some tests, so create a data/for_tests/ subdirectory in which we copy only select grids. --- data/CMakeLists.txt | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'data/CMakeLists.txt') diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt index 8f3965f2..f0e1dab6 100644 --- a/data/CMakeLists.txt +++ b/data/CMakeLists.txt @@ -44,6 +44,7 @@ add_custom_command( OUTPUT ${PROJ_DB} COMMAND ${CMAKE_COMMAND} -E remove -f ${PROJ_DB} COMMAND ${EXE_SQLITE3} -init ${ALL_SQL_IN} ${PROJ_DB} .quit + COMMAND ${CMAKE_COMMAND} -E copy ${PROJ_DB} ${CMAKE_CURRENT_BINARY_DIR}/for_tests # note: we didn't port yet the foreign_key_check done in Makefile.am DEPENDS generate_all_sql_in ${ALL_SQL_IN} COMMENT "Generating proj.db" @@ -58,6 +59,33 @@ if(NOT "${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}") endforeach() endif() +# Copy select resource files in a for_tests subdirectory so that we are not +# influenced by the presence of other grids +# Note: this is done at configure/cmake time, not build time. +# So if you install new grids in the source data/ subdirectory, run cmake again +set(DATA_FOR_TESTS + null + GL27 + nad27 + nad83 + ntv1_can.dat + MD + ntf_r93.gsb + egm96_15.gtx + ntv2_0.gsb + conus + alaska + nzgd2kgrid0005.gsb + ITRF2000 + BETA2007.gsb) + +execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/for_tests) +foreach(FILE ${DATA_FOR_TESTS}) + if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${FILE} ${CMAKE_CURRENT_BINARY_DIR}/for_tests/${FILE} COPYONLY) + endif() +endforeach() + # #install # -- cgit v1.2.3