Skip to content

Commit

Permalink
Convert vds swmr test script to powershell (#1245)
Browse files Browse the repository at this point in the history
* Convert SWMR shell scripts to Windows powershell.

* Use $LastExitCode instead of $? in script

* Prevent execution in a different window

* Github #969 Use stdout instead of file for configure check (#1089)

* Use stdout instead of file for configure check

* Make change requested by #1157

* Change fortran to use stderr for configure

* Correct typo

* remove obsolete file check

* Fortran statement fix

* Don't allow H5Pset(get)_all_coll_metadata_ops for DXPLs (#1201)

* Fixes const warnings in H5ES package (#1211)

* Quiets a 'set but not used' warning in h5diff_array.c (#1210)

* Convert vds swmr test script to powershell

* Enable vdsswmr powershell test

* Add configure vdsswmr statement

* Correct powershell script vars

* Convert SWMR shell scripts to Windows powershell.

* Use $LastExitCode instead of $? in script

* Prevent execution in a different window

* Github #969 Use stdout instead of file for configure check (#1089)

* Use stdout instead of file for configure check

* Make change requested by #1157

* Change fortran to use stderr for configure

* Correct typo

* remove obsolete file check

* Fortran statement fix

* Convert vds swmr test script to powershell

* Enable vdsswmr powershell test

* Add configure vdsswmr statement

* Correct powershell script vars

* Cleanup review issues

* Fix variable assignment

* Change the wait function to pass in the path

* Disable actual test execution until programs fixed

* Adjust copyright text

* Fix spelling

Co-authored-by: jhendersonHDF <jhenderson@hdfgroup.org>
Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com>
  • Loading branch information
3 people authored Dec 8, 2021
1 parent abb05bc commit 83cf2cb
Show file tree
Hide file tree
Showing 5 changed files with 781 additions and 13 deletions.
2 changes: 2 additions & 0 deletions MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -1352,8 +1352,10 @@
./test/testlinks_env.sh.in
./test/testmeta.c
./test/test_mirror.sh.in
./test/testswmr.pwsh.in
./test/testswmr.sh.in
./test/testvds_env.sh.in
./test/testvdsswmr.pwsh.in
./test/testvdsswmr.sh.in
./test/tfile.c
./test/tgenprop.c
Expand Down
10 changes: 10 additions & 0 deletions release_docs/RELEASE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,16 @@ New Features

Configuration:
-------------
- CMake will now run the PowerShell script tests in test/ by default
on Windows.

The test directory includes several shell script tests that previously
were not run by CMake on Windows. These are now run by default.
If TEST_SHELL_SCRIPTS is ON and PWSH is found, the PowerShell scripts
will execute. Similar to the bash scripts on unix platforms.

(ADB - 2021/11/23)

- Added new configure option to support building parallel tools.
See Tools below (autotools - CMake):
--enable-parallel-tools HDF5_BUILD_PARALLEL_TOOLS
Expand Down
36 changes: 23 additions & 13 deletions test/ShellTests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,30 @@
### T E S T I N G S H E L L S C R I P T S ###
##############################################################################

if (UNIX)
find_program (PWSH NAMES pwsh powershell)
if (PWSH)
file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST/usecases_test")
file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST/swmr_test")
file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST/vds_swmr_test")

set (srcdir ${HDF5_TEST_SOURCE_DIR})
set (bindir ${CMAKE_TEST_OUTPUT_DIRECTORY})
set (testdir ${HDF5_TEST_BINARY_DIR}/H5TEST)
configure_file(${HDF5_TEST_SOURCE_DIR}/testswmr.pwsh.in ${HDF5_TEST_BINARY_DIR}/H5TEST/testswmr.ps1 @ONLY)
# test commented out as currently the programs are not allowing another access to the data file
#add_test (H5SHELL-testswmr ${PWSH} ${HDF5_TEST_BINARY_DIR}/H5TEST/testswmr.ps1)
#set_tests_properties (H5SHELL-testswmr PROPERTIES
# ENVIRONMENT "PATH=$ENV{PATH}:${CMAKE_RUNTIME_OUTPUT_DIRECTORY}"
# WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
#)
configure_file(${HDF5_TEST_SOURCE_DIR}/testvdsswmr.pwsh.in ${HDF5_TEST_BINARY_DIR}/H5TEST/testvdsswmr.ps1 @ONLY)
# test commented out as currently the programs are not allowing another access to the data file
#add_test (H5SHELL-testvdsswmr ${PWSH} ${HDF5_TEST_BINARY_DIR}/H5TEST/testvdsswmr.ps1)
#set_tests_properties (H5SHELL-testvdsswmr PROPERTIES
# ENVIRONMENT "LD_LIBRARY_PATH=$ENV{LD_LIBRARY_PATH}:${CMAKE_RUNTIME_OUTPUT_DIRECTORY}"
# WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
#)
elseif (UNIX)
find_program (SH_PROGRAM bash)
if (SH_PROGRAM)
set (srcdir ${HDF5_TEST_SOURCE_DIR})
Expand All @@ -35,24 +57,13 @@ if (UNIX)
##############################################################################
# copy test programs to test dir
##############################################################################
#shell script creates dir
#file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST/swmr_test")
add_custom_command (
TARGET accum_swmr_reader
POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -E copy_if_different "${HDF5_SOURCE_DIR}/bin/output_filter.sh" "${HDF5_TEST_BINARY_DIR}/H5TEST/bin/output_filter.sh"
)

#shell script creates dir
#file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST/usecases_test")

#shell script creates dir
#file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST/swmr_test")

#shell script creates dir
#file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST/vds_swmr_test")

##############################################################################
##############################################################################
### A D D I T I O N A L T E S T S ###
Expand Down Expand Up @@ -108,6 +119,5 @@ if (UNIX)
ENVIRONMENT "LD_LIBRARY_PATH=$ENV{LD_LIBRARY_PATH}:${CMAKE_RUNTIME_OUTPUT_DIRECTORY}"
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
)

endif ()
endif ()
Loading

0 comments on commit 83cf2cb

Please sign in to comment.