Begin integrating CTest and CDash functionality.

This commit is contained in:
Ward Fisher 2012-08-06 20:53:34 +00:00
parent ac05a19ef8
commit e2293a4368
4 changed files with 71 additions and 33 deletions

View File

@ -6,6 +6,14 @@ project(NetCDF C)
SET(NetCDF_VERSION 4.2.1)
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYRIGHT")
SET(CPACK_PACKAGE_VERSION "4.3")
ENABLE_TESTING()
INCLUDE(CTest)
# CTest/CDash configuration
SET (CTEST_DROP_METHOD http CACHE STRING "")
SET (CTEST_DROP_SITE "yakov.unidata.ucar.edu/~wfisher/cdash/" CACHE STRING "")
SET (CTEST_DROP_LOCATION "/submit.php?project=WinNETCDF" CACHE STRING "")
SET (CTEST_DROP_SITE_CDASH TRUE CACHE BOOL "")
ADD_DEFINITIONS()
@ -159,8 +167,13 @@ IF(ENABLE_PNETCDF)
SET(USE_PNETCDF ON CACHE BOOL "")
ENDIF()
FIND_LIBRARY(MATH NAMES math m)
MESSAGE("Math library: ${MATH}")
MESSAGE(STATUS "Math library: ${MATH}")
IF(NOT MATH)
MESSAGE(FATAL_ERROR "Unable to find the math library.")
ENDIF()
OPTION(BUILD_CDMREMOTE "Enabled CDMRemote" OFF)
OPTION(USE_FFIO "If true, use ffio instead of posixio" OFF)
@ -276,8 +289,10 @@ configure_file("${NetCDF_SOURCE_DIR}/cmake_config.h.in"
"${NetCDF_BINARY_DIR}/config.h")
configure_file("${NetCDF_SOURCE_DIR}/cmake_nc-config.in"
"${NetCDF_BINARY_DIR}/nc-config")
EXECUTE_PROCESS(COMMAND "chmod 755 ${NetCDF_BINARY_DIR}/nc-config")
IF(APPLE)
EXECUTE_PROCESS(COMMAND "chmod 755 ${NetCDF_BINARY_DIR}/nc-config")
ENDIF()
INSTALL(PROGRAMS ${NetCDF_BINARY_DIR}/nc-config DESTINATION bin)
INCLUDE_DIRECTORIES(${NetCDF_BINARY_DIR})
## End autotools-style checs for config.h
@ -323,42 +338,31 @@ IF (BUILD_UTILITIES)
ENDIF()
ADD_SUBDIRECTORY(nctest)
ADD_SUBDIRECTORY(nc_test)
#####
# Moving on to CPack, install packages.
#####
IF(WIN32)
INCLUDE(InstallRequiredSystemLibraries)
ENDIF()
INSTALL(FILES ${NetCDF_BINARY_DIR}/config.h
DESTINATION include)
INSTALL(FILES ${NetCDF_SOURCE_DIR}/include/netcdf.h
DESTINATION include)
# Subdirectory CMakeLists.txt files should specify their own
# 'install' files.
# Including 'CPack' kicks everything off.
INCLUDE(InstallRequiredSystemLibraries)
CONFIGURE_FILE(
${CMAKE_CURRENT_SOURCE_DIR}/FixBundle.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/FixBundle.cmake
@ONLY
)
SET (CPACK_SOURCE_IGNORE_FILES "${CPACK_SOURCE_IGNORE_FILES};/${CMAKE_CURRENT_BINARY_DIR}/;~$")
# CPack inclusion must come last.
INCLUDE(CPack)
###
# Options related to the man page generation.
###
###
# The C API man page.
###
set(man_MANS netcdf.3)
set(ARGS_MANPAGE -DAPI=C)
IF (USE_NETCDF4)
SET(ARGS_MANPAGE ${ARGS_MANPAGE} -DNETCDF4=TRUE)
ENDIF(USE_NETCDF4)
IF (BUILD_DAP)
SET(ARGS_MANPAGE ${ARGS_MANPAGE} -DDAP=TRUE)
ENDIF(BUILD_DAP)
IF (BUILD_PARALLEL)
SET(ARGS_MANPAGE ${ARGS_MANPAGE} -DPARALLEL_IO=TRUE)
ENDIF(BUILD_PARALLEL)

5
CTestConfig.cmake Normal file
View File

@ -0,0 +1,5 @@
# CTest/CDash configuration
SET (CTEST_DROP_METHOD "http")
SET (CTEST_DROP_SITE "yakov.unidata.ucar.edu/")
SET (CTEST_DROP_LOCATION "~wfisher/cdash/submit.php?project=WinNETCDF")
SET (CTEST_DROP_SITE_CDASH TRUE)

25
nc_test/CMakeLists.txt Normal file
View File

@ -0,0 +1,25 @@
SET(CMAKE_INCLUDE_CURRENT_DIR ON)
INCLUDE_DIRECTORIES(".")
SET (nc_test_SRC nc_test.c error.c test_get.c test_put.c test_read.c test_write.c util.c)
ADD_EXECUTABLE(nc_test ${nc_test_SRC})
TARGET_LINK_LIBRARIES(nc_test netcdf)
# Some extra tests
SET(EXTRA_TSTS t_nc tst_small tst_misc tst_norm tst_names tst_nofill tst_nofill2 tst_nofill3 tst_atts3)
FOREACH(CTEST ${EXTRA_TSTS})
ADD_EXECUTABLE(${CTEST} ${CTEST}.c)
TARGET_LINK_LIBRARIES(${CTEST} netcdf)
ENDFOREACH()
## Tests
#ADD_TEST(run_tests.sh ${CMAKE_SOURCE_PATH}/run_tests.sh)
ADD_TEST(nc_test ${EXECUTABLE_OUTPUT_PATH}/nc_test)

View File

@ -5,11 +5,15 @@ INCLUDE_DIRECTORIES(".")
SET(nctest_SRC add.c atttests.c cdftests.c dimtests.c driver.c emalloc.c error.c misctest.c rec.c slabs.c val.c vardef.c varget.c vargetg.c varput.c varputg.c vartests.c vputget.c vputgetg.c)
ADD_EXECUTABLE(nctest ${nctest_SRC})
ADD_EXECUTABLE(tst_rename tst_rename.c)
TARGET_LINK_LIBRARIES(nctest netcdf)
TARGET_LINK_LIBRARIES(tst_rename netcdf)
INSTALL(TARGETS nctest DESTINATION bin)
INSTALL(TARGETS tst_rename DESTINATION bin)
## Tests
#ADD_TEST(run_tests.sh ${EXECUTABLE_OUTPUT_PATH}/run_tests.sh)
#ADD_TEST(run_tests.sh ${CMAKE_SOURCE_PATH}/run_tests.sh)
ADD_TEST(nctest ${EXECUTABLE_OUTPUT_PATH}/nctest)
ADD_TEST(tst_rename ${EXECUTABLE_OUTPUT_PATH}/tst_rename)