diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2014-03-18 16:21:46 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2014-03-18 16:21:46 (GMT) |
commit | 03d10edd23ce76e9389b54be138ef1bbb8791cef (patch) | |
tree | 97c8e0737bcb88af41df69fd7db4a23e103c6455 /tools | |
parent | 73a72c59b8cd243de54993f1fb0991afede4ba4d (diff) | |
download | hdf5-03d10edd23ce76e9389b54be138ef1bbb8791cef.zip hdf5-03d10edd23ce76e9389b54be138ef1bbb8791cef.tar.gz hdf5-03d10edd23ce76e9389b54be138ef1bbb8791cef.tar.bz2 |
[svn-r24824] HDFFV-8700 -
KitWare recommendations: Change CMake commands to lower case.
Bump up CMake minimum versions.
Split test file into separate file for h5repack test.
Tested: local linux
Diffstat (limited to 'tools')
-rw-r--r-- | tools/CMakeLists.txt | 20 | ||||
-rw-r--r-- | tools/h5copy/CMakeTests.cmake | 2 | ||||
-rw-r--r-- | tools/h5diff/CMakeTests.cmake | 2 | ||||
-rw-r--r-- | tools/h5dump/CMakeTests.cmake | 10 | ||||
-rw-r--r-- | tools/h5import/CMakeTests.cmake | 2 | ||||
-rw-r--r-- | tools/h5jam/CMakeTests.cmake | 8 | ||||
-rw-r--r-- | tools/h5ls/CMakeTests.cmake | 2 | ||||
-rw-r--r-- | tools/h5repack/CMakeLists.txt | 6 | ||||
-rw-r--r-- | tools/h5repack/dynlib_rpk.c | 97 | ||||
-rw-r--r-- | tools/misc/CMakeTests.cmake | 2 |
10 files changed, 124 insertions, 27 deletions
diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index a9a7232..27820ae 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -15,32 +15,32 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SOURCE_DIR}/lib) # If testing was NOT enabled, then we need to build the tools library # -------------------------------------------------------------------- if (NOT BUILD_TESTING) - ADD_SUBDIRECTORY (${HDF5_TOOLS_SOURCE_DIR}/lib) + add_subdirectory (${HDF5_TOOLS_SOURCE_DIR}/lib) endif (NOT BUILD_TESTING) #-- Add the h5diff and test executables -ADD_SUBDIRECTORY (${HDF5_TOOLS_SOURCE_DIR}/h5diff) +add_subdirectory (${HDF5_TOOLS_SOURCE_DIR}/h5diff) #-- Add the h5ls executable -ADD_SUBDIRECTORY (${HDF5_TOOLS_SOURCE_DIR}/h5ls) +add_subdirectory (${HDF5_TOOLS_SOURCE_DIR}/h5ls) #-- Misc Executables -ADD_SUBDIRECTORY (${HDF5_TOOLS_SOURCE_DIR}/misc) +add_subdirectory (${HDF5_TOOLS_SOURCE_DIR}/misc) #-- Add the h5import and test executables -ADD_SUBDIRECTORY (${HDF5_TOOLS_SOURCE_DIR}/h5import) +add_subdirectory (${HDF5_TOOLS_SOURCE_DIR}/h5import) #-- h5Repack executables -ADD_SUBDIRECTORY (${HDF5_TOOLS_SOURCE_DIR}/h5repack) +add_subdirectory (${HDF5_TOOLS_SOURCE_DIR}/h5repack) #-- Add the h5dump and test executables -ADD_SUBDIRECTORY (${HDF5_TOOLS_SOURCE_DIR}/h5jam) +add_subdirectory (${HDF5_TOOLS_SOURCE_DIR}/h5jam) #-- Add the h5copy and test executables -ADD_SUBDIRECTORY (${HDF5_TOOLS_SOURCE_DIR}/h5copy) +add_subdirectory (${HDF5_TOOLS_SOURCE_DIR}/h5copy) #-- Add the h5stat and test executables -ADD_SUBDIRECTORY (${HDF5_TOOLS_SOURCE_DIR}/h5stat) +add_subdirectory (${HDF5_TOOLS_SOURCE_DIR}/h5stat) #-- Add the h5dump and test executables -ADD_SUBDIRECTORY (${HDF5_TOOLS_SOURCE_DIR}/h5dump) +add_subdirectory (${HDF5_TOOLS_SOURCE_DIR}/h5dump) diff --git a/tools/h5copy/CMakeTests.cmake b/tools/h5copy/CMakeTests.cmake index 34976fe..77399a8 100644 --- a/tools/h5copy/CMakeTests.cmake +++ b/tools/h5copy/CMakeTests.cmake @@ -19,7 +19,7 @@ ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copy_misc1.out ) - FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") foreach (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) GET_FILENAME_COMPONENT(fname "${listfiles}" NAME) diff --git a/tools/h5diff/CMakeTests.cmake b/tools/h5diff/CMakeTests.cmake index 8bae2ca..19a5fe4 100644 --- a/tools/h5diff/CMakeTests.cmake +++ b/tools/h5diff/CMakeTests.cmake @@ -234,7 +234,7 @@ ) # Make testfiles dir under build dir - FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") # # copy test files from source to build dir diff --git a/tools/h5dump/CMakeTests.cmake b/tools/h5dump/CMakeTests.cmake index 433faa3..bb2a37e 100644 --- a/tools/h5dump/CMakeTests.cmake +++ b/tools/h5dump/CMakeTests.cmake @@ -307,7 +307,7 @@ ) # make test dir - FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") # # copy test files from source dir to test dir @@ -326,8 +326,8 @@ foreach (tst_exp_file ${HDF5_REFERENCE_EXP_FILES}) if (WIN32 AND NOT CYGWIN) - FILE (READ ${HDF5_TOOLS_SRC_DIR}/testfiles/${tst_exp_file} TEST_STREAM) - FILE (WRITE ${PROJECT_BINARY_DIR}/testfiles/std/${tst_exp_file} "${TEST_STREAM}") + file (READ ${HDF5_TOOLS_SRC_DIR}/testfiles/${tst_exp_file} TEST_STREAM) + file (WRITE ${PROJECT_BINARY_DIR}/testfiles/std/${tst_exp_file} "${TEST_STREAM}") else (WIN32 AND NOT CYGWIN) add_custom_command ( TARGET h5dump @@ -373,8 +373,8 @@ ) if (WIN32 AND NOT CYGWIN) - FILE (READ ${HDF5_TOOLS_SRC_DIR}/testfiles/tbinregR.exp TEST_STREAM) - FILE (WRITE ${PROJECT_BINARY_DIR}/testfiles/std/tbinregR.exp "${TEST_STREAM}") + file (READ ${HDF5_TOOLS_SRC_DIR}/testfiles/tbinregR.exp TEST_STREAM) + file (WRITE ${PROJECT_BINARY_DIR}/testfiles/std/tbinregR.exp "${TEST_STREAM}") else (WIN32 AND NOT CYGWIN) add_custom_command ( TARGET h5dump diff --git a/tools/h5import/CMakeTests.cmake b/tools/h5import/CMakeTests.cmake index 2adbdde..5c5b4de 100644 --- a/tools/h5import/CMakeTests.cmake +++ b/tools/h5import/CMakeTests.cmake @@ -61,7 +61,7 @@ textpfe.h5 ) - FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") foreach (conf_file ${HDF5_REFERENCE_CONF_FILES}) set (dest "${PROJECT_BINARY_DIR}/testfiles/${conf_file}") #message (STATUS " Copying ${conf_file}") diff --git a/tools/h5jam/CMakeTests.cmake b/tools/h5jam/CMakeTests.cmake index 4b71d7f..7be6934 100644 --- a/tools/h5jam/CMakeTests.cmake +++ b/tools/h5jam/CMakeTests.cmake @@ -20,7 +20,7 @@ twithub513.h5 ) - FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") foreach (h5_file ${HDF5_REFERENCE_TEST_FILES}) set (dest "${PROJECT_BINARY_DIR}/testfiles/${h5_file}") #message (STATUS " Copying ${h5_file}") @@ -255,7 +255,7 @@ set_tests_properties (H5JAM-${testname}-UNJAM-CHECK_NOUB PROPERTIES DEPENDS H5JAM-${testname}-UNJAM) endif (NOT "${compare_test}" STREQUAL "") - CHECKFILE (${testname} "H5JAM-${testname}-UNJAM-CHECK_NOUB" ${chkfile} ${outfile}) + CHECKfile (${testname} "H5JAM-${testname}-UNJAM-CHECK_NOUB" ${chkfile} ${outfile}) endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO(UNJAMTEST testname infile ufile outfile) @@ -298,7 +298,7 @@ -P "${HDF5_RESOURCES_DIR}/userblockTest.cmake" ) set_tests_properties (H5JAM-${testname}-CHECK_UB_1 PROPERTIES DEPENDS H5JAM-${testname}-CHECK_UB_1-clear-objects) - CHECKFILE (${testname} "H5JAM-${testname}-CHECK_UB_1" ${chkfile} ${outfile}) + CHECKfile (${testname} "H5JAM-${testname}-CHECK_UB_1" ${chkfile} ${outfile}) endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (JAMTEST testname jamfile infile outfile) @@ -353,7 +353,7 @@ -P "${HDF5_RESOURCES_DIR}/userblockTest.cmake" ) set_tests_properties (H5JAM-${testname}_NONE-CHECK_UB_1 PROPERTIES DEPENDS H5JAM-${testname}_NONE-CHECK_UB_1-clear-objects) - CHECKFILE (${testname} "H5JAM-${testname}_NONE-CHECK_UB_1" ${infile} ${chkfile}) + CHECKfile (${testname} "H5JAM-${testname}_NONE-CHECK_UB_1" ${infile} ${chkfile}) endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (JAMTEST_NONE testname jamfile infile setfile chkfile) diff --git a/tools/h5ls/CMakeTests.cmake b/tools/h5ls/CMakeTests.cmake index eb68d79..b739130 100644 --- a/tools/h5ls/CMakeTests.cmake +++ b/tools/h5ls/CMakeTests.cmake @@ -92,7 +92,7 @@ ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes2be.ls ) - FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") # copy the list of test files foreach (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) diff --git a/tools/h5repack/CMakeLists.txt b/tools/h5repack/CMakeLists.txt index 4625607..4d26c0c 100644 --- a/tools/h5repack/CMakeLists.txt +++ b/tools/h5repack/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_TOOLS_H5REPACK) #----------------------------------------------------------------------------- @@ -54,7 +54,7 @@ if (BUILD_TESTING) add_definitions (${HDF5_EXTRA_C_FLAGS}) INCLUDE_DIRECTORIES (${HDF5_SRC_DIR}) - add_library (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${LIB_TYPE} ${HDF5_TEST_SRC_DIR}/dynlib1.c) + add_library (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${LIB_TYPE} dynlib_rpk.c) TARGET_C_PROPERTIES (${HDF5_TOOL_PLUGIN_LIB_TARGET} " " " ") target_link_libraries (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) H5_SET_LIB_OPTIONS ( @@ -65,7 +65,7 @@ if (BUILD_TESTING) ) # make plugins dir - FILE (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/plugins") + file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/plugins") #----------------------------------------------------------------------------- # Copy plugin library to a plugins folder #----------------------------------------------------------------------------- diff --git a/tools/h5repack/dynlib_rpk.c b/tools/h5repack/dynlib_rpk.c new file mode 100644 index 0000000..1ccc33a --- /dev/null +++ b/tools/h5repack/dynlib_rpk.c @@ -0,0 +1,97 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic document set and is * + * linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have access * + * to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/* + * Programmer: Raymond Lu + * 13 February 2013 + * + * Purpose: Tests the plugin module (H5PL) + */ + +#include <stdlib.h> +#include <stdio.h> +#include "H5PLextern.h" + +#define H5Z_FILTER_DYNLIB1 257 + +static size_t H5Z_filter_dynlib1(unsigned int flags, size_t cd_nelmts, + const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf); + +/* This message derives from H5Z */ +const H5Z_class2_t H5Z_DYNLIB1[1] = {{ + H5Z_CLASS_T_VERS, /* H5Z_class_t version */ + H5Z_FILTER_DYNLIB1, /* Filter id number */ + 1, 1, /* Encoding and decoding enabled */ + "dynlib1", /* Filter name for debugging */ + NULL, /* The "can apply" callback */ + NULL, /* The "set local" callback */ + (H5Z_func_t)H5Z_filter_dynlib1, /* The actual filter function */ +}}; + +H5PL_type_t H5PLget_plugin_type(void) {return H5PL_TYPE_FILTER;} +const void *H5PLget_plugin_info(void) {return H5Z_DYNLIB1;} + +/*------------------------------------------------------------------------- + * Function: H5Z_filter_dynlib1 + * + * Purpose: A dynlib1 filter method that adds on and subtract from + * the original value with another value. It will be built + * as a shared library. plugin.c test will load and use + * this filter library. + * + * Return: Success: Data chunk size + * + * Failure: 0 + * + * Programmer: Raymond Lu + * 29 March 2013 + * + *------------------------------------------------------------------------- + */ +static size_t +H5Z_filter_dynlib1(unsigned int flags, size_t cd_nelmts, + const unsigned int *cd_values, size_t nbytes, + size_t *buf_size, void **buf) +{ + int *int_ptr = (int *)*buf; /* Pointer to the data values */ + size_t buf_left = *buf_size; /* Amount of data buffer left to process */ + int add_on = 0; + + /* Check for the correct number of parameters */ + if(cd_nelmts == 0) + return(0); + + /* Check that permanent parameters are set correctly */ + if(cd_values[0] > 9) + return(0); + + add_on = (int)cd_values[0]; + + if(flags & H5Z_FLAG_REVERSE) { /*read*/ + /* Substract the "add on" value to all the data values */ + while(buf_left > 0) { + *int_ptr++ -= add_on; + buf_left -= sizeof(int); + } /* end while */ + } /* end if */ + else { /*write*/ + /* Add the "add on" value to all the data values */ + while(buf_left > 0) { + *int_ptr++ += add_on; + buf_left -= sizeof(int); + } /* end while */ + } /* end else */ + + return nbytes; +} /* end H5Z_filter_dynlib1() */ + diff --git a/tools/misc/CMakeTests.cmake b/tools/misc/CMakeTests.cmake index a935c2b..468ff3a 100644 --- a/tools/misc/CMakeTests.cmake +++ b/tools/misc/CMakeTests.cmake @@ -58,7 +58,7 @@ ) # make test dir - FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") foreach (h5_mkgrp_file ${HDF5_MKGRP_TEST_FILES}) set (dest "${PROJECT_BINARY_DIR}/testfiles/${h5_mkgrp_file}") |