diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2020-02-03 19:45:14 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2020-02-03 19:45:14 (GMT) |
commit | 00d68851fcd1dbfcd70966bfaff22085de9b1634 (patch) | |
tree | 0355a9405cd84bc590c7edf707fb4ca650b9ef9f /java | |
parent | 0147d2493eed235ba31077a6da38608ce2fe152a (diff) | |
download | hdf5-00d68851fcd1dbfcd70966bfaff22085de9b1634.zip hdf5-00d68851fcd1dbfcd70966bfaff22085de9b1634.tar.gz hdf5-00d68851fcd1dbfcd70966bfaff22085de9b1634.tar.bz2 |
HDFFV-10996 - add java vol tests
Diffstat (limited to 'java')
-rw-r--r-- | java/test/CMakeLists.txt | 79 | ||||
-rw-r--r-- | java/test/Makefile.am | 5 |
2 files changed, 84 insertions, 0 deletions
diff --git a/java/test/CMakeLists.txt b/java/test/CMakeLists.txt index de7dc62..6275227 100644 --- a/java/test/CMakeLists.txt +++ b/java/test/CMakeLists.txt @@ -142,4 +142,83 @@ if (HDF5_TEST_JAVA AND HDF5_TEST_SERIAL) DEPENDS "JUnit-${test_file}-clearall-objects" ) endforeach () + + + ############################################################################## + ############################################################################## + ### V O L T E S T S ### + ############################################################################## + ############################################################################## + + macro (DO_VOL_TEST voltest volname volinfo volclasspath) + #message(STATUS "${voltest}-${volname} with ${volinfo}") + add_test ( + NAME JUnit-VOL-${volname}-${voltest}-clearall-objects + COMMAND ${CMAKE_COMMAND} -E remove + JUnit-VOL-${volname}-${voltest}.out + JUnit-VOL-${volname}-${voltest}.out.err + WORKING_DIRECTORY ${HDF5_BINARY_DIR}/java/test/${volname} + ) + add_test (NAME JUnit-VOL-${volname}-${voltest} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_TESTER=${CMAKE_Java_RUNTIME};${CMAKE_Java_RUNTIME_FLAGS}" + -D "TEST_CLASSPATH:STRING=${volclasspath}" + -D "TEST_ARGS:STRING=${CMD_ARGS}-ea;org.junit.runner.JUnitCore" + -D "TEST_PROGRAM=test.${voltest}" + -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_OUTPUT_DIRECTORY}" + -D "TEST_FOLDER=${HDF5_BINARY_DIR}/java/test/${volname}" + -D "TEST_VOL:STRING=${volinfo}" + -D "TEST_OUTPUT=JUnit-VOL-${volname}-${voltest}.out" +# -D "TEST_LOG_LEVEL=trace" + -D "TEST_EXPECT=0" + -D "SKIP_APPEND=1" + -D "TEST_MASK_ERROR=TRUE" +# -D "TEST_FILTER:STRING=${testfilter}" + -D "TEST_REFERENCE=JUnit-${volname}-${voltest}.txt" + -P "${HDF_RESOURCES_DIR}/jvolTest.cmake" + ) + set_tests_properties (JUnit-VOL-${volname}-${voltest} PROPERTIES + ENVIRONMENT "HDF5_PLUGIN_PATH=${CMAKE_BINARY_DIR}/testdir2" + DEPENDS "JUnit-VOL-${volname}-${voltest}-clearall-objects" + WORKING_DIRECTORY ${HDF5_BINARY_DIR}/java/test/${volname} + ) + endmacro () + + if (HDF5_TEST_PASSTHROUGH_VOL) + set (VOL_LIST + vol_native + vol_pass_through1 + vol_pass_through2 + ) + + set (vol_native native) + set (vol_pass_through1 "pass_through under_vol=0\;under_info={}") + set (vol_pass_through2 "pass_through under_vol=505\;under_info={under_vol=0\;under_info={}}") + + foreach (voltest ${VOL_LIST}) + file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${voltest}") + foreach (h5_file ${HDF5_JAVA_TEST_SOURCES}) + HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/testfiles/JUnit-${h5_file}.txt" "${PROJECT_BINARY_DIR}/${voltest}/JUnit-${h5_file}.txt" "${HDF5_JAVA_TEST_LIB_TARGET}_${voltest}_files") + endforeach () + + HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/h5ex_g_iterate.orig" "${PROJECT_BINARY_DIR}/${voltest}/h5ex_g_iterate.hdf" "${HDF5_JAVA_TEST_LIB_TARGET}_${voltest}_files") + HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/h5ex_g_iterate.orig" "${PROJECT_BINARY_DIR}/${voltest}/h5ex_g_iterateL1.hdf" "${HDF5_JAVA_TEST_LIB_TARGET}_${voltest}_files") + HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/h5ex_g_iterate.orig" "${PROJECT_BINARY_DIR}/${voltest}/h5ex_g_iterateL2.hdf" "${HDF5_JAVA_TEST_LIB_TARGET}_${voltest}_files") + HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/h5ex_g_iterate.orig" "${PROJECT_BINARY_DIR}/${voltest}/h5ex_g_iterateO1.hdf" "${HDF5_JAVA_TEST_LIB_TARGET}_${voltest}_files") + HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/h5ex_g_iterate.orig" "${PROJECT_BINARY_DIR}/${voltest}/h5ex_g_iterateO2.hdf" "${HDF5_JAVA_TEST_LIB_TARGET}_${voltest}_files") + + add_custom_target(${HDF5_JAVA_TEST_LIB_TARGET}_${voltest}_files ALL COMMENT "Copying files needed by ${HDF5_JAVA_TEST_LIB_TARGET} tests" DEPENDS ${${HDF5_JAVA_TEST_LIB_TARGET}_${voltest}_files_list}) + + foreach (volinfo IN LISTS ${voltest}) + foreach (h5_file ${HDF5_JAVA_TEST_SOURCES}) + set (CMAKE_JAVA_CLASSPATH ".") + foreach (CMAKE_INCLUDE_PATH ${CMAKE_JAVA_INCLUDE_PATH}) + set (CMAKE_JAVA_CLASSPATH "${CMAKE_JAVA_CLASSPATH}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${CMAKE_INCLUDE_PATH}") + endforeach () + set (CMAKE_JAVA_CLASSPATH "${CMAKE_JAVA_CLASSPATH}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${${HDF5_JAVA_TEST_LIB_TARGET}_${h5_file}_JAR_FILE}") + DO_VOL_TEST (${h5_file} ${voltest} "${volinfo}" ${CMAKE_JAVA_CLASSPATH}) + endforeach () + endforeach () + endforeach () + endif () endif () diff --git a/java/test/Makefile.am b/java/test/Makefile.am index c375938..3f11933 100644 --- a/java/test/Makefile.am +++ b/java/test/Makefile.am @@ -84,6 +84,11 @@ noinst_DATA = $(jarfile) .PHONY: classes +# Test with just the native connector, with a single pass-through connector +# and with a doubly-stacked pass-through. +VOL_LIST = native "pass_through under_vol=0;under_info={}" \ + "pass_through under_vol=505;under_info={under_vol=0;under_info={}}" + check_SCRIPTS = junit.sh TEST_SCRIPT = $(check_SCRIPTS) |