From 47fb7c2ee6541bb006e76c34966102ebbdaec587 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Wed, 16 Jan 2019 10:36:25 -0600 Subject: Update usage for FAPLs, and reduce # of groups for smoke checks --- test/cache_image.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/test/cache_image.c b/test/cache_image.c index 10c37f0..ee49502 100644 --- a/test/cache_image.c +++ b/test/cache_image.c @@ -713,6 +713,9 @@ open_hdf5_file(hbool_t create_file, hbool_t mdci_sbem_expected, file_id = H5Fopen(hdf_file_name, H5F_ACC_RDWR, fapl_id); } + /* tidy up */ + H5Pclose(fapl_id); + if ( file_id < 0 ) { pass = FALSE; @@ -4720,7 +4723,7 @@ cache_image_smoke_check_4(hbool_t single_file_vfd) *------------------------------------------------------------------------- */ -#define MAX_NUM_GROUPS 128 +#define MAX_NUM_GROUPS 64 static unsigned cache_image_smoke_check_5(hbool_t single_file_vfd) @@ -4756,12 +4759,16 @@ cache_image_smoke_check_5(hbool_t single_file_vfd) /* setup the file name */ if ( pass ) { - if ( h5_fixname(FILENAMES[0], H5P_DEFAULT, filename, sizeof(filename)) + hid_t fapl_id = h5_fileaccess(); + + if ( h5_fixname(FILENAMES[0], fapl_id, filename, sizeof(filename)) == NULL ) { pass = FALSE; failure_mssg = "h5_fixname() failed.\n"; } + + H5Pclose(fapl_id); } if ( show_progress ) -- cgit v0.12 From a4e63bb98072868a145c45e8247280ebc86c3a6d Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 16 Jan 2019 21:37:07 -0800 Subject: Fixed a memory issue flagged by valgrind in the direct_chunk test. --- test/direct_chunk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/direct_chunk.c b/test/direct_chunk.c index 2ef38ea..2edfe64 100644 --- a/test/direct_chunk.c +++ b/test/direct_chunk.c @@ -1910,10 +1910,10 @@ test_read_unallocated_chunk (hid_t file) goto error; /* Write a single chunk to intialize the chunk storage */ - HDmemset(&chunk_dims, 0, sizeof(chunk_dims)); + HDmemset(direct_buf, 0, CHUNK_NX * CHUNK_NY * sizeof(int)); offset[0] = 0; offset[1] = 0; - if(H5Dwrite_chunk(dataset, dxpl, filter_mask, offset, chunk_nbytes, &chunk_dims) < 0) + if(H5Dwrite_chunk(dataset, dxpl, filter_mask, offset, chunk_nbytes, direct_buf) < 0) goto error; /* Attempt to read each chunk in the dataset. Chunks are not allocated, -- cgit v0.12 From f25e78ad4216a776b0166a016a7abedd85e219e6 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 18 Jan 2019 11:54:58 -0600 Subject: TRILABS-105 Fix CMake policy 54 warnings --- config/cmake_ext_mod/runTest.cmake | 44 +++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/config/cmake_ext_mod/runTest.cmake b/config/cmake_ext_mod/runTest.cmake index 4ac1dc8..e11852a 100644 --- a/config/cmake_ext_mod/runTest.cmake +++ b/config/cmake_ext_mod/runTest.cmake @@ -80,7 +80,7 @@ if (TEST_REGEX) file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) string (REGEX MATCH "${TEST_REGEX}" REGEX_MATCH ${TEST_STREAM}) string (COMPARE EQUAL "${REGEX_MATCH}" "${TEST_MATCH}" REGEX_RESULT) - if ("${REGEX_RESULT}" STREQUAL "0") + if (NOT REGEX_RESULT) message (STATUS "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_MATCH}") endif () endif () @@ -111,7 +111,7 @@ if (TEST_APPEND) endif () # if the return value is !=${TEST_EXPECT} bail out -if (NOT "${TEST_RESULT}" STREQUAL "${TEST_EXPECT}") +if (NOT TEST_RESULT EQUAL TEST_EXPECT) if (NOT TEST_NOERRDISPLAY) if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}) file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) @@ -126,7 +126,7 @@ message (STATUS "COMMAND Error: ${TEST_ERROR}") # remove special output file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) string (FIND TEST_STREAM "_pmi_alps" "${TEST_FIND_RESULT}") -if (NOT ${TEST_FIND_RESULT} STREQUAL "0") +if (TEST_FIND_RESULT GREATER 0) string (REGEX REPLACE "^.*_pmi_alps[^\n]+\n" "" TEST_STREAM "${TEST_STREAM}") file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_STREAM}) endif () @@ -207,33 +207,33 @@ if (NOT TEST_SKIP_COMPARE) endif () endif () - if (NOT "${TEST_RESULT}" STREQUAL "0") + if (TEST_RESULT) set (TEST_RESULT 0) file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act) list (LENGTH test_act len_act) file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} test_ref) list (LENGTH test_ref len_ref) - if (NOT "${len_act}" STREQUAL "0" AND NOT "${len_ref}" STREQUAL "0") + if (len_act GREATER 0 AND len_ref GREATER 0) math (EXPR _FP_LEN "${len_ref} - 1") foreach (line RANGE 0 ${_FP_LEN}) list (GET test_act ${line} str_act) list (GET test_ref ${line} str_ref) - if (NOT "${str_act}" STREQUAL "${str_ref}") - if (NOT "${str_act}" STREQUAL "") + if (NOT ${str_act} STREQUAL ${str_ref}) + if (NOT str_act STREQUAL "") set (TEST_RESULT 1) message ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") endif () endif () endforeach () else () - if ("${len_act}" STREQUAL "0") + if (len_act EQUAL 0) message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT} is empty") endif () - if ("${len_ref}" STREQUAL "0") + if (len_ref EQUAL 0) message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_REFERENCE} is empty") endif () endif () - if (NOT "${len_act}" STREQUAL "${len_ref}") + if (NOT len_act EQUAL len_ref) set (TEST_RESULT 1) endif () endif () @@ -241,7 +241,7 @@ if (NOT TEST_SKIP_COMPARE) message (STATUS "COMPARE Result: ${TEST_RESULT}") # again, if return value is !=0 scream and shout - if (NOT "${TEST_RESULT}" STREQUAL "0") + if (TEST_RESULT) message (FATAL_ERROR "Failed: The output of ${TEST_OUTPUT} did not match ${TEST_REFERENCE}") endif () endif () @@ -258,34 +258,34 @@ if (NOT TEST_SKIP_COMPARE) COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT}.err ${TEST_FOLDER}/${TEST_ERRREF} RESULT_VARIABLE TEST_RESULT ) - if (NOT "${TEST_RESULT}" STREQUAL "0") + if (TEST_RESULT) set (TEST_RESULT 0) file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT}.err test_act) list (LENGTH test_act len_act) file (STRINGS ${TEST_FOLDER}/${TEST_ERRREF} test_ref) list (LENGTH test_ref len_ref) math (EXPR _FP_LEN "${len_ref} - 1") - if (NOT "${len_act}" STREQUAL "0" AND NOT "${len_ref}" STREQUAL "0") + if (len_act GREATER 0 AND len_ref GREATER 0) math (EXPR _FP_LEN "${len_ref} - 1") foreach (line RANGE 0 ${_FP_LEN}) list (GET test_act ${line} str_act) list (GET test_ref ${line} str_ref) - if (NOT "${str_act}" STREQUAL "${str_ref}") - if (NOT "${str_act}" STREQUAL "") + if (NOT ${str_act} STREQUAL ${str_ref}) + if (NOT ${str_act} STREQUAL "") set (TEST_RESULT 1) message ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") endif () endif () endforeach () else () - if ("${len_act}" STREQUAL "0") + if (len_act EQUAL 0) message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT}.err is empty") endif () - if ("${len_ref}" STREQUAL "0") + if (len_ref EQUAL 0) message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_ERRREF} is empty") endif () endif () - if (NOT "${len_act}" STREQUAL "${len_ref}") + if (NOT len_act EQUAL len_ref) set (TEST_RESULT 1) endif () endif () @@ -293,7 +293,7 @@ if (NOT TEST_SKIP_COMPARE) message (STATUS "COMPARE Result: ${TEST_RESULT}") # again, if return value is !=0 scream and shout - if (NOT "${TEST_RESULT}" STREQUAL "0") + if (TEST_RESULT) message (FATAL_ERROR "Failed: The error output of ${TEST_OUTPUT}.err did not match ${TEST_ERRREF}") endif () endif () @@ -306,15 +306,15 @@ if (TEST_GREP_COMPARE) # TEST_REFERENCE should always be matched string (REGEX MATCH "${TEST_REFERENCE}" TEST_MATCH ${TEST_STREAM}) string (COMPARE EQUAL "${TEST_REFERENCE}" "${TEST_MATCH}" TEST_RESULT) - if ("${TEST_RESULT}" STREQUAL "0") + if (NOT TEST_RESULT) message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_REFERENCE}") endif () string (REGEX MATCH "${TEST_FILTER}" TEST_MATCH ${TEST_STREAM}) - if ("${TEST_EXPECT}" STREQUAL "1") + if (TEST_EXPECT) # TEST_EXPECT (1) interperts TEST_FILTER as NOT to match string (LENGTH "${TEST_MATCH}" TEST_RESULT) - if (NOT "${TEST_RESULT}" STREQUAL "0") + if (TEST_RESULT) message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did contain ${TEST_FILTER}") endif () endif () -- cgit v0.12 From 8adbf2552b34bd9bacf47b1196990cf568a9156e Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 18 Jan 2019 12:16:38 -0600 Subject: Fix CMake policy 54 warnings --- config/cmake/jrunTest.cmake | 46 ++++++++++++++++++------------------- config/cmake/vfdTest.cmake | 2 +- config/cmake/volTest.cmake | 2 +- config/cmake_ext_mod/grepTest.cmake | 8 +++---- 4 files changed, 29 insertions(+), 29 deletions(-) diff --git a/config/cmake/jrunTest.cmake b/config/cmake/jrunTest.cmake index 43aef22..23f297c 100644 --- a/config/cmake/jrunTest.cmake +++ b/config/cmake/jrunTest.cmake @@ -77,10 +77,10 @@ if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err) endif () if (NOT ERROR_APPEND) - # append error output to the stdout output file + # write back to original .err file file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT}.err "${TEST_STREAM}") else () - # write back to original .err file + # append error output to the stdout output file file (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") endif () endif () @@ -110,8 +110,8 @@ if (TEST_MASK_ERROR) endif () endif () -# if the return value is !=0 bail out -if (NOT "${TEST_RESULT}" STREQUAL "${TEST_EXPECT}") +# if the return value is !=expected bail out +if (NOT TEST_RESULT EQUAL TEST_EXPECT) message (STATUS "ERROR OUTPUT: ${TEST_STREAM}") message (FATAL_ERROR "Failed: Test program ${TEST_PROGRAM} exited != 0.\n${TEST_ERROR}") endif () @@ -131,33 +131,33 @@ if (NOT TEST_SKIP_COMPARE) COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_FOLDER}/${TEST_REFERENCE} RESULT_VARIABLE TEST_RESULT ) - if (NOT "${TEST_RESULT}" STREQUAL "0") + if (TEST_RESULT) set (TEST_RESULT 0) file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act) list (LENGTH test_act len_act) file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} test_ref) list (LENGTH test_ref len_ref) - if (NOT "${len_act}" STREQUAL "0" AND NOT "${len_ref}" STREQUAL "0") + if (len_act GREATER 0 AND len_ref GREATER 0) math (EXPR _FP_LEN "${len_ref} - 1") foreach (line RANGE 0 ${_FP_LEN}) list (GET test_act ${line} str_act) list (GET test_ref ${line} str_ref) - if (NOT "${str_act}" STREQUAL "${str_ref}") - if (NOT "${str_act}" STREQUAL "") + if (NOT ${str_act} STREQUAL ${str_ref}) + if (NOT str_act STREQUAL "") set (TEST_RESULT 1) message ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") endif () endif () endforeach () else () - if ("${len_act}" STREQUAL "0") + if (len_act EQUAL 0) message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT} is empty") endif () - if ("${len_ref}" STREQUAL "0") + if (len_ref EQUAL 0) message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_REFERENCE} is empty") endif () endif () - if (NOT "${len_act}" STREQUAL "${len_ref}") + if (NOT len_act EQUAL len_ref) set (TEST_RESULT 1) endif () endif () @@ -165,7 +165,7 @@ if (NOT TEST_SKIP_COMPARE) message (STATUS "COMPARE Result: ${TEST_RESULT}") # again, if return value is !=0 scream and shout - if (NOT "${TEST_RESULT}" STREQUAL "0") + if (TEST_RESULT) message (FATAL_ERROR "Failed: The output of ${TEST_OUTPUT} did not match ${TEST_REFERENCE}") endif () endif () @@ -182,34 +182,34 @@ if (NOT TEST_SKIP_COMPARE) COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT}.err ${TEST_FOLDER}/${TEST_ERRREF} RESULT_VARIABLE TEST_RESULT ) - if (NOT "${TEST_RESULT}" STREQUAL "0") + if (TEST_RESULT) set (TEST_RESULT 0) file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT}.err test_act) list (LENGTH test_act len_act) file (STRINGS ${TEST_FOLDER}/${TEST_ERRREF} test_ref) list (LENGTH test_ref len_ref) math (EXPR _FP_LEN "${len_ref} - 1") - if (NOT "${len_act}" STREQUAL "0" AND NOT "${len_ref}" STREQUAL "0") + if (len_act GREATER 0 AND len_ref GREATER 0) math (EXPR _FP_LEN "${len_ref} - 1") foreach (line RANGE 0 ${_FP_LEN}) list (GET test_act ${line} str_act) list (GET test_ref ${line} str_ref) - if (NOT "${str_act}" STREQUAL "${str_ref}") - if (NOT "${str_act}" STREQUAL "") + if (NOT ${str_act} STREQUAL ${str_ref}) + if (NOT ${str_act} STREQUAL "") set (TEST_RESULT 1) message ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") endif () endif () endforeach () else () - if ("${len_act}" STREQUAL "0") + if (len_act EQUAL 0) message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT}.err is empty") endif () - if ("${len_ref}" STREQUAL "0") + if (len_ref EQUAL 0) message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_ERRREF} is empty") endif () endif () - if (NOT "${len_act}" STREQUAL "${len_ref}") + if (NOT len_act EQUAL len_ref) set (TEST_RESULT 1) endif () endif () @@ -217,7 +217,7 @@ if (NOT TEST_SKIP_COMPARE) message (STATUS "COMPARE Result: ${TEST_RESULT}") # again, if return value is !=0 scream and shout - if (NOT "${TEST_RESULT}" STREQUAL "0") + if (TEST_RESULT) message (FATAL_ERROR "Failed: The error output of ${TEST_OUTPUT}.err did not match ${TEST_ERRREF}") endif () endif () @@ -230,15 +230,15 @@ if (TEST_GREP_COMPARE) # TEST_REFERENCE should always be matched string (REGEX MATCH "${TEST_REFERENCE}" TEST_MATCH ${TEST_STREAM}) string (COMPARE EQUAL "${TEST_REFERENCE}" "${TEST_MATCH}" TEST_RESULT) - if ("${TEST_RESULT}" STREQUAL "0") + if (NOT TEST_RESULT) message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_REFERENCE}") endif () string (REGEX MATCH "${TEST_FILTER}" TEST_MATCH ${TEST_STREAM}) - if ("${TEST_EXPECT}" STREQUAL "1") + if (TEST_EXPECT) # TEST_EXPECT (1) interperts TEST_FILTER as NOT to match string (LENGTH "${TEST_MATCH}" TEST_RESULT) - if (NOT "${TEST_RESULT}" STREQUAL "0") + if (TEST_RESULT) message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did contain ${TEST_FILTER}") endif () endif () diff --git a/config/cmake/vfdTest.cmake b/config/cmake/vfdTest.cmake index 95a4c40..b616958 100644 --- a/config/cmake/vfdTest.cmake +++ b/config/cmake/vfdTest.cmake @@ -60,7 +60,7 @@ if (ERROR_APPEND AND EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.err) endif () # if the return value is !=${TEST_EXPECT} bail out -if (NOT "${TEST_RESULT}" STREQUAL "${TEST_EXPECT}") +if (NOT TEST_RESULT EQUAL TEST_EXPECT) if (NOT TEST_NOERRDISPLAY) if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.out) file (READ ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.out TEST_STREAM) diff --git a/config/cmake/volTest.cmake b/config/cmake/volTest.cmake index 27da8a5..d8c82a4 100644 --- a/config/cmake/volTest.cmake +++ b/config/cmake/volTest.cmake @@ -60,7 +60,7 @@ if (ERROR_APPEND AND EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err) endif () # if the return value is !=${TEST_EXPECT} bail out -if (NOT "${TEST_RESULT}" STREQUAL "${TEST_EXPECT}") +if (NOT TEST_RESULT EQUAL TEST_EXPECT) if (NOT TEST_NOERRDISPLAY) if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.out) file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.out TEST_STREAM) diff --git a/config/cmake_ext_mod/grepTest.cmake b/config/cmake_ext_mod/grepTest.cmake index b812d73..1417204 100644 --- a/config/cmake_ext_mod/grepTest.cmake +++ b/config/cmake_ext_mod/grepTest.cmake @@ -57,15 +57,15 @@ file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) # TEST_REFERENCE should always be matched string (REGEX MATCH "${TEST_REFERENCE}" TEST_MATCH ${TEST_STREAM}) string (COMPARE EQUAL "${TEST_REFERENCE}" "${TEST_MATCH}" TEST_RESULT) -if ("${TEST_RESULT}" STREQUAL "0") +if (NOT TEST_RESULT) message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_REFERENCE}") endif () string (REGEX MATCH "${TEST_FILTER}" TEST_MATCH ${TEST_STREAM}) -if ("${TEST_EXPECT}" STREQUAL "1") - # TEST_EXPECT (1) interperts TEST_FILTER as NOT to match +if (TEST_EXPECT) + # TEST_EXPECT (1) interprets TEST_FILTER as; NOT to match string (LENGTH "${TEST_MATCH}" TEST_RESULT) - if (NOT "${TEST_RESULT}" STREQUAL "0") + if (TEST_RESULT) message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did contain ${TEST_FILTER}") endif () endif () -- cgit v0.12 From a578e36038083e1e8dd8fe3db77e01fd51f5595d Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 18 Jan 2019 12:25:38 -0600 Subject: Add missing depends to last test --- tools/test/misc/CMakeTestsRepart.cmake | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/tools/test/misc/CMakeTestsRepart.cmake b/tools/test/misc/CMakeTestsRepart.cmake index 830de11..4746f9d 100644 --- a/tools/test/misc/CMakeTestsRepart.cmake +++ b/tools/test/misc/CMakeTestsRepart.cmake @@ -71,30 +71,37 @@ family_to_single.h5 family_to_sec2.h5 ) - if (NOT "${last_test}" STREQUAL "") - set_tests_properties (H5REPART-clearall-objects PROPERTIES DEPENDS ${last_test}) - endif () - set (last_test "H5REPART-clearall-objects") + set_tests_properties (H5REPART-clearall-objects PROPERTIES FIXTURES_SETUP clear_testrepart) # repartition family member size to 20,000 bytes. add_test (NAME H5REPART-h5repart_20K COMMAND $ -m 20000 family_file%05d.h5 fst_family%05d.h5) - set_tests_properties (H5REPART-h5repart_20K PROPERTIES DEPENDS H5REPART-clearall-objects) + set_tests_properties (H5REPART-h5repart_20K PROPERTIES + FIXTURES_REQUIRED clear_testrepart + ) # repartition family member size to 5 KB. add_test (NAME H5REPART-h5repart_5K COMMAND $ -m 5k family_file%05d.h5 scd_family%05d.h5) - set_tests_properties (H5REPART-h5repart_5K PROPERTIES DEPENDS H5REPART-clearall-objects) + set_tests_properties (H5REPART-h5repart_5K PROPERTIES + FIXTURES_REQUIRED clear_testrepart + ) # convert family file to sec2 file of 20,000 bytes add_test (NAME H5REPART-h5repart_single COMMAND $ -m 20000 -family_to_single family_file%05d.h5 family_to_single.h5) - set_tests_properties (H5REPART-h5repart_single PROPERTIES DEPENDS H5REPART-clearall-objects) + set_tests_properties (H5REPART-h5repart_single PROPERTIES + FIXTURES_REQUIRED clear_testrepart + ) # convert family file to sec2 file of 20,000 bytes (old argument) add_test (NAME H5REPART-h5repart_sec2 COMMAND $ -m 20000 -family_to_sec2 family_file%05d.h5 family_to_sec2.h5) - set_tests_properties (H5REPART-h5repart_sec2 PROPERTIES DEPENDS H5REPART-clearall-objects) + set_tests_properties (H5REPART-h5repart_sec2 PROPERTIES + FIXTURES_REQUIRED clear_testrepart + ) # test the output files repartitioned above. add_test (NAME H5REPART-h5repart_test COMMAND $) - set_tests_properties (H5REPART-h5repart_test PROPERTIES DEPENDS "H5REPART-clearall-objects;H5REPART-h5repart_20K;H5REPART-h5repart_5K;H5REPART-h5repart_sec2") + set_tests_properties (H5REPART-h5repart_test PROPERTIES + DEPENDS "H5REPART-h5repart_20K;H5REPART-h5repart_5K;H5REPART-h5repart_single;H5REPART-h5repart_sec2") + ) set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} h5repart_test -- cgit v0.12 From 13d1568c3f491b1dfe6254f22f04fece29b6dad2 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 18 Jan 2019 12:27:21 -0600 Subject: Fix missing depends for last repart test --- tools/test/misc/CMakeTestsRepart.cmake | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/tools/test/misc/CMakeTestsRepart.cmake b/tools/test/misc/CMakeTestsRepart.cmake index 830de11..4746f9d 100644 --- a/tools/test/misc/CMakeTestsRepart.cmake +++ b/tools/test/misc/CMakeTestsRepart.cmake @@ -71,30 +71,37 @@ family_to_single.h5 family_to_sec2.h5 ) - if (NOT "${last_test}" STREQUAL "") - set_tests_properties (H5REPART-clearall-objects PROPERTIES DEPENDS ${last_test}) - endif () - set (last_test "H5REPART-clearall-objects") + set_tests_properties (H5REPART-clearall-objects PROPERTIES FIXTURES_SETUP clear_testrepart) # repartition family member size to 20,000 bytes. add_test (NAME H5REPART-h5repart_20K COMMAND $ -m 20000 family_file%05d.h5 fst_family%05d.h5) - set_tests_properties (H5REPART-h5repart_20K PROPERTIES DEPENDS H5REPART-clearall-objects) + set_tests_properties (H5REPART-h5repart_20K PROPERTIES + FIXTURES_REQUIRED clear_testrepart + ) # repartition family member size to 5 KB. add_test (NAME H5REPART-h5repart_5K COMMAND $ -m 5k family_file%05d.h5 scd_family%05d.h5) - set_tests_properties (H5REPART-h5repart_5K PROPERTIES DEPENDS H5REPART-clearall-objects) + set_tests_properties (H5REPART-h5repart_5K PROPERTIES + FIXTURES_REQUIRED clear_testrepart + ) # convert family file to sec2 file of 20,000 bytes add_test (NAME H5REPART-h5repart_single COMMAND $ -m 20000 -family_to_single family_file%05d.h5 family_to_single.h5) - set_tests_properties (H5REPART-h5repart_single PROPERTIES DEPENDS H5REPART-clearall-objects) + set_tests_properties (H5REPART-h5repart_single PROPERTIES + FIXTURES_REQUIRED clear_testrepart + ) # convert family file to sec2 file of 20,000 bytes (old argument) add_test (NAME H5REPART-h5repart_sec2 COMMAND $ -m 20000 -family_to_sec2 family_file%05d.h5 family_to_sec2.h5) - set_tests_properties (H5REPART-h5repart_sec2 PROPERTIES DEPENDS H5REPART-clearall-objects) + set_tests_properties (H5REPART-h5repart_sec2 PROPERTIES + FIXTURES_REQUIRED clear_testrepart + ) # test the output files repartitioned above. add_test (NAME H5REPART-h5repart_test COMMAND $) - set_tests_properties (H5REPART-h5repart_test PROPERTIES DEPENDS "H5REPART-clearall-objects;H5REPART-h5repart_20K;H5REPART-h5repart_5K;H5REPART-h5repart_sec2") + set_tests_properties (H5REPART-h5repart_test PROPERTIES + DEPENDS "H5REPART-h5repart_20K;H5REPART-h5repart_5K;H5REPART-h5repart_single;H5REPART-h5repart_sec2") + ) set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} h5repart_test -- cgit v0.12 From 2cf543b2941442a45a4cb878d4fb33c8c69188a2 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 18 Jan 2019 12:57:02 -0600 Subject: Fix typo --- tools/test/misc/CMakeTestsRepart.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/test/misc/CMakeTestsRepart.cmake b/tools/test/misc/CMakeTestsRepart.cmake index 4746f9d..8edd243 100644 --- a/tools/test/misc/CMakeTestsRepart.cmake +++ b/tools/test/misc/CMakeTestsRepart.cmake @@ -100,7 +100,7 @@ # test the output files repartitioned above. add_test (NAME H5REPART-h5repart_test COMMAND $) set_tests_properties (H5REPART-h5repart_test PROPERTIES - DEPENDS "H5REPART-h5repart_20K;H5REPART-h5repart_5K;H5REPART-h5repart_single;H5REPART-h5repart_sec2") + DEPENDS "H5REPART-h5repart_20K;H5REPART-h5repart_5K;H5REPART-h5repart_single;H5REPART-h5repart_sec2" ) set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} -- cgit v0.12 From 769837f3ae93f4cae3486aef95c1c580a9946406 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 18 Jan 2019 16:30:36 -0600 Subject: Add parrallel runTest.cmake for ph5example --- MANIFEST | 1 + config/cmake_ext_mod/parrunTest.cmake | 325 ++++++++++++++++++++++++++++++++++ examples/CMakeTests.cmake | 10 +- 3 files changed, 332 insertions(+), 4 deletions(-) create mode 100644 config/cmake_ext_mod/parrunTest.cmake diff --git a/MANIFEST b/MANIFEST index f54560a..5ff8ce1 100644 --- a/MANIFEST +++ b/MANIFEST @@ -3243,6 +3243,7 @@ ./config/cmake_ext_mod/NSIS.InstallOptions.ini.in ./config/cmake_ext_mod/NSIS.template.in ./config/cmake_ext_mod/runTest.cmake +./config/cmake_ext_mod/parrunTest.cmake ./config/cmake_ext_mod/version.plist.in # CMake-specific User Files diff --git a/config/cmake_ext_mod/parrunTest.cmake b/config/cmake_ext_mod/parrunTest.cmake new file mode 100644 index 0000000..8449448 --- /dev/null +++ b/config/cmake_ext_mod/parrunTest.cmake @@ -0,0 +1,325 @@ +# +# 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 COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# +# parrunTest.cmake executes a command using MPI and captures the output in a file. File is then compared +# against a reference file. Exit status of command can also be compared. +cmake_policy(SET CMP0007 NEW) + +# arguments checking +if (NOT TEST_PROGRAM) + message (FATAL_ERROR "Require TEST_PROGRAM to be defined") +endif () +if (NOT TEST_FOLDER) + message ( FATAL_ERROR "Require TEST_FOLDER to be defined") +endif () +if (NOT TEST_OUTPUT) + message (FATAL_ERROR "Require TEST_OUTPUT to be defined") +endif () +if (NOT TEST_EXPECT) + message (STATUS "Require TEST_EXPECT to be defined") +endif () + +if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}) + file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT}) +endif () + +if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err) + file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT}.err) +endif () + +message (STATUS "COMMAND: ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} ${TEST_PROGRAM} ${MPIEXEC_POSTFLAGS} ${TEST_ARGS}") + +if (TEST_LIBRARY_DIRECTORY) + if (WIN32 AND NOT MINGW) + set (ENV{PATH} "$ENV{PATH};${TEST_LIBRARY_DIRECTORY}") + else () + set (ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH}:${TEST_LIBRARY_DIRECTORY}") + endif () +endif () + +if (TEST_ENV_VAR) + set (ENV{${TEST_ENV_VAR}} "${TEST_ENV_VALUE}") + #message (STATUS "ENV:${TEST_ENV_VAR}=$ENV{${TEST_ENV_VAR}}") +endif () + +if (NOT TEST_INPUT) + # run the test program, capture the stdout/stderr and the result var + execute_process ( + COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} ${TEST_PROGRAM} ${MPIEXEC_POSTFLAGS} ${TEST_ARGS} + WORKING_DIRECTORY ${TEST_FOLDER} + RESULT_VARIABLE TEST_RESULT + OUTPUT_FILE ${TEST_OUTPUT} + ERROR_FILE ${TEST_OUTPUT}.err + OUTPUT_VARIABLE TEST_OUT + ERROR_VARIABLE TEST_ERROR + ) +else () + # run the test program with stdin, capture the stdout/stderr and the result var + execute_process ( + COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} ${TEST_PROGRAM} ${MPIEXEC_POSTFLAGS} ${TEST_ARGS} + WORKING_DIRECTORY ${TEST_FOLDER} + RESULT_VARIABLE TEST_RESULT + INPUT_FILE ${TEST_INPUT} + OUTPUT_FILE ${TEST_OUTPUT} + ERROR_FILE ${TEST_OUTPUT}.err + OUTPUT_VARIABLE TEST_OUT + ERROR_VARIABLE TEST_ERROR + ) +endif () + +if (TEST_REGEX) + # TEST_REGEX should always be matched + file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) + string (REGEX MATCH "${TEST_REGEX}" REGEX_MATCH ${TEST_STREAM}) + string (COMPARE EQUAL "${REGEX_MATCH}" "${TEST_MATCH}" REGEX_RESULT) + if (NOT REGEX_RESULT) + message (STATUS "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_MATCH}") + endif () +endif () + +message (STATUS "COMMAND Result: ${TEST_RESULT}") + +# if the .err file exists and ERRROR_APPEND is enabled +if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err) + file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM) + if (TEST_MASK_FILE) + STRING(REGEX REPLACE "CurrentDir is [^\n]+\n" "CurrentDir is (dir name)\n" TEST_STREAM "${TEST_STREAM}") + endif () + # remove special output + string (REGEX REPLACE "^.*_pmi_alps[^\n]+\n" "" TEST_STREAM "${TEST_STREAM}") + + if (NOT ERROR_APPEND) + # write back to original .err file + file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT}.err "${TEST_STREAM}") + else () + # append error output to the stdout output file + file (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") + endif () +endif () + +# append the test result status with a predefined text +if (TEST_APPEND) + file (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_APPEND} ${TEST_RESULT}\n") +endif () + +# if the return value is !=${TEST_EXPECT} bail out +if (NOT TEST_RESULT EQUAL TEST_EXPECT) + if (NOT TEST_NOERRDISPLAY) + if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}) + file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) + message (STATUS "Output :\n${TEST_STREAM}") + endif () + endif () + message (FATAL_ERROR "Failed: Test program ${TEST_PROGRAM} exited != ${TEST_EXPECT}.\n${TEST_ERROR}") +endif () + +message (STATUS "COMMAND Error: ${TEST_ERROR}") + +# remove special output +file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) +string (FIND TEST_STREAM "_pmi_alps" "${TEST_FIND_RESULT}") +if (TEST_FIND_RESULT GREATER 0) + string (REGEX REPLACE "^.*_pmi_alps[^\n]+\n" "" TEST_STREAM "${TEST_STREAM}") + file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_STREAM}) +endif () + +# if the output file needs Storage text removed +if (TEST_MASK) + file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) + string (REGEX REPLACE "Storage:[^\n]+\n" "Storage:
\n" TEST_STREAM "${TEST_STREAM}") + file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") +endif () + +# if the output file needs Modified text removed +if (TEST_MASK_MOD) + file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) + string (REGEX REPLACE "Modified:[^\n]+\n" "Modified: XXXX-XX-XX XX:XX:XX XXX\n" TEST_STREAM "${TEST_STREAM}") + file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") +endif () + +# if the output file or the .err file needs to mask out error stack info +if (TEST_MASK_ERROR) + if (NOT TEST_ERRREF) + # the error stack has been appended to the output file + file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) + else () + # the error stack remains in the .err file + file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM) + endif () + 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}") + # write back the changes to the original files + if (NOT TEST_ERRREF) + file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") + else () + file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT}.err "${TEST_STREAM}") + endif () +endif () + +# remove text from the output file +if (TEST_FILTER) + file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) + string (REGEX REPLACE "${TEST_FILTER}" "${TEST_FILTER_REPLACE}" TEST_STREAM "${TEST_STREAM}") + file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") +endif () + +if (TEST_REF_FILTER) + #message (STATUS "TEST_REF_FILTER: ${TEST_APPEND}${TEST_REF_FILTER}") + file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM) + STRING(REGEX REPLACE "${TEST_REF_APPEND}" "${TEST_REF_FILTER}" TEST_STREAM "${TEST_STREAM}") + file (WRITE ${TEST_FOLDER}/${TEST_REFERENCE} "${TEST_STREAM}") +endif () + +# compare output files to references unless this must be skipped +if (NOT TEST_SKIP_COMPARE) + if (EXISTS ${TEST_FOLDER}/${TEST_REFERENCE}) + if (WIN32 AND NOT MINGW) + file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM) + file (WRITE ${TEST_FOLDER}/${TEST_REFERENCE} "${TEST_STREAM}") + endif () + + if (NOT TEST_SORT_COMPARE) + # now compare the output with the reference + execute_process ( + COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_FOLDER}/${TEST_REFERENCE} + RESULT_VARIABLE TEST_RESULT + ) + else () + file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} v1) + file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} v2) + list (SORT v1) + list (SORT v2) + if (NOT v1 STREQUAL v2) + set(TEST_RESULT 1) + endif () + endif () + + if (TEST_RESULT) + set (TEST_RESULT 0) + file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act) + list (LENGTH test_act len_act) + file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} test_ref) + list (LENGTH test_ref len_ref) + if (len_act GREATER 0 AND len_ref GREATER 0) + math (EXPR _FP_LEN "${len_ref} - 1") + foreach (line RANGE 0 ${_FP_LEN}) + list (GET test_act ${line} str_act) + list (GET test_ref ${line} str_ref) + if (NOT ${str_act} STREQUAL ${str_ref}) + if (NOT str_act STREQUAL "") + set (TEST_RESULT 1) + message ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") + endif () + endif () + endforeach () + else () + if (len_act EQUAL 0) + message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT} is empty") + endif () + if (len_ref EQUAL 0) + message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_REFERENCE} is empty") + endif () + endif () + if (NOT len_act EQUAL len_ref) + set (TEST_RESULT 1) + endif () + endif () + + message (STATUS "COMPARE Result: ${TEST_RESULT}") + + # again, if return value is !=0 scream and shout + if (TEST_RESULT) + message (FATAL_ERROR "Failed: The output of ${TEST_OUTPUT} did not match ${TEST_REFERENCE}") + endif () + endif () + + # now compare the .err file with the error reference, if supplied + if (TEST_ERRREF) + if (WIN32 AND NOT MINGW) + file (READ ${TEST_FOLDER}/${TEST_ERRREF} TEST_STREAM) + file (WRITE ${TEST_FOLDER}/${TEST_ERRREF} "${TEST_STREAM}") + endif () + + # now compare the error output with the error reference + execute_process ( + COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT}.err ${TEST_FOLDER}/${TEST_ERRREF} + RESULT_VARIABLE TEST_RESULT + ) + if (TEST_RESULT) + set (TEST_RESULT 0) + file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT}.err test_act) + list (LENGTH test_act len_act) + file (STRINGS ${TEST_FOLDER}/${TEST_ERRREF} test_ref) + list (LENGTH test_ref len_ref) + math (EXPR _FP_LEN "${len_ref} - 1") + if (len_act GREATER 0 AND len_ref GREATER 0) + math (EXPR _FP_LEN "${len_ref} - 1") + foreach (line RANGE 0 ${_FP_LEN}) + list (GET test_act ${line} str_act) + list (GET test_ref ${line} str_ref) + if (NOT ${str_act} STREQUAL ${str_ref}) + if (NOT ${str_act} STREQUAL "") + set (TEST_RESULT 1) + message ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") + endif () + endif () + endforeach () + else () + if (len_act EQUAL 0) + message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT}.err is empty") + endif () + if (len_ref EQUAL 0) + message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_ERRREF} is empty") + endif () + endif () + if (NOT len_act EQUAL len_ref) + set (TEST_RESULT 1) + endif () + endif () + + message (STATUS "COMPARE Result: ${TEST_RESULT}") + + # again, if return value is !=0 scream and shout + if (TEST_RESULT) + message (FATAL_ERROR "Failed: The error output of ${TEST_OUTPUT}.err did not match ${TEST_ERRREF}") + endif () + endif () +endif () + +if (TEST_GREP_COMPARE) + # now grep the output with the reference + file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) + + # TEST_REFERENCE should always be matched + string (REGEX MATCH "${TEST_REFERENCE}" TEST_MATCH ${TEST_STREAM}) + string (COMPARE EQUAL "${TEST_REFERENCE}" "${TEST_MATCH}" TEST_RESULT) + if (NOT TEST_RESULT) + message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_REFERENCE}") + endif () + + string (REGEX MATCH "${TEST_FILTER}" TEST_MATCH ${TEST_STREAM}) + if (TEST_EXPECT) + # TEST_EXPECT (1) interperts TEST_FILTER as NOT to match + string (LENGTH "${TEST_MATCH}" TEST_RESULT) + if (TEST_RESULT) + message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did contain ${TEST_FILTER}") + endif () + endif () +endif () + +# everything went fine... +message ("${TEST_PROGRAM} Passed") + diff --git a/examples/CMakeTests.cmake b/examples/CMakeTests.cmake index 6b4504b..26babbb 100644 --- a/examples/CMakeTests.cmake +++ b/examples/CMakeTests.cmake @@ -181,17 +181,18 @@ ### Windows pops up a modal permission dialog on this test if (H5_HAVE_PARALLEL AND NOT WIN32) if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME EXAMPLES_PAR-ph5example COMMAND $) + add_test (NAME EXAMPLES_PAR-ph5example COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $ ${MPIEXEC_POSTFLAGS}) else () add_test (NAME EXAMPLES_PAR-ph5example COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" -D "TEST_ARGS:STRING=" -D "TEST_EXPECT=0" -D "TEST_SKIP_COMPARE=TRUE" + #-D "TEST_SORT_COMPARE=TRUE" -D "TEST_OUTPUT=ph5example.txt" #-D "TEST_REFERENCE=ph5example.out" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + -P "${HDF_RESOURCES_EXT_DIR}/parrunTest.cmake" ) endif () if (NOT "${last_test}" STREQUAL "") @@ -200,17 +201,18 @@ set (last_test "EXAMPLES_PAR-ph5example") if (BUILD_SHARED_LIBS) if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME EXAMPLES_PAR-shared-ph5example COMMAND $) + add_test (NAME EXAMPLES_PAR-shared-ph5example COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $ ${MPIEXEC_POSTFLAGS}) else () add_test (NAME EXAMPLES_PAR-shared-ph5example COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" -D "TEST_ARGS:STRING=" -D "TEST_EXPECT=0" -D "TEST_SKIP_COMPARE=TRUE" + #-D "TEST_SORT_COMPARE=TRUE" -D "TEST_OUTPUT=ph5example-shared.txt" #-D "TEST_REFERENCE=ph5example-shared.out" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5EX-shared" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + -P "${HDF_RESOURCES_EXT_DIR}/parrunTest.cmake" ) endif () set_tests_properties (EXAMPLES_PAR-shared-ph5example PROPERTIES WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/H5EX-shared) -- cgit v0.12 From e6be5560882c2f598b3a0ddab7d9d29a552fcb10 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Sun, 20 Jan 2019 16:47:50 -0600 Subject: MPI vars need passed in, change to grepTest --- MANIFEST | 1 - config/cmake_ext_mod/parrunTest.cmake | 325 ---------------------------------- config/cmake_ext_mod/runTest.cmake | 2 +- examples/CMakeTests.cmake | 22 ++- 4 files changed, 11 insertions(+), 339 deletions(-) delete mode 100644 config/cmake_ext_mod/parrunTest.cmake diff --git a/MANIFEST b/MANIFEST index 5ff8ce1..f54560a 100644 --- a/MANIFEST +++ b/MANIFEST @@ -3243,7 +3243,6 @@ ./config/cmake_ext_mod/NSIS.InstallOptions.ini.in ./config/cmake_ext_mod/NSIS.template.in ./config/cmake_ext_mod/runTest.cmake -./config/cmake_ext_mod/parrunTest.cmake ./config/cmake_ext_mod/version.plist.in # CMake-specific User Files diff --git a/config/cmake_ext_mod/parrunTest.cmake b/config/cmake_ext_mod/parrunTest.cmake deleted file mode 100644 index 8449448..0000000 --- a/config/cmake_ext_mod/parrunTest.cmake +++ /dev/null @@ -1,325 +0,0 @@ -# -# 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 COPYING file, which can be found at the root of the source code -# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. -# If you do not have access to either file, you may request a copy from -# help@hdfgroup.org. -# -# parrunTest.cmake executes a command using MPI and captures the output in a file. File is then compared -# against a reference file. Exit status of command can also be compared. -cmake_policy(SET CMP0007 NEW) - -# arguments checking -if (NOT TEST_PROGRAM) - message (FATAL_ERROR "Require TEST_PROGRAM to be defined") -endif () -if (NOT TEST_FOLDER) - message ( FATAL_ERROR "Require TEST_FOLDER to be defined") -endif () -if (NOT TEST_OUTPUT) - message (FATAL_ERROR "Require TEST_OUTPUT to be defined") -endif () -if (NOT TEST_EXPECT) - message (STATUS "Require TEST_EXPECT to be defined") -endif () - -if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}) - file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT}) -endif () - -if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err) - file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT}.err) -endif () - -message (STATUS "COMMAND: ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} ${TEST_PROGRAM} ${MPIEXEC_POSTFLAGS} ${TEST_ARGS}") - -if (TEST_LIBRARY_DIRECTORY) - if (WIN32 AND NOT MINGW) - set (ENV{PATH} "$ENV{PATH};${TEST_LIBRARY_DIRECTORY}") - else () - set (ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH}:${TEST_LIBRARY_DIRECTORY}") - endif () -endif () - -if (TEST_ENV_VAR) - set (ENV{${TEST_ENV_VAR}} "${TEST_ENV_VALUE}") - #message (STATUS "ENV:${TEST_ENV_VAR}=$ENV{${TEST_ENV_VAR}}") -endif () - -if (NOT TEST_INPUT) - # run the test program, capture the stdout/stderr and the result var - execute_process ( - COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} ${TEST_PROGRAM} ${MPIEXEC_POSTFLAGS} ${TEST_ARGS} - WORKING_DIRECTORY ${TEST_FOLDER} - RESULT_VARIABLE TEST_RESULT - OUTPUT_FILE ${TEST_OUTPUT} - ERROR_FILE ${TEST_OUTPUT}.err - OUTPUT_VARIABLE TEST_OUT - ERROR_VARIABLE TEST_ERROR - ) -else () - # run the test program with stdin, capture the stdout/stderr and the result var - execute_process ( - COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} ${TEST_PROGRAM} ${MPIEXEC_POSTFLAGS} ${TEST_ARGS} - WORKING_DIRECTORY ${TEST_FOLDER} - RESULT_VARIABLE TEST_RESULT - INPUT_FILE ${TEST_INPUT} - OUTPUT_FILE ${TEST_OUTPUT} - ERROR_FILE ${TEST_OUTPUT}.err - OUTPUT_VARIABLE TEST_OUT - ERROR_VARIABLE TEST_ERROR - ) -endif () - -if (TEST_REGEX) - # TEST_REGEX should always be matched - file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) - string (REGEX MATCH "${TEST_REGEX}" REGEX_MATCH ${TEST_STREAM}) - string (COMPARE EQUAL "${REGEX_MATCH}" "${TEST_MATCH}" REGEX_RESULT) - if (NOT REGEX_RESULT) - message (STATUS "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_MATCH}") - endif () -endif () - -message (STATUS "COMMAND Result: ${TEST_RESULT}") - -# if the .err file exists and ERRROR_APPEND is enabled -if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err) - file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM) - if (TEST_MASK_FILE) - STRING(REGEX REPLACE "CurrentDir is [^\n]+\n" "CurrentDir is (dir name)\n" TEST_STREAM "${TEST_STREAM}") - endif () - # remove special output - string (REGEX REPLACE "^.*_pmi_alps[^\n]+\n" "" TEST_STREAM "${TEST_STREAM}") - - if (NOT ERROR_APPEND) - # write back to original .err file - file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT}.err "${TEST_STREAM}") - else () - # append error output to the stdout output file - file (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") - endif () -endif () - -# append the test result status with a predefined text -if (TEST_APPEND) - file (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_APPEND} ${TEST_RESULT}\n") -endif () - -# if the return value is !=${TEST_EXPECT} bail out -if (NOT TEST_RESULT EQUAL TEST_EXPECT) - if (NOT TEST_NOERRDISPLAY) - if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}) - file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) - message (STATUS "Output :\n${TEST_STREAM}") - endif () - endif () - message (FATAL_ERROR "Failed: Test program ${TEST_PROGRAM} exited != ${TEST_EXPECT}.\n${TEST_ERROR}") -endif () - -message (STATUS "COMMAND Error: ${TEST_ERROR}") - -# remove special output -file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) -string (FIND TEST_STREAM "_pmi_alps" "${TEST_FIND_RESULT}") -if (TEST_FIND_RESULT GREATER 0) - string (REGEX REPLACE "^.*_pmi_alps[^\n]+\n" "" TEST_STREAM "${TEST_STREAM}") - file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_STREAM}) -endif () - -# if the output file needs Storage text removed -if (TEST_MASK) - file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) - string (REGEX REPLACE "Storage:[^\n]+\n" "Storage:
\n" TEST_STREAM "${TEST_STREAM}") - file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") -endif () - -# if the output file needs Modified text removed -if (TEST_MASK_MOD) - file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) - string (REGEX REPLACE "Modified:[^\n]+\n" "Modified: XXXX-XX-XX XX:XX:XX XXX\n" TEST_STREAM "${TEST_STREAM}") - file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") -endif () - -# if the output file or the .err file needs to mask out error stack info -if (TEST_MASK_ERROR) - if (NOT TEST_ERRREF) - # the error stack has been appended to the output file - file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) - else () - # the error stack remains in the .err file - file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM) - endif () - 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}") - # write back the changes to the original files - if (NOT TEST_ERRREF) - file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") - else () - file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT}.err "${TEST_STREAM}") - endif () -endif () - -# remove text from the output file -if (TEST_FILTER) - file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) - string (REGEX REPLACE "${TEST_FILTER}" "${TEST_FILTER_REPLACE}" TEST_STREAM "${TEST_STREAM}") - file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") -endif () - -if (TEST_REF_FILTER) - #message (STATUS "TEST_REF_FILTER: ${TEST_APPEND}${TEST_REF_FILTER}") - file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM) - STRING(REGEX REPLACE "${TEST_REF_APPEND}" "${TEST_REF_FILTER}" TEST_STREAM "${TEST_STREAM}") - file (WRITE ${TEST_FOLDER}/${TEST_REFERENCE} "${TEST_STREAM}") -endif () - -# compare output files to references unless this must be skipped -if (NOT TEST_SKIP_COMPARE) - if (EXISTS ${TEST_FOLDER}/${TEST_REFERENCE}) - if (WIN32 AND NOT MINGW) - file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM) - file (WRITE ${TEST_FOLDER}/${TEST_REFERENCE} "${TEST_STREAM}") - endif () - - if (NOT TEST_SORT_COMPARE) - # now compare the output with the reference - execute_process ( - COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_FOLDER}/${TEST_REFERENCE} - RESULT_VARIABLE TEST_RESULT - ) - else () - file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} v1) - file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} v2) - list (SORT v1) - list (SORT v2) - if (NOT v1 STREQUAL v2) - set(TEST_RESULT 1) - endif () - endif () - - if (TEST_RESULT) - set (TEST_RESULT 0) - file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act) - list (LENGTH test_act len_act) - file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} test_ref) - list (LENGTH test_ref len_ref) - if (len_act GREATER 0 AND len_ref GREATER 0) - math (EXPR _FP_LEN "${len_ref} - 1") - foreach (line RANGE 0 ${_FP_LEN}) - list (GET test_act ${line} str_act) - list (GET test_ref ${line} str_ref) - if (NOT ${str_act} STREQUAL ${str_ref}) - if (NOT str_act STREQUAL "") - set (TEST_RESULT 1) - message ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") - endif () - endif () - endforeach () - else () - if (len_act EQUAL 0) - message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT} is empty") - endif () - if (len_ref EQUAL 0) - message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_REFERENCE} is empty") - endif () - endif () - if (NOT len_act EQUAL len_ref) - set (TEST_RESULT 1) - endif () - endif () - - message (STATUS "COMPARE Result: ${TEST_RESULT}") - - # again, if return value is !=0 scream and shout - if (TEST_RESULT) - message (FATAL_ERROR "Failed: The output of ${TEST_OUTPUT} did not match ${TEST_REFERENCE}") - endif () - endif () - - # now compare the .err file with the error reference, if supplied - if (TEST_ERRREF) - if (WIN32 AND NOT MINGW) - file (READ ${TEST_FOLDER}/${TEST_ERRREF} TEST_STREAM) - file (WRITE ${TEST_FOLDER}/${TEST_ERRREF} "${TEST_STREAM}") - endif () - - # now compare the error output with the error reference - execute_process ( - COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT}.err ${TEST_FOLDER}/${TEST_ERRREF} - RESULT_VARIABLE TEST_RESULT - ) - if (TEST_RESULT) - set (TEST_RESULT 0) - file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT}.err test_act) - list (LENGTH test_act len_act) - file (STRINGS ${TEST_FOLDER}/${TEST_ERRREF} test_ref) - list (LENGTH test_ref len_ref) - math (EXPR _FP_LEN "${len_ref} - 1") - if (len_act GREATER 0 AND len_ref GREATER 0) - math (EXPR _FP_LEN "${len_ref} - 1") - foreach (line RANGE 0 ${_FP_LEN}) - list (GET test_act ${line} str_act) - list (GET test_ref ${line} str_ref) - if (NOT ${str_act} STREQUAL ${str_ref}) - if (NOT ${str_act} STREQUAL "") - set (TEST_RESULT 1) - message ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") - endif () - endif () - endforeach () - else () - if (len_act EQUAL 0) - message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT}.err is empty") - endif () - if (len_ref EQUAL 0) - message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_ERRREF} is empty") - endif () - endif () - if (NOT len_act EQUAL len_ref) - set (TEST_RESULT 1) - endif () - endif () - - message (STATUS "COMPARE Result: ${TEST_RESULT}") - - # again, if return value is !=0 scream and shout - if (TEST_RESULT) - message (FATAL_ERROR "Failed: The error output of ${TEST_OUTPUT}.err did not match ${TEST_ERRREF}") - endif () - endif () -endif () - -if (TEST_GREP_COMPARE) - # now grep the output with the reference - file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) - - # TEST_REFERENCE should always be matched - string (REGEX MATCH "${TEST_REFERENCE}" TEST_MATCH ${TEST_STREAM}) - string (COMPARE EQUAL "${TEST_REFERENCE}" "${TEST_MATCH}" TEST_RESULT) - if (NOT TEST_RESULT) - message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_REFERENCE}") - endif () - - string (REGEX MATCH "${TEST_FILTER}" TEST_MATCH ${TEST_STREAM}) - if (TEST_EXPECT) - # TEST_EXPECT (1) interperts TEST_FILTER as NOT to match - string (LENGTH "${TEST_MATCH}" TEST_RESULT) - if (TEST_RESULT) - message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did contain ${TEST_FILTER}") - endif () - endif () -endif () - -# everything went fine... -message ("${TEST_PROGRAM} Passed") - diff --git a/config/cmake_ext_mod/runTest.cmake b/config/cmake_ext_mod/runTest.cmake index e11852a..48402a2 100644 --- a/config/cmake_ext_mod/runTest.cmake +++ b/config/cmake_ext_mod/runTest.cmake @@ -312,7 +312,7 @@ if (TEST_GREP_COMPARE) string (REGEX MATCH "${TEST_FILTER}" TEST_MATCH ${TEST_STREAM}) if (TEST_EXPECT) - # TEST_EXPECT (1) interperts TEST_FILTER as NOT to match + # TEST_EXPECT (1) interprets TEST_FILTER as; NOT to match string (LENGTH "${TEST_MATCH}" TEST_RESULT) if (TEST_RESULT) message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did contain ${TEST_FILTER}") diff --git a/examples/CMakeTests.cmake b/examples/CMakeTests.cmake index 26babbb..dd1e03b 100644 --- a/examples/CMakeTests.cmake +++ b/examples/CMakeTests.cmake @@ -184,15 +184,14 @@ add_test (NAME EXAMPLES_PAR-ph5example COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $ ${MPIEXEC_POSTFLAGS}) else () add_test (NAME EXAMPLES_PAR-ph5example COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" + -D "TEST_PROGRAM=${MPIEXEC_EXECUTABLE};${MPIEXEC_NUMPROC_FLAG};${MPIEXEC_MAX_NUMPROCS};${MPIEXEC_PREFLAGS};$;${MPIEXEC_POSTFLAGS}" -D "TEST_ARGS:STRING=" -D "TEST_EXPECT=0" - -D "TEST_SKIP_COMPARE=TRUE" - #-D "TEST_SORT_COMPARE=TRUE" - -D "TEST_OUTPUT=ph5example.txt" - #-D "TEST_REFERENCE=ph5example.out" + -D "TEST_OUTPUT=ph5example.out" + -D "TEST_REFERENCE:STRING=PHDF5 tests finished with no errors" + -D "TEST_FILTER:STRING=PHDF5 tests finished with no errors" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -P "${HDF_RESOURCES_EXT_DIR}/parrunTest.cmake" + -P "${HDF_RESOURCES_EXT_DIR}/grepTest.cmake" ) endif () if (NOT "${last_test}" STREQUAL "") @@ -204,15 +203,14 @@ add_test (NAME EXAMPLES_PAR-shared-ph5example COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $ ${MPIEXEC_POSTFLAGS}) else () add_test (NAME EXAMPLES_PAR-shared-ph5example COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" + -D "TEST_PROGRAM=${MPIEXEC_EXECUTABLE};${MPIEXEC_NUMPROC_FLAG};${MPIEXEC_MAX_NUMPROCS};${MPIEXEC_PREFLAGS};$;${MPIEXEC_POSTFLAGS}" -D "TEST_ARGS:STRING=" -D "TEST_EXPECT=0" - -D "TEST_SKIP_COMPARE=TRUE" - #-D "TEST_SORT_COMPARE=TRUE" - -D "TEST_OUTPUT=ph5example-shared.txt" - #-D "TEST_REFERENCE=ph5example-shared.out" + -D "TEST_OUTPUT=ph5example-shared.out" + -D "TEST_REFERENCE:STRING=PHDF5 tests finished with no errors" + -D "TEST_FILTER:STRING=PHDF5 tests finished with no errors" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5EX-shared" - -P "${HDF_RESOURCES_EXT_DIR}/parrunTest.cmake" + -P "${HDF_RESOURCES_EXT_DIR}/grepTest.cmake" ) endif () set_tests_properties (EXAMPLES_PAR-shared-ph5example PROPERTIES WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/H5EX-shared) -- cgit v0.12 From ce64bf57ce149b94422e602a920439749d305a5b Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 22 Jan 2019 12:09:59 -0600 Subject: HDFFV-10685 Always set Mac version flags - use soversion --- config/cmake/HDF5Macros.cmake | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/config/cmake/HDF5Macros.cmake b/config/cmake/HDF5Macros.cmake index 6c203e2..3660453 100644 --- a/config/cmake/HDF5Macros.cmake +++ b/config/cmake/HDF5Macros.cmake @@ -26,6 +26,10 @@ macro (H5_SET_LIB_OPTIONS libtarget libname libtype libpackage) else () set_target_properties (${libtarget} PROPERTIES SOVERSION ${LIBHDF_VERSION}) endif () + if (CMAKE_C_OSX_CURRENT_VERSION_FLAG) + set_property(TARGET ${libtarget} APPEND PROPERTY + LINK_FLAGS "${CMAKE_C_OSX_CURRENT_VERSION_FLAG}${PACKAGE_SOVERSION} ${CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG}${LIBHDF_VERSION}.0.0" + endif () endif () HDF_SET_LIB_OPTIONS (${libtarget} ${LIB_OUT_NAME} ${libtype}) @@ -33,9 +37,6 @@ macro (H5_SET_LIB_OPTIONS libtarget libname libtype libpackage) if (APPLE) option (HDF5_BUILD_WITH_INSTALL_NAME "Build with library install_name set to the installation path" OFF) if (HDF5_BUILD_WITH_INSTALL_NAME) - set_property(TARGET ${libtarget} APPEND PROPERTY - LINK_FLAGS "-current_version ${HDF5_PACKAGE_VERSION} -compatibility_version ${HDF5_PACKAGE_VERSION}" - ) set_target_properties (${libtarget} PROPERTIES INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib" BUILD_WITH_INSTALL_RPATH ${HDF5_BUILD_WITH_INSTALL_NAME} -- cgit v0.12 From ff08bed26821e8c090031aea9fa1f647181f16ce Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 22 Jan 2019 12:29:45 -0600 Subject: HDFFV-10685 Corrected version --- config/cmake/HDF5Macros.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/config/cmake/HDF5Macros.cmake b/config/cmake/HDF5Macros.cmake index 3660453..df55bde 100644 --- a/config/cmake/HDF5Macros.cmake +++ b/config/cmake/HDF5Macros.cmake @@ -15,6 +15,8 @@ macro (H5_SET_LIB_OPTIONS libtarget libname libtype libpackage) # SOVERSION passed in ARGN when shared if (${libtype} MATCHES "SHARED") set (PACKAGE_SOVERSION ${HDF5_${libpackage}_PACKAGE_SOVERSION}) + set (PACKAGE_COMPATIBILITY ${H5_${libpackage}_SOVERS_INTERFACE}.0.0) + set (PACKAGE_CURRENT ${H5_${libpackage}_SOVERS_INTERFACE}.${H5_${libpackage}_SOVERS_MINOR}.0) if (WIN32) set (LIBHDF_VERSION ${HDF5_PACKAGE_VERSION_MAJOR}) else () @@ -28,7 +30,7 @@ macro (H5_SET_LIB_OPTIONS libtarget libname libtype libpackage) endif () if (CMAKE_C_OSX_CURRENT_VERSION_FLAG) set_property(TARGET ${libtarget} APPEND PROPERTY - LINK_FLAGS "${CMAKE_C_OSX_CURRENT_VERSION_FLAG}${PACKAGE_SOVERSION} ${CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG}${LIBHDF_VERSION}.0.0" + LINK_FLAGS "${CMAKE_C_OSX_CURRENT_VERSION_FLAG}${PACKAGE_CURRENT} ${CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG}${PACKAGE_COMPATIBILITY}" endif () endif () HDF_SET_LIB_OPTIONS (${libtarget} ${LIB_OUT_NAME} ${libtype}) -- cgit v0.12 From 91249b9ad5172f768c120c069cdc9e6b484c11aa Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 22 Jan 2019 12:54:34 -0600 Subject: HDFFV-10685 Correct syntax --- config/cmake/HDF5Macros.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/config/cmake/HDF5Macros.cmake b/config/cmake/HDF5Macros.cmake index df55bde..007bc29 100644 --- a/config/cmake/HDF5Macros.cmake +++ b/config/cmake/HDF5Macros.cmake @@ -31,6 +31,7 @@ macro (H5_SET_LIB_OPTIONS libtarget libname libtype libpackage) if (CMAKE_C_OSX_CURRENT_VERSION_FLAG) set_property(TARGET ${libtarget} APPEND PROPERTY LINK_FLAGS "${CMAKE_C_OSX_CURRENT_VERSION_FLAG}${PACKAGE_CURRENT} ${CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG}${PACKAGE_COMPATIBILITY}" + ) endif () endif () HDF_SET_LIB_OPTIONS (${libtarget} ${LIB_OUT_NAME} ${libtype}) -- cgit v0.12 From cdf9cb0efb31e36df080ee2f1f14453181574901 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 22 Jan 2019 15:38:32 -0600 Subject: Cleanup variable names --- config/cmake/HDF5UseFortran.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/cmake/HDF5UseFortran.cmake b/config/cmake/HDF5UseFortran.cmake index a24b2e1..6b77ca4 100644 --- a/config/cmake/HDF5UseFortran.cmake +++ b/config/cmake/HDF5UseFortran.cmake @@ -57,8 +57,8 @@ endmacro () # Read source line beginning at the line matching Input:"START" and ending at the line matching Input:"END" macro (READ_SOURCE SOURCE_START SOURCE_END RETURN_VAR) - file (READ "${HDF5_SOURCE_DIR}/m4/aclocal_fc.f90" SOURCE_CODE) - string (REGEX MATCH "${SOURCE_START}[\\\t\\\n\\\r[].+]*${SOURCE_END}" SOURCE_CODE ${SOURCE_CODE}) + file (READ "${HDF5_SOURCE_DIR}/m4/aclocal_fc.f90" SOURCE_MASTER) + string (REGEX MATCH "${SOURCE_START}[\\\t\\\n\\\r[].+]*${SOURCE_END}" SOURCE_CODE ${SOURCE_MASTER}) set (RETURN_VAR "${SOURCE_CODE}") endmacro () -- cgit v0.12 From 036a8e4fe11d1a4aa65cace7efb7d6358a2866c6 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 22 Jan 2019 16:18:22 -0600 Subject: Add new clear tests to ignore list --- config/cmake/CTestCustom.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/config/cmake/CTestCustom.cmake b/config/cmake/CTestCustom.cmake index 33e6d4c..424c8bc 100644 --- a/config/cmake/CTestCustom.cmake +++ b/config/cmake/CTestCustom.cmake @@ -307,6 +307,11 @@ set (CTEST_CUSTOM_MEMCHECK_IGNORE H5REPACK_VERIFY_LAYOUT_ALL-layout_short_switches #uses grepTest.cmake H5REPACK-plugin H5REPACK_CMP-plugin_zero + ######### + ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-latest_latest_invalid-clear-objects + H5REPACK_VERIFY_SUPERBLOCK-SB_IS_0-clear-objects + H5REPACK_VERIFY_SUPERBLOCK-SB_IS_2-clear-objects + H5REPACK_VERIFY_SUPERBLOCK-SB_IS_3-clear-objects ######### tools/h5stat ######### H5STAT-clearall-objects ######### tools/misc ######### -- cgit v0.12 From 182e5f7556dee5a6647e1cb386edb9c81c78d083 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 22 Jan 2019 16:26:43 -0600 Subject: Add clear objects to ignore tests --- config/cmake/CTestCustom.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/config/cmake/CTestCustom.cmake b/config/cmake/CTestCustom.cmake index 424c8bc..f3600f0 100644 --- a/config/cmake/CTestCustom.cmake +++ b/config/cmake/CTestCustom.cmake @@ -41,16 +41,20 @@ set (CTEST_CUSTOM_MEMCHECK_IGNORE H5TEST-err_compat #uses runTest.cmake H5TEST-links_env #uses runTest.cmake H5TEST-testlibinfo #uses grepTest.cmake - H5TEST-clear-testhdf5-objects H5TEST-clear-objects + ######### H5TEST-clear-cache-objects H5TEST-clear-cache_api-objects H5TEST-clear-cache_image-objects H5TEST-clear-cache_tagging-objects + H5TEST-clear-del_many_dense_attrs-objects H5TEST-clear-err_compat-objects H5TEST-clear-error_test-objects H5TEST-clear-filenotclosed-objects + H5TEST-clear-flush-objects H5TEST-clear-links_env-objects + H5TEST-clear-testflushrefresh-objects + H5TEST-clear-testhdf5-objects H5TEST-clear-ttsafe-objects PERFORM_h5perform-clear-objects HL_TOOLS-clear-objects -- cgit v0.12 From f033214796c383a9018dd760e92257dc27d7b852 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 22 Jan 2019 16:30:37 -0600 Subject: Add clear objects to ignore tests --- config/cmake/CTestCustom.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/cmake/CTestCustom.cmake b/config/cmake/CTestCustom.cmake index f3600f0..27eaa56 100644 --- a/config/cmake/CTestCustom.cmake +++ b/config/cmake/CTestCustom.cmake @@ -41,8 +41,8 @@ set (CTEST_CUSTOM_MEMCHECK_IGNORE H5TEST-err_compat #uses runTest.cmake H5TEST-links_env #uses runTest.cmake H5TEST-testlibinfo #uses grepTest.cmake - H5TEST-clear-objects ######### + H5TEST-clear-objects H5TEST-clear-cache-objects H5TEST-clear-cache_api-objects H5TEST-clear-cache_image-objects -- cgit v0.12