netcdf-c/nc_test/CMakeLists.txt

108 lines
3.0 KiB
CMake
Raw Normal View History

Primary change: add dap4 support Specific changes: 1. Add dap4 code: libdap4 and dap4_test. Note that until the d4ts server problem is solved, dap4 is turned off. 2. Modify various files to support dap4 flags: configure.ac, Makefile.am, CMakeLists.txt, etc. 3. Add nc_test/test_common.sh. This centralizes the handling of the locations of various things in the build tree: e.g. where is ncgen.exe located. See nc_test/test_common.sh for details. 4. Modify .sh files to use test_common.sh 5. Obsolete separate oc2 by moving it to be part of netcdf-c. This means replacing code with netcdf-c equivalents. 5. Add --with-testserver to configure.ac to allow override of the servers to be used for --enable-dap-remote-tests. 6. There were multiple versions of nctypealignment code. Try to centralize in libdispatch/doffset.c and include/ncoffsets.h 7. Add a unit test for the ncuri code because of its complexity. 8. Move the findserver code out of libdispatch and into a separate, self contained program in ncdap_test and dap4_test. 9. Move the dispatch header files (nc{3,4}dispatch.h) to .../include because they are now shared by modules. 10. Revamp the handling of TOPSRCDIR and TOPBUILDDIR for shell scripts. 11. Make use of MREMAP if available 12. Misc. minor changes e.g. - #include <config.h> -> #include "config.h" - Add some no-install headers to /include - extern -> EXTERNL and vice versa as needed - misc header cleanup - clean up checking for misc. unix vs microsoft functions 13. Change copyright decls in some files to point to LICENSE file. 14. Add notes to RELEASENOTES.md
2017-03-09 08:01:10 +08:00
message(STATUS "CMAKE_SOURCE_DIR=${CMAKE_SOURCE_DIR}")
message(STATUS "CMAKE_BINARY_DIR=${CMAKE_BINARY_DIR}")
message(STATUS "CMAKE_CURRENT_SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}")
message(STATUS "CMAKE_CURRENT_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR}")
add_definitions(-D"TOPSRCDIR=${CMAKE_SOURCE_DIR}")
add_definitions(-D"TOPBINDIR=${CMAKE_BINARY_DIR}")
INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}/include)
SET (nc_test_m4_SOURCES test_get test_put test_read test_write)
FOREACH (F ${nc_test_m4_SOURCES})
GEN_m4(${F})
ENDFOREACH()
2014-08-23 23:34:16 +08:00
SET (nc_test_SRC
nc_test.c
error.c
test_get.c
test_put.c
test_read.c
test_write.c
2014-08-23 23:34:16 +08:00
util.c
)
2015-12-23 03:02:18 +08:00
ADD_EXECUTABLE(nc_test ${nc_test_SRC})
2014-08-23 23:34:16 +08:00
TARGET_LINK_LIBRARIES(nc_test
netcdf
${HAVE_LIBM}
)
# Some extra stand-alone tests
SET(TESTS t_nc tst_small tst_misc tst_norm tst_names tst_nofill tst_nofill2 tst_nofill3 tst_meta tst_inq_type tst_global_fillval)
2012-09-15 05:35:25 +08:00
IF(NOT HAVE_BASH)
SET(TESTS ${TESTS} tst_atts3)
2012-09-15 05:35:25 +08:00
ENDIF()
IF(USE_NETCDF4)
SET(TESTS ${TESTS} tst_atts)
SET(TESTS ${TESTS} tst_put_vars)
SET(TESTS ${TESTS} tst_elatefill)
ENDIF()
IF(USE_PNETCDF)
build_bin_test_no_prefix(tst_pnetcdf)
build_bin_test_no_prefix(tst_parallel2)
build_bin_test_no_prefix(tst_addvar)
add_sh_test(nc_test run_pnetcdf_test)
add_bin_test(nc_test tst_formatx_pnetcdf)
ENDIF()
IF(LARGE_FILE_TESTS)
SET(TESTS ${TESTS} quick_large_files tst_big_var6 tst_big_var2 tst_big_rvar tst_big_var tst_large tst_large_cdf5)
IF(NOT MSVC)
SET(TESTS ${TESTS} large_files)
ENDIF()
ENDIF()
IF(BUILD_DISKLESS)
2017-05-03 23:58:49 +08:00
SET(TESTFILES ${TESTFILES} tst_diskless tst_diskless3 tst_diskless4 tst_diskless5)
IF(USE_NETCDF4)
2013-02-15 04:24:02 +08:00
SET(TESTFILES ${TESTFILES} tst_diskless2)
ENDIF()
ENDIF()
2013-02-15 04:24:02 +08:00
# Build executables required for the shell scripts.
FOREACH(BINFILE ${TESTFILES})
build_bin_test(${BINFILE})
2013-02-15 04:24:02 +08:00
ENDFOREACH()
2013-02-15 04:24:02 +08:00
# Process single-file test files.
FOREACH(CTEST ${TESTS})
add_bin_test(nc_test ${CTEST})
ENDFOREACH()
ADD_TEST(nc_test ${EXECUTABLE_OUTPUT_PATH}/nc_test)
IF(BUILD_UTILITIES)
IF(BUILD_DISKLESS)
add_sh_test(nc_test run_diskless)
IF(BUILD_MMAP)
add_sh_test(nc_test run_mmap)
ENDIF(BUILD_MMAP)
IF(LARGE_FILE_TESTS)
add_sh_test(nc_test run_diskless2)
ENDIF(LARGE_FILE_TESTS)
2017-05-03 23:58:49 +08:00
add_sh_test(nc_test run_diskless5)
ENDIF(BUILD_DISKLESS)
ENDIF(BUILD_UTILITIES)
2013-02-15 04:24:02 +08:00
# Copy some test files from current source dir to out-of-tree build dir.
FILE(GLOB COPY_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.nc ${CMAKE_CURRENT_SOURCE_DIR}/*.sh)
FILE(COPY ${COPY_FILES} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/)
IF(MSVC)
FILE(COPY ${COPY_FILES} DESTINATION ${RUNTIME_OUTPUT_DIRECTORY}/)
ENDIF()
## Specify files to be distributed by 'make dist'
FILE(GLOB CUR_EXTRA_DIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.c ${CMAKE_CURRENT_SOURCE_DIR}/*.h ${CMAKE_CURRENT_SOURCE_DIR}/*.sh)
SET(CUR_EXTRA_DIST ${CUR_EXTRA_DIST} CMakeLists.txt Makefile.am)
2017-05-03 23:58:49 +08:00
SET(CUR_EXTRA_DIST ${CUR_EXTRA_DIST} test_get.m4 test_put.m4 test_read.m4 test_write.m4 ref_tst_diskless2.cdl tst_diskless5.cdl)
ADD_EXTRA_DIST("${CUR_EXTRA_DIST}")