diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2016-05-04 16:14:45 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2016-05-04 16:14:45 (GMT) |
commit | 0c0d6bd4dfd9fab75e4b3f04284e395cfced69c6 (patch) | |
tree | ed4ec7b399dab982f7c5194171f255c837fda3f5 /hl | |
parent | 2d36359035b0b17a45ab2cb5721fb7623a21b564 (diff) | |
download | hdf5-0c0d6bd4dfd9fab75e4b3f04284e395cfced69c6.zip hdf5-0c0d6bd4dfd9fab75e4b3f04284e395cfced69c6.tar.gz hdf5-0c0d6bd4dfd9fab75e4b3f04284e395cfced69c6.tar.bz2 |
[svn-r29878] Add LD tests to CMake.
Add include guards and Windows guards to dectris_hl_perf.c file.
Diffstat (limited to 'hl')
-rw-r--r-- | hl/test/CMakeLists.txt | 27 | ||||
-rw-r--r-- | hl/test/CMakeTests.cmake | 24 | ||||
-rw-r--r-- | hl/test/dectris_hl_perf.c | 69 |
3 files changed, 98 insertions, 22 deletions
diff --git a/hl/test/CMakeLists.txt b/hl/test/CMakeLists.txt index bf598c4..42a175f 100644 --- a/hl/test/CMakeLists.txt +++ b/hl/test/CMakeLists.txt @@ -26,8 +26,8 @@ MACRO (HL_ADD_EXE hl_name) TARGET_C_PROPERTIES (hl_${hl_name} STATIC " " " ") target_link_libraries (hl_${hl_name} ${HDF5_HL_LIB_TARGET} - ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET} + ${HDF5_LIB_TARGET} ) set_target_properties (hl_${hl_name} PROPERTIES FOLDER test/hl) ENDMACRO (HL_ADD_EXE) @@ -38,17 +38,20 @@ MACRO (HL_ADD_SHEXE hl_name) TARGET_C_PROPERTIES (hl_${hl_name} SHARED " " " ") target_link_libraries (hl_${hl_name} ${HDF5_HL_LIBSH_TARGET} - ${HDF5_LIBSH_TARGET} ${HDF5_TEST_LIBSH_TARGET} + ${HDF5_LIBSH_TARGET} ) set_target_properties (hl_${hl_name} PROPERTIES FOLDER test/hl) ENDMACRO (HL_ADD_SHEXE) -HL_ADD_EXE (test_ds) -HL_ADD_EXE (test_dset_opt) -HL_ADD_EXE (test_image) HL_ADD_EXE (test_lite) +HL_ADD_EXE (test_image) +HL_ADD_EXE (test_file_image) HL_ADD_EXE (test_table) +HL_ADD_EXE (test_ds) +HL_ADD_EXE (test_dset_opt) +HL_ADD_EXE (test_ld) +HL_ADD_EXE (test_dset_append) # test_packet has two source files add_executable (hl_test_packet test_packet.c test_packet_vlen.c) @@ -56,8 +59,8 @@ TARGET_NAMING (hl_test_packet STATIC) TARGET_C_PROPERTIES (hl_test_packet STATIC " " " ") target_link_libraries (hl_test_packet ${HDF5_HL_LIB_TARGET} - ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET} + ${HDF5_LIB_TARGET} ) set_target_properties (hl_test_packet PROPERTIES FOLDER test/hl) @@ -71,10 +74,20 @@ if (HDF5_BUILD_GENERATORS) TARGET_C_PROPERTIES (hl_gen_test_ds STATIC " " " ") target_link_libraries (hl_gen_test_ds ${HDF5_HL_LIB_TARGET} - ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET} + ${HDF5_LIB_TARGET} ) set_target_properties (hl_gen_test_ds PROPERTIES FOLDER test/hl/gen) + + add_executable (hl_gen_test_ld gen_test_ld.c) + TARGET_NAMING (hl_gen_test_ld STATIC) + TARGET_C_PROPERTIES (hl_gen_test_ld STATIC " " " ") + target_link_libraries (hl_gen_test_ld + ${HDF5_HL_LIB_TARGET} + ${HDF5_TEST_LIB_TARGET} + ${HDF5_LIB_TARGET} + ) + set_target_properties (hl_gen_test_ld PROPERTIES FOLDER test/hl/gen) endif (HDF5_BUILD_GENERATORS) include (CMakeTests.cmake) diff --git a/hl/test/CMakeTests.cmake b/hl/test/CMakeTests.cmake index 7d632cc..95eca4b 100644 --- a/hl/test/CMakeTests.cmake +++ b/hl/test/CMakeTests.cmake @@ -11,7 +11,10 @@ MACRO (HL_ADD_TEST hl_name files) add_test (NAME HL_${hl_name} COMMAND $<TARGET_FILE:hl_${hl_name}>) if (NOT "${last_test}" STREQUAL "") - set_tests_properties (HL_${hl_name} PROPERTIES DEPENDS ${last_test}) + set_tests_properties (HL_${hl_name} PROPERTIES DEPENDS ${last_test} + ENVIRONMENT "srcdir=${HDF5_HL_TEST_BINARY_DIR}" + WORKING_DIRECTORY ${HDF5_HL_TEST_BINARY_DIR} + ) endif (NOT "${last_test}" STREQUAL "") # -------------------------------------------------------------------- @@ -34,9 +37,12 @@ ENDMACRO (HL_ADD_TEST) add_test ( NAME HL_test-clear-objects COMMAND ${CMAKE_COMMAND} - -E remove + -E remove combine_tables1.h5 combine_tables2.h5 + file_img1.h5 + file_img2.h5 + test_append.h5 test_detach.h5 test_ds1.h5 test_ds2.h5 @@ -58,6 +64,8 @@ add_test ( test_lite4.h5 test_packet_compress.h5 test_packet_table.h5 + test_packet_table_vlen.h5 + testfl_packet_table_vlen.h5 test_table.h5 ) if (NOT "${last_test}" STREQUAL "") @@ -65,9 +73,13 @@ if (NOT "${last_test}" STREQUAL "") endif (NOT "${last_test}" STREQUAL "") set (last_test "HL_test-clear-objects") -HL_add_test (test_ds "dsdata.txt;dslat.txt;dslon.txt;test_ds_be.h5;test_ds_le.h5") -HL_add_test (test_dset_opt "") -HL_add_test (test_image "image8.txt;sepia.pal;earth.pal;image24pixel.txt;image24plane.txt;usa.wri") HL_add_test (test_lite "dtype_file.txt") -HL_add_test (test_packet "") +HL_add_test (test_image "image8.txt;sepia.pal;earth.pal;image24pixel.txt;image24plane.txt;usa.wri") +HL_add_test (test_file_image "") HL_add_test (test_table "test_table_be.h5;test_table_cray.h5;test_table_le.h5") +HL_add_test (test_ds "dsdata.txt;dslat.txt;dslon.txt;test_ds_be.h5;test_ds_le.h5") +HL_add_test (test_packet "") +HL_add_test (test_dset_opt "") +HL_add_test (test_ld "test_ld.h5") +HL_add_test (test_dset_append "") + diff --git a/hl/test/dectris_hl_perf.c b/hl/test/dectris_hl_perf.c index d62926a..008bd92 100644 --- a/hl/test/dectris_hl_perf.c +++ b/hl/test/dectris_hl_perf.c @@ -19,17 +19,39 @@ */ #include "hdf5_hl.h" + +#ifdef H5_HAVE_FILTER_DEFLATE #include <zlib.h> + +#if !defined(WIN32) && !defined(__MINGW32__) + #include <math.h> -#include <stdio.h> -#include <stdlib.h> -#include <sys/time.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <fcntl.h> -#include <unistd.h> -#include <errno.h> - + +#ifdef H5_STDC_HEADERS +# include <errno.h> +# include <fcntl.h> +# include <stdio.h> +# include <stdlib.h> +#endif + +#ifdef H5_HAVE_UNISTD_H +# include <sys/types.h> +# include <unistd.h> +#endif + +#ifdef H5_HAVE_SYS_STAT_H +# include <sys/stat.h> +#endif + +#if defined(H5_TIME_WITH_SYS_TIME) +# include <sys/time.h> +# include <time.h> +#elif defined(H5_HAVE_SYS_TIME_H) +# include <sys/time.h> +#else +# include <time.h> +#endif + const char *FILENAME[] = { "dectris_perf", "unix.raw", @@ -640,3 +662,32 @@ main (void) /* h5_cleanup(FILENAME, fapl);*/ return 0; } + +#else /* WIN32 / MINGW32 */ + +int +main(void) +{ + printf("Non-POSIX platform. Exiting.\n"); + return EXIT_FAILURE; +} /* end main() */ + +#endif /* WIN32 / MINGW32 */ + +#else /* !H5_HAVE_FILTER_DEFLATE */ + +/* + * Function: main + * Purpose: Dummy main() function for if HDF5 was configured without + * zlib stuff. + * Return: EXIT_SUCCESS + */ +int +main(void) +{ + HDfprintf(stdout, "No compression IO performance because zlib was not configured\n"); + return EXIT_SUCCESS; +} + +#endif /* !H5_HAVE_FILTER_DEFLATE */ + |