Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dirrotate: Test using awk rather than bc #3014

Merged
merged 1 commit into from
Oct 2, 2024
Merged

Conversation

Lestropie
Copy link
Member

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.

Follows on from ec79132 in #3008.
Should resolve issue reported in #3012.
@Lestropie Lestropie self-assigned this Oct 2, 2024
@Lestropie
Copy link
Member Author

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!

Copy link

github-actions bot commented Oct 2, 2024

clang-tidy review says "All clean, LGTM! 👍"

@Lestropie Lestropie merged commit 996ecf4 into dev Oct 2, 2024
6 checks passed
@Lestropie Lestropie deleted the dirrotate_test_fix_take2 branch October 2, 2024 00:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant