MRtrix3 / mrtrix3

MRtrix3 provides a set of tools to perform various advanced diffusion MRI analyses, including constrained spherical deconvolution (CSD), probabilistic tractography, track-density imaging, and apparent fibre density
http://www.mrtrix.org
Mozilla Public License 2.0
294 stars 181 forks source link

dirrotate: Test using awk rather than bc #3014

Closed Lestropie closed 1 month ago

Lestropie commented 1 month ago

Should fix issue reported in #3012. Seems to be some kind of race condition in the BASH [[ ]] / [ ] implementation, where sometimes the "1" yielded by bc would be invoked as a command name. But it was inconsistent. And running the script manually rather than via ctest would never fault. So kinda weird. I've verified that this is indeed testing for expected behaviour by flipping the inequality test.

Lestropie commented 1 month ago

Ie. This line of the test:

[[ $(echo "${b} < ${a}" | bc) -eq 1 ]]

Would yield:

(standard_in) 1: syntax error
CMake Error at /home/runner/work/mrtrix3/mrtrix3/cmake/RunTest.cmake:17 (message):
  Test
  /home/runner/work/mrtrix3/mrtrix3/testing/binaries/tests/dirrotate/default
  failed!
github-actions[bot] commented 1 month ago

clang-tidy review says "All clean, LGTM! :+1:"