diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2010-11-16 16:38:40 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2010-11-16 16:38:40 (GMT) |
commit | 186d01285a70848570482c853d00c151323981fa (patch) | |
tree | 886a29ac6fb08d737e773e80b8386b5b16c5321f | |
parent | 7fd26f00b7826d36d8ec5681a17849bb17fd2cee (diff) | |
download | hdf5-186d01285a70848570482c853d00c151323981fa.zip hdf5-186d01285a70848570482c853d00c151323981fa.tar.gz hdf5-186d01285a70848570482c853d00c151323981fa.tar.bz2 |
[svn-r19790] CMake: Correct Error tests. Add Deprecated Symbols option.
Tested: local linux
-rw-r--r-- | CMakeLists.txt | 18 | ||||
-rw-r--r-- | config/cmake/grepTest.cmake | 2 | ||||
-rw-r--r-- | config/cmake/runTest.cmake | 18 | ||||
-rw-r--r-- | test/CMakeLists.txt | 52 |
4 files changed, 67 insertions, 23 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index ee6c069..63ceb7c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -271,9 +271,9 @@ ENDIF (BUILD_SHARED_LIBS) #----------------------------------------------------------------------------- OPTION (HDF5_ENABLE_COVERAGE "Enable code coverage for Libraries and Programs" OFF) IF (HDF5_ENABLE_COVERAGE) - SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage") - SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage") - SET (LDFLAGS "${LDFLAGS} -fprofile-arcs -ftest-coverage") + SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage") + SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage") + SET (LDFLAGS "${LDFLAGS} -fprofile-arcs -ftest-coverage") ENDIF (HDF5_ENABLE_COVERAGE) #----------------------------------------------------------------------------- @@ -281,10 +281,20 @@ ENDIF (HDF5_ENABLE_COVERAGE) #----------------------------------------------------------------------------- OPTION (HDF5_ENABLE_USING_MEMCHECKER "Indicate that a memory checker is used" OFF) IF (HDF5_ENABLE_USING_MEMCHECKER) - SET (H5_USING_MEMCHECKER 1) + SET (H5_USING_MEMCHECKER 1) ENDIF (HDF5_ENABLE_USING_MEMCHECKER) #----------------------------------------------------------------------------- +# Option to use deprecated public API symbols +#----------------------------------------------------------------------------- +OPTION (HDF5_ENABLE_DEPRECATED_SYMBOLS "Enable deprecated public API symbols" ON) +IF (HDF5_ENABLE_DEPRECATED_SYMBOLS) + SET (H5_NO_DEPRECATED_SYMBOLS 0) +ELSE (HDF5_ENABLE_DEPRECATED_SYMBOLS) + SET (H5_NO_DEPRECATED_SYMBOLS 1) +ENDIF (HDF5_ENABLE_DEPRECATED_SYMBOLS) + +#----------------------------------------------------------------------------- # When building utility executables that generate other (source) files : # we make use of the following variables defined in the root CMakeLists. # Certain systems may add /Debug or /Release to output paths diff --git a/config/cmake/grepTest.cmake b/config/cmake/grepTest.cmake index cc3a9b4..9b5148c 100644 --- a/config/cmake/grepTest.cmake +++ b/config/cmake/grepTest.cmake @@ -1,4 +1,4 @@ -# runTest.cmake executes a command and captures the output in a file. File is then compared +# grepTest.cmake executes a command and captures the output in a file. File is then compared # against a reference file. Exit status of command can also be compared. # arguments checking diff --git a/config/cmake/runTest.cmake b/config/cmake/runTest.cmake index e65e877..26acc39 100644 --- a/config/cmake/runTest.cmake +++ b/config/cmake/runTest.cmake @@ -73,6 +73,18 @@ IF (TEST_MASK_MOD) FILE (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") ENDIF (TEST_MASK_MOD) +IF (TEST_MASK_ERROR) + FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) + STRING(REGEX REPLACE "thread [0-9]*:" "thread (IDs):" TEST_STREAM "${TEST_STREAM}") + STRING(REGEX REPLACE ": ([^\n]*)[.]c " ": (file name) " TEST_STREAM "${TEST_STREAM}") + STRING(REGEX REPLACE "line [0-9]*" "line (number)" TEST_STREAM "${TEST_STREAM}") + STRING(REGEX REPLACE "v[1-9]*[.][0-9]*[.]" "version (number)." TEST_STREAM "${TEST_STREAM}") + STRING(REGEX REPLACE "[1-9]*[.][0-9]*[.][0-9]*[^)]*" "version (number)" TEST_STREAM "${TEST_STREAM}") + STRING(REGEX REPLACE "H5Eget_auto[1-2]*" "H5Eget_auto(1 or 2)" TEST_STREAM "${TEST_STREAM}") + STRING(REGEX REPLACE "H5Eset_auto[1-2]*" "H5Eset_auto(1 or 2)" TEST_STREAM "${TEST_STREAM}") + FILE (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") +ENDIF (TEST_MASK_ERROR) + IF (TEST_FILTER) FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) STRING(REGEX REPLACE "${TEST_FILTER}" "" TEST_STREAM "${TEST_STREAM}") @@ -90,10 +102,12 @@ EXECUTE_PROCESS ( RESULT_VARIABLE TEST_RESULT ) +MESSAGE (STATUS "COMPARE Result: ${TEST_RESULT}") + # again, if return value is !=0 scream and shout -IF (TEST_RESULT) +IF (NOT ${TEST_RESULT} STREQUAL 0) MESSAGE (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not match ${TEST_REFERENCE}") -ENDIF (TEST_RESULT) +ENDIF (NOT ${TEST_RESULT} STREQUAL 0) # everything went fine... MESSAGE ("Passed: The output of ${TEST_PROGRAM} matches ${TEST_REFERENCE}") diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index c27f43f..5c3a9d0 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -284,8 +284,8 @@ SET (H5_TESTS earray btree2 fheap - error_test - err_compat + #error_test + #err_compat tcheck_version testmeta #links_env @@ -339,21 +339,41 @@ TARGET_LINK_LIBRARIES (ttsafe ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) ADD_TEST (NAME ttsafe COMMAND $<TARGET_FILE:ttsafe>) +#-- Adding test for err_compat +IF (HDF5_ENABLE_DEPRECATED_SYMBOLS) + ADD_EXECUTABLE (err_compat ${HDF5_TEST_SOURCE_DIR}/err_compat.c) + H5_NAMING (err_compat) + TARGET_WIN_PROPERTIES (err_compat) + TARGET_LINK_LIBRARIES (err_compat ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + + ADD_TEST (NAME err_compat COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$<TARGET_FILE:err_compat>" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_MASK_ERROR=true" + -D "TEST_OUTPUT=err_compat.txt" + -D "TEST_REFERENCE=err_compat_1" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF5_RESOURCES_DIR}/runTest.cmake" + ) +ENDIF (HDF5_ENABLE_DEPRECATED_SYMBOLS) + #-- Adding test for error_test -#ADD_EXECUTABLE (error_test ${HDF5_TEST_SOURCE_DIR}/error_test.c) -#H5_NAMING (error_test) -#TARGET_WIN_PROPERTIES (error_test) -#TARGET_LINK_LIBRARIES (error_test ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) -# -#ADD_TEST (NAME error_test COMMAND "${CMAKE_COMMAND}" -# -D "TEST_PROGRAM=$<TARGET_FILE:error_test>" -# -D "TEST_ARGS:STRING=" -# -D "TEST_EXPECT=0" -# -D "TEST_OUTPUT=error_test.txt" -# -D "TEST_REFERENCE=error_test1" -# -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -# -P "${HDF5_RESOURCES_DIR}/runTest.cmake" -#) +ADD_EXECUTABLE (error_test ${HDF5_TEST_SOURCE_DIR}/error_test.c) +H5_NAMING (error_test) +TARGET_WIN_PROPERTIES (error_test) +TARGET_LINK_LIBRARIES (error_test ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + +ADD_TEST (NAME error_test COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$<TARGET_FILE:error_test>" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_MASK_ERROR=true" + -D "TEST_OUTPUT=error_test.txt" + -D "TEST_REFERENCE=error_test_1" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF5_RESOURCES_DIR}/runTest.cmake" +) #-- Adding test for links_env ADD_EXECUTABLE (links_env ${HDF5_TEST_SOURCE_DIR}/links_env.c) |