diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2021-05-01 14:29:29 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-05-01 14:29:29 +0200 |
| commit | 371bc3c5e7472d4f2fdffad0b39e7c9d27abf234 (patch) | |
| tree | 8eddb995227e61ddef54fc8f4dbad68bc15f1e35 | |
| parent | 9182c15a212f2aae2583be6d3bcbeec1ac387359 (diff) | |
| parent | 2b2e307af8fbafb463ea4b12d8f0b225283e8b33 (diff) | |
| download | PROJ-371bc3c5e7472d4f2fdffad0b39e7c9d27abf234.tar.gz PROJ-371bc3c5e7472d4f2fdffad0b39e7c9d27abf234.zip | |
Merge pull request #2702 from rouault/run_nkg_gie
CMake build: run nkg.gie tests (dependent on CURL_ENABLED and RUN_NETWORK_DEPENDENT_TESTS settings)
| -rw-r--r-- | cmake/ProjTest.cmake | 21 | ||||
| -rw-r--r-- | test/CMakeLists.txt | 6 | ||||
| -rw-r--r-- | test/gie/Makefile.am | 3 |
3 files changed, 29 insertions, 1 deletions
diff --git a/cmake/ProjTest.cmake b/cmake/ProjTest.cmake index ac6116f2..542c7440 100644 --- a/cmake/ProjTest.cmake +++ b/cmake/ProjTest.cmake @@ -36,3 +36,24 @@ function(proj_add_gie_test TESTNAME TESTCASE) proj_test_set_properties(${TESTNAME}) endfunction() + +# Create user writable directory for tests +add_custom_target(create_tmp_user_writable_dir ALL + COMMAND ${CMAKE_COMMAND} -E make_directory {PROJ_BINARY_DIR}/tmp_user_writable_dir) + +function(proj_add_gie_network_dependent_test TESTNAME TESTCASE) + + set(GIE_BIN $<TARGET_FILE_NAME:gie>) + set(TESTFILE ${PROJ_SOURCE_DIR}/test/${TESTCASE}) + add_test(NAME ${TESTNAME} + WORKING_DIRECTORY ${PROJ_SOURCE_DIR}/test + COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${GIE_BIN} + ${TESTFILE} + ) + set_property(TEST ${TESTNAME} + PROPERTY ENVIRONMENT + "PROJ_USER_WRITABLE_DIRECTORY=${PROJ_BINARY_DIR}/tmp_user_writable_dir" + "PROJ_NETWORK=ON" + "PROJ_LIB=${PROJ_BINARY_DIR}/data/for_tests") + +endfunction() diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 014ce010..f3420237 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,5 +1,7 @@ set(GIE_BIN "gie") +option(RUN_NETWORK_DEPENDENT_TESTS "Whether to run tests dependent on network availability" ON) + # Regression tests proj_add_gie_test("Builtins" "gie/builtins.gie") proj_add_gie_test("Builtins2" "gie/more_builtins.gie") @@ -19,6 +21,10 @@ proj_add_gie_test("peirce_q" "gie/peirce_q.gie") proj_add_gie_test("defmodel" "gie/defmodel.gie") proj_add_gie_test("tinshift" "gie/tinshift.gie") +if(CURL_ENABLED AND RUN_NETWORK_DEPENDENT_TESTS) +proj_add_gie_network_dependent_test("nkg" "gie/nkg.gie") +endif() + # GIGS tests. Uncommented tests are expected to fail due to issues with # various projections. Should be investigated further and fixed. proj_add_gie_test("GIGS-5101.1-jhs" "gigs/5101.1-jhs.gie") diff --git a/test/gie/Makefile.am b/test/gie/Makefile.am index 20f0ec8f..70d55744 100644 --- a/test/gie/Makefile.am +++ b/test/gie/Makefile.am @@ -17,7 +17,8 @@ EXTRA_DIST = 4D-API_cs2cs-style.gie \ guyou.gie \ peirce_q.gie \ defmodel.gie \ - tinshift.gie + tinshift.gie \ + nkg.gie PROJ_LIB ?= ../../data/for_tests |
