Skip to content

Commit cdcb104

Browse files
committed
ctest_test more robust
1 parent 4009f59 commit cdcb104

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
sudo apt update -yq
2626
sudo apt install -yq --no-install-recommends ninja-build gfortran libhdf5-dev
2727
28-
- run: ctest -S setup.cmake -V
28+
- run: ctest -S ci.cmake -V
2929

3030
- run: cmake -DCMAKE_INSTALL_PREFIX=~/hdf5
3131
- run: cmake --install build
@@ -98,7 +98,7 @@ jobs:
9898

9999
- run: brew install hdf5 ninja
100100

101-
- run: ctest -S setup.cmake -V
101+
- run: ctest -S ci.cmake -V
102102

103103
# - run: cmake -S Examples -B Examples/build
104104
# - run: cmake --build Examples/build --parallel

.github/workflows/ci_windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
4949
- uses: actions/checkout@v2
5050

51-
- run: ctest -S setup.cmake -V
51+
- run: ctest -S ci.cmake -V
5252

5353
# - run: cmake -S Examples -B Examples/build
5454
# - run: cmake --build Examples/build --parallel

Install.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,10 @@ gfortran -I~/lib/h5fortran/include myprogram.f90 ~/lib/h5fortran/lib/libh5fortra
8989

9090
### [optional] create distributable archive
9191

92-
If you wish to create a .zip archive that is usable on systems with compatible Fortran ABI:
92+
If you wish to create a .zip archive that is usable on systems with compatible Fortran ABI, after building:
9393

9494
```sh
95-
ctest -S setup.cmake
96-
97-
cd build
98-
99-
cpack
95+
cpack --config .\build\CPackConfig.cmake
10096
```
10197

10298
### [optional] specify a particular HDF5 library

setup.cmake renamed to ci.cmake

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,17 +152,21 @@ endif()
152152
ctest_test(
153153
# set PARALLEL_LEVEL here as the global option seems to be ignored
154154
PARALLEL_LEVEL ${Ncpu}
155+
# specify BUILD to avoid random return 255 despite tests passing
156+
BUILD ${CTEST_BINARY_DIRECTORY}
157+
SCHEDULE_RANDOM ON
158+
REPEAT UNTIL_PASS:3
155159
RETURN_VALUE _ret
156160
CAPTURE_CMAKE_ERROR _err
157-
REPEAT UNTIL_PASS:3)
161+
)
158162
ctest_submit(PARTS Test)
159163

160164
ctest_submit(
161165
PARTS Done
162166
BUILD_ID build_id)
163167

164168
if(NOT (_ret EQUAL 0 AND _err EQUAL 0))
165-
message(FATAL_ERROR "Build ${build_id} failed.")
169+
message(FATAL_ERROR "Build ${build_id} failed: CTest code ${_ret}, CMake code ${_err}.")
166170
endif()
167171

168172
message(STATUS "OK: CTest build ${build_id}")

0 commit comments

Comments
 (0)