From f5a1b2be45fba166675a8881366d4736a10b7abd Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Tue, 2 Jun 2026 00:30:07 +1000 Subject: [PATCH 1/2] Serve tests with filesystem locking and audit lock-free tests Introduce serialisation for Bash tests that create and delete temporary files, preventing parallel test runs from interfering with one another. Tests now acquire a RESOURCE_LOCK and a filesystem-level lock keyed to their shared test-data root directory, with separate resources for the C++ and Python command test trees. A NO_FILESYSTEM_LOCK opt-out keyword lets developers exempt tests that never write to disk. Following this, every Bash test for the C++ and Python commands was audited for use of the rm command or the -force option, and the 217 tests using neither were annotated with NO_FILESYSTEM_LOCK in their CMakeLists.txt entries. Session prompts: 1. > Many tests of C++ and Python commands involve the erase or > overwriting of temporary files and directories that commence with > the name "tmp*". Such filesystem contents are deleted before the > execution of each Bash test. If however multiple such tests are > executed in parallel, whether within a single ctest invocation or > in multiple invocations across instances, these tests will > interfere with one another. > 1. Set property RESOURCE_LOCK for all Bash tests. There should be > one resource for each unique directory from which such tests > can be executed: one for C++ commands and one for Python > commands (as they execute from different test data root > directories and hence their temporary filesystem contents do > not clash); investigate whether another should be added for UI > or unit tests. > 2. Over and above this, add to the machinery that executes each > test a filesystem-level lock that precludes the execution of > multiple tests from the same root directory. > 3. Add an option for add_bash_test that allows one on a per-test > basis to explicitly bypass these mechanisms if the developer > explicitly flags that that particular test does not write to > the filesystem. 2. > Perform an audit of all bash test files responsible for > evaluating C++ and Python command files. For each test, check for > the presence of the use of unix command "rm", or use of the > MRtrix3 command-line option "-force". If neither is found, then > attach the property NO_FILESYSTEM_LOCK to the corresponding test > in the relevant CMakeLists.txt file. Generated-by: Claude Opus 4.8 (1M context) --- .gitignore | 1 + cmake/BashTests.cmake | 41 ++- cmake/RunTest.cmake | 23 +- testing/binaries/CMakeLists.txt | 434 ++++++++++++----------- testing/integration_tests/CMakeLists.txt | 8 + testing/scripts/CMakeLists.txt | 32 +- testing/ui_tests/CMakeLists.txt | 8 + testing/unit_tests/CMakeLists.txt | 8 + 8 files changed, 320 insertions(+), 235 deletions(-) diff --git a/.gitignore b/.gitignore index fa5c6c6fcd..0f9259440e 100644 --- a/.gitignore +++ b/.gitignore @@ -37,3 +37,4 @@ CMakeLists.txt.user CMakeUserPresets.json testing/data/tmp* testing/data/*-tmp-* +testing/data/.mrtrix_testing.lock diff --git a/cmake/BashTests.cmake b/cmake/BashTests.cmake index 573c801a01..5902bf52f8 100644 --- a/cmake/BashTests.cmake +++ b/cmake/BashTests.cmake @@ -6,11 +6,12 @@ function(add_bash_test) message(FATAL_ERROR "bash not found") endif() + set(options NO_FILESYSTEM_LOCK) set(singleValueArgs FILE_PATH PREFIX WORKING_DIRECTORY ENVIRONMENT) set(multiValueArgs EXEC_DIRECTORIES LABELS) cmake_parse_arguments( ARG - "" + "${options}" "${singleValueArgs}" "${multiValueArgs}" ${ARGN} @@ -34,22 +35,50 @@ function(add_bash_test) string(REPLACE ";" ":" exec_directories "${exec_directories}") - set(cleanup_cmd "rm -rf ${working_directory}/tmp* ${working_directory}/*-tmp-*") + # Bash tests sharing a working directory write, overwrite and delete temporary + # filesystem content prefixed "tmp"; running two such tests concurrently lets + # one test's cleanup clobber another's in-flight temporaries. + # Tests are serialised per working directory by two complementary mechanisms: + # - the CTest RESOURCE_LOCK property (within a single ctest invocation), and + # - a filesystem-level lock in RunTest.cmake (across invocations/instances). + # A test that the developer certifies never writes to the filesystem can opt + # out of both via NO_FILESYSTEM_LOCK, leaving it free to run in parallel. + set(run_test_args + -D BASH=${BASH} + -D FILE_PATH=${file_path} + -D WORKING_DIRECTORY=${working_directory} + ) + if(NOT ARG_NO_FILESYSTEM_LOCK) + # The lock file lives inside the guarded directory itself, so every test + # sharing that directory (including across build trees that share it) + # agrees on the same lock; its fixed name avoids the "tmp" cleanup glob. + set(cleanup_cmd "rm -rf ${working_directory}/tmp* ${working_directory}/*-tmp-*") + set(lock_file "${working_directory}/.mrtrix_testing.lock") + list(APPEND run_test_args + -D CLEANUP_CMD=${cleanup_cmd} + -D LOCKFILE=${lock_file} + ) + endif() add_test( NAME ${test_name} COMMAND ${CMAKE_COMMAND} - -D BASH=${BASH} - -D FILE_PATH=${file_path} - -D CLEANUP_CMD=${cleanup_cmd} - -D WORKING_DIRECTORY=${working_directory} + ${run_test_args} -P ${PROJECT_SOURCE_DIR}/cmake/RunTest.cmake ) set_tests_properties(${test_name} PROPERTIES ENVIRONMENT "PATH=${exec_directories};${environment}" ) + if(NOT ARG_NO_FILESYSTEM_LOCK) + # One resource per unique working directory: tests holding the same lock + # string are never scheduled concurrently by a single ctest invocation. + set_tests_properties(${test_name} + PROPERTIES + RESOURCE_LOCK "${working_directory}" + ) + endif() if(labels) set_tests_properties(${test_name} PROPERTIES LABELS "${labels}") endif() diff --git a/cmake/RunTest.cmake b/cmake/RunTest.cmake index 2157452bf0..3cebdbdad5 100644 --- a/cmake/RunTest.cmake +++ b/cmake/RunTest.cmake @@ -1,15 +1,30 @@ # This script can be invoked by calling ${CMAKE_COMMAND} -P .cmake # Runs a bash test described by the FILE_PATH variable # The test is run in the WORKING_DIRECTORY directory -# The CLEANUP_CMD command is run after the test is finished +# The CLEANUP_CMD command, if provided, is run after the test is finished +# If LOCKFILE is provided, an exclusive filesystem-level lock is held across both +# the test and its cleanup, serialising tests that share a working directory even +# across separate ctest invocations or instances. The lock is released +# automatically when this process exits (including on crash), so a failed test +# cannot deadlock subsequent runs. + +if(DEFINED LOCKFILE AND NOT LOCKFILE STREQUAL "") + # file(LOCK) yields "0" on success or an error message otherwise. + file(LOCK ${LOCKFILE} GUARD PROCESS RESULT_VARIABLE lock_result) + if(NOT lock_result STREQUAL "0") + message(FATAL_ERROR "Failed to acquire test lock ${LOCKFILE}: ${lock_result}") + endif() +endif() execute_process(COMMAND ${BASH} -e ${FILE_PATH} RESULT_VARIABLE test_result_${FILE_PATH} WORKING_DIRECTORY ${WORKING_DIRECTORY} ) -execute_process(COMMAND ${BASH} -c ${CLEANUP_CMD} - WORKING_DIRECTORY ${WORKING_DIRECTORY} -) +if(DEFINED CLEANUP_CMD AND NOT CLEANUP_CMD STREQUAL "") + execute_process(COMMAND ${BASH} -c ${CLEANUP_CMD} + WORKING_DIRECTORY ${WORKING_DIRECTORY} + ) +endif() if(test_result_${FILE_PATH} EQUAL 0) message(STATUS "Test ${FILE_PATH} passed") diff --git a/testing/binaries/CMakeLists.txt b/testing/binaries/CMakeLists.txt index a74965d868..e147f708bc 100644 --- a/testing/binaries/CMakeLists.txt +++ b/testing/binaries/CMakeLists.txt @@ -9,9 +9,16 @@ dirs_to_unix(EXEC_DIRS "${EXEC_DIRS}") include(BashTests) function(add_bash_binary_test file_path) + # Extra arguments are labels, except for the NO_FILESYSTEM_LOCK opt-out keyword + # which is forwarded to add_bash_test for tests that never write to disk. set(extra_labels "") - foreach(label ${ARGN}) - list(APPEND extra_labels ${label}) + set(no_filesystem_lock "") + foreach(arg ${ARGN}) + if(arg STREQUAL "NO_FILESYSTEM_LOCK") + set(no_filesystem_lock NO_FILESYSTEM_LOCK) + else() + list(APPEND extra_labels ${arg}) + endif() endforeach() # Set folder name @@ -24,12 +31,13 @@ function(add_bash_binary_test file_path) WORKING_DIRECTORY ${BINARY_DATA_DIR} EXEC_DIRECTORIES "${EXEC_DIRS}" LABELS "binary;${folder_name};${extra_labels}" + ${no_filesystem_lock} ) endfunction() -add_bash_binary_test(5tt2gmwmi/default) +add_bash_binary_test(5tt2gmwmi/default NO_FILESYSTEM_LOCK) -add_bash_binary_test(5tt2vis/default) +add_bash_binary_test(5tt2vis/default NO_FILESYSTEM_LOCK) add_bash_binary_test(5ttedit/onetissue) add_bash_binary_test(5ttedit/twotissues) @@ -47,18 +55,18 @@ add_bash_binary_test(5ttvalidate/voxels_single_warns) add_bash_binary_test(5ttvalidate/wrong_dimensionality) add_bash_binary_test(5ttvalidate/wrong_volumes) -add_bash_binary_test(amp2sh/default) +add_bash_binary_test(amp2sh/default NO_FILESYSTEM_LOCK) -add_bash_binary_test(connectomeedit/lower_triangular_from_asymmetric) +add_bash_binary_test(connectomeedit/lower_triangular_from_asymmetric NO_FILESYSTEM_LOCK) add_bash_binary_test(connectomeedit/lower_triangular_from_lower_triangular) add_bash_binary_test(connectomeedit/lower_triangular_from_symmetric) add_bash_binary_test(connectomeedit/lower_triangular_from_upper_triangular) -add_bash_binary_test(connectomeedit/symmetric_from_asymmetric) +add_bash_binary_test(connectomeedit/symmetric_from_asymmetric NO_FILESYSTEM_LOCK) add_bash_binary_test(connectomeedit/symmetric_from_lower_triangular) add_bash_binary_test(connectomeedit/symmetric_from_symmetric) add_bash_binary_test(connectomeedit/symmetric_from_upper_triangular) add_bash_binary_test(connectomeedit/transpose) -add_bash_binary_test(connectomeedit/upper_triangular_from_asymmetric) +add_bash_binary_test(connectomeedit/upper_triangular_from_asymmetric NO_FILESYSTEM_LOCK) add_bash_binary_test(connectomeedit/upper_triangular_from_lower_triangular) add_bash_binary_test(connectomeedit/upper_triangular_from_symmetric) add_bash_binary_test(connectomeedit/upper_triangular_from_upper_triangular) @@ -99,63 +107,63 @@ add_bash_binary_test(dwi2adc/default) add_bash_binary_test(dwi2adc/ivim) add_bash_binary_test(dwi2fod/csd_default) -add_bash_binary_test(dwi2fod/csd_lmax) -add_bash_binary_test(dwi2fod/csd_masked) +add_bash_binary_test(dwi2fod/csd_lmax NO_FILESYSTEM_LOCK) +add_bash_binary_test(dwi2fod/csd_masked NO_FILESYSTEM_LOCK) add_bash_binary_test(dwi2fod/msmt_default) add_bash_binary_test(dwi2fod/msmt_masked) add_bash_binary_test(dwi2tensor/bzero) -add_bash_binary_test(dwi2tensor/default) +add_bash_binary_test(dwi2tensor/default NO_FILESYSTEM_LOCK) add_bash_binary_test(dwi2tensor/dkt_constrained) add_bash_binary_test(dwi2tensor/dkt_unconstrained) -add_bash_binary_test(dwi2tensor/iters) -add_bash_binary_test(dwi2tensor/masked) -add_bash_binary_test(dwi2tensor/ols) +add_bash_binary_test(dwi2tensor/iters NO_FILESYSTEM_LOCK) +add_bash_binary_test(dwi2tensor/masked NO_FILESYSTEM_LOCK) +add_bash_binary_test(dwi2tensor/ols NO_FILESYSTEM_LOCK) -add_bash_binary_test(dwidenoise/default) +add_bash_binary_test(dwidenoise/default NO_FILESYSTEM_LOCK) add_bash_binary_test(dwidenoise/exp1_estimator) -add_bash_binary_test(dwidenoise/extent_anisotropic) -add_bash_binary_test(dwidenoise/extent_isotropic) -add_bash_binary_test(dwidenoise/masked) +add_bash_binary_test(dwidenoise/extent_anisotropic NO_FILESYSTEM_LOCK) +add_bash_binary_test(dwidenoise/extent_isotropic NO_FILESYSTEM_LOCK) +add_bash_binary_test(dwidenoise/masked NO_FILESYSTEM_LOCK) add_bash_binary_test(dwidenoise/noise_default) add_bash_binary_test(dwidenoise/noise_extent) -add_bash_binary_test(dwiextract/bzero) -add_bash_binary_test(dwiextract/default) +add_bash_binary_test(dwiextract/bzero NO_FILESYSTEM_LOCK) +add_bash_binary_test(dwiextract/default NO_FILESYSTEM_LOCK) -add_bash_binary_test(dwirecon/combinepairs_pequad) -add_bash_binary_test(dwirecon/combinepairs_reordered) -add_bash_binary_test(dwirecon/combinepairs_rpepair) +add_bash_binary_test(dwirecon/combinepairs_pequad NO_FILESYSTEM_LOCK) +add_bash_binary_test(dwirecon/combinepairs_reordered NO_FILESYSTEM_LOCK) +add_bash_binary_test(dwirecon/combinepairs_rpepair NO_FILESYSTEM_LOCK) add_bash_binary_test(dwirecon/combinepairs_unbalanced) add_bash_binary_test(dwirecon/combinepredicted_exponent) add_bash_binary_test(dwirecon/combinepredicted_lmax) -add_bash_binary_test(dwirecon/combinepredicted_pequad) -add_bash_binary_test(dwirecon/combinepredicted_rpepair) +add_bash_binary_test(dwirecon/combinepredicted_pequad NO_FILESYSTEM_LOCK) +add_bash_binary_test(dwirecon/combinepredicted_rpepair NO_FILESYSTEM_LOCK) -add_bash_binary_test(fixel2peaks/input_afd) -add_bash_binary_test(fixel2peaks/input_directions) -add_bash_binary_test(fixel2peaks/input_directory) -add_bash_binary_test(fixel2peaks/input_index) +add_bash_binary_test(fixel2peaks/input_afd NO_FILESYSTEM_LOCK) +add_bash_binary_test(fixel2peaks/input_directions NO_FILESYSTEM_LOCK) +add_bash_binary_test(fixel2peaks/input_directory NO_FILESYSTEM_LOCK) +add_bash_binary_test(fixel2peaks/input_index NO_FILESYSTEM_LOCK) -add_bash_binary_test(fixel2sh/default) -add_bash_binary_test(fixel2sh/lmax) +add_bash_binary_test(fixel2sh/default NO_FILESYSTEM_LOCK) +add_bash_binary_test(fixel2sh/lmax NO_FILESYSTEM_LOCK) add_bash_binary_test(fixel2tsf/default) -add_bash_binary_test(fixel2voxel/absmax) -add_bash_binary_test(fixel2voxel/complexity) -add_bash_binary_test(fixel2voxel/count) -add_bash_binary_test(fixel2voxel/dec_scaled) -add_bash_binary_test(fixel2voxel/dec_unit) -add_bash_binary_test(fixel2voxel/entropy) -add_bash_binary_test(fixel2voxel/magmax) -add_bash_binary_test(fixel2voxel/max) -add_bash_binary_test(fixel2voxel/mean) -add_bash_binary_test(fixel2voxel/min) -add_bash_binary_test(fixel2voxel/none) -add_bash_binary_test(fixel2voxel/product) -add_bash_binary_test(fixel2voxel/sf) -add_bash_binary_test(fixel2voxel/sum) +add_bash_binary_test(fixel2voxel/absmax NO_FILESYSTEM_LOCK) +add_bash_binary_test(fixel2voxel/complexity NO_FILESYSTEM_LOCK) +add_bash_binary_test(fixel2voxel/count NO_FILESYSTEM_LOCK) +add_bash_binary_test(fixel2voxel/dec_scaled NO_FILESYSTEM_LOCK) +add_bash_binary_test(fixel2voxel/dec_unit NO_FILESYSTEM_LOCK) +add_bash_binary_test(fixel2voxel/entropy NO_FILESYSTEM_LOCK) +add_bash_binary_test(fixel2voxel/magmax NO_FILESYSTEM_LOCK) +add_bash_binary_test(fixel2voxel/max NO_FILESYSTEM_LOCK) +add_bash_binary_test(fixel2voxel/mean NO_FILESYSTEM_LOCK) +add_bash_binary_test(fixel2voxel/min NO_FILESYSTEM_LOCK) +add_bash_binary_test(fixel2voxel/none NO_FILESYSTEM_LOCK) +add_bash_binary_test(fixel2voxel/product NO_FILESYSTEM_LOCK) +add_bash_binary_test(fixel2voxel/sf NO_FILESYSTEM_LOCK) +add_bash_binary_test(fixel2voxel/sum NO_FILESYSTEM_LOCK) add_bash_binary_test(fixelcfestats/default) add_bash_binary_test(fixelcfestats/legacy) @@ -171,10 +179,10 @@ add_bash_binary_test(fixelcrop/default) add_bash_binary_test(fixelfilter/cfe_default) add_bash_binary_test(fixelfilter/cfe_masked) -add_bash_binary_test(fixelfilter/cfe_nan) +add_bash_binary_test(fixelfilter/cfe_nan NO_FILESYSTEM_LOCK) add_bash_binary_test(fixelfilter/smooth_inputdir) add_bash_binary_test(fixelfilter/smooth_inputfile) -add_bash_binary_test(fixelfilter/smooth_masked) +add_bash_binary_test(fixelfilter/smooth_masked NO_FILESYSTEM_LOCK) add_bash_binary_test(fixelreorient/default) @@ -189,34 +197,34 @@ add_bash_binary_test(fixelvalidate/malformed_index) add_bash_binary_test(fixelvalidate/missing_directions) add_bash_binary_test(fixelvalidate/wrong_nfixels) -add_bash_binary_test(fod2dec/anat_combo) -add_bash_binary_test(fod2dec/anat_default) -add_bash_binary_test(fod2dec/anat_lum) -add_bash_binary_test(fod2dec/anat_masked) -add_bash_binary_test(fod2dec/anat_noweight) -add_bash_binary_test(fod2dec/anat_threshold) -add_bash_binary_test(fod2dec/combo) -add_bash_binary_test(fod2dec/default) -add_bash_binary_test(fod2dec/lum) -add_bash_binary_test(fod2dec/masked) -add_bash_binary_test(fod2dec/noweight) -add_bash_binary_test(fod2dec/threshold) +add_bash_binary_test(fod2dec/anat_combo NO_FILESYSTEM_LOCK) +add_bash_binary_test(fod2dec/anat_default NO_FILESYSTEM_LOCK) +add_bash_binary_test(fod2dec/anat_lum NO_FILESYSTEM_LOCK) +add_bash_binary_test(fod2dec/anat_masked NO_FILESYSTEM_LOCK) +add_bash_binary_test(fod2dec/anat_noweight NO_FILESYSTEM_LOCK) +add_bash_binary_test(fod2dec/anat_threshold NO_FILESYSTEM_LOCK) +add_bash_binary_test(fod2dec/combo NO_FILESYSTEM_LOCK) +add_bash_binary_test(fod2dec/default NO_FILESYSTEM_LOCK) +add_bash_binary_test(fod2dec/lum NO_FILESYSTEM_LOCK) +add_bash_binary_test(fod2dec/masked NO_FILESYSTEM_LOCK) +add_bash_binary_test(fod2dec/noweight NO_FILESYSTEM_LOCK) +add_bash_binary_test(fod2dec/threshold NO_FILESYSTEM_LOCK) add_bash_binary_test(fod2fixel/default) add_bash_binary_test(fod2fixel/masked) add_bash_binary_test(fod2fixel/nothresholds) -add_bash_binary_test(label2colour/freesurfer) -add_bash_binary_test(label2colour/iit) +add_bash_binary_test(label2colour/freesurfer NO_FILESYSTEM_LOCK) +add_bash_binary_test(label2colour/iit NO_FILESYSTEM_LOCK) add_bash_binary_test(label2colour/random) add_bash_binary_test(label2mesh/blocky) add_bash_binary_test(label2mesh/default) -add_bash_binary_test(labelconvert/aal) -add_bash_binary_test(labelconvert/freesurfer) -add_bash_binary_test(labelconvert/iit) -add_bash_binary_test(labelconvert/lpba40) +add_bash_binary_test(labelconvert/aal NO_FILESYSTEM_LOCK) +add_bash_binary_test(labelconvert/freesurfer NO_FILESYSTEM_LOCK) +add_bash_binary_test(labelconvert/iit NO_FILESYSTEM_LOCK) +add_bash_binary_test(labelconvert/lpba40 NO_FILESYSTEM_LOCK) add_bash_binary_test(labelconvert/mismatch) add_bash_binary_test(labelvalidate/float) @@ -226,18 +234,18 @@ add_bash_binary_test(labelvalidate/non_spatially_contiguous) add_bash_binary_test(labelvalidate/sequentially_contiguous) add_bash_binary_test(labelvalidate/wrong_dimensionality) -add_bash_binary_test(maskfilter/connect_26connectivity) -add_bash_binary_test(maskfilter/connect_26connectivity_largest) -add_bash_binary_test(maskfilter/connect_axes) -add_bash_binary_test(maskfilter/connect_axes_26connectivity) -add_bash_binary_test(maskfilter/connect_default) -add_bash_binary_test(maskfilter/connect_largest) -add_bash_binary_test(maskfilter/dilate) -add_bash_binary_test(maskfilter/erode) -add_bash_binary_test(maskfilter/median) +add_bash_binary_test(maskfilter/connect_26connectivity NO_FILESYSTEM_LOCK) +add_bash_binary_test(maskfilter/connect_26connectivity_largest NO_FILESYSTEM_LOCK) +add_bash_binary_test(maskfilter/connect_axes NO_FILESYSTEM_LOCK) +add_bash_binary_test(maskfilter/connect_axes_26connectivity NO_FILESYSTEM_LOCK) +add_bash_binary_test(maskfilter/connect_default NO_FILESYSTEM_LOCK) +add_bash_binary_test(maskfilter/connect_largest NO_FILESYSTEM_LOCK) +add_bash_binary_test(maskfilter/dilate NO_FILESYSTEM_LOCK) +add_bash_binary_test(maskfilter/erode NO_FILESYSTEM_LOCK) +add_bash_binary_test(maskfilter/median NO_FILESYSTEM_LOCK) -add_bash_binary_test(mesh2voxel/default) -add_bash_binary_test(mesh2voxel/input_4D) +add_bash_binary_test(mesh2voxel/default NO_FILESYSTEM_LOCK) +add_bash_binary_test(mesh2voxel/input_4D NO_FILESYSTEM_LOCK) add_bash_binary_test(meshconvert/big_endian) add_bash_binary_test(meshconvert/little_endian) @@ -258,43 +266,43 @@ add_bash_binary_test(meshvalidate/duplicate_polygon) add_bash_binary_test(meshvalidate/duplicate_vertex) add_bash_binary_test(meshvalidate/inconsistent_normals) -add_bash_binary_test(mraverageheader/mean_nearest) -add_bash_binary_test(mraverageheader/mean_projection) -add_bash_binary_test(mraverageheader/min_nearest) -add_bash_binary_test(mraverageheader/min_projection) -add_bash_binary_test(mraverageheader/padding) +add_bash_binary_test(mraverageheader/mean_nearest NO_FILESYSTEM_LOCK) +add_bash_binary_test(mraverageheader/mean_projection NO_FILESYSTEM_LOCK) +add_bash_binary_test(mraverageheader/min_nearest NO_FILESYSTEM_LOCK) +add_bash_binary_test(mraverageheader/min_projection NO_FILESYSTEM_LOCK) +add_bash_binary_test(mraverageheader/padding NO_FILESYSTEM_LOCK) -add_bash_binary_test(mrcalc/calc_mode) -add_bash_binary_test(mrcalc/expression_1) -add_bash_binary_test(mrcalc/expression_2) -add_bash_binary_test(mrcalc/expression_3) -add_bash_binary_test(mrcalc/expression_4) -add_bash_binary_test(mrcalc/expression_5) -add_bash_binary_test(mrcalc/dwscheme_preservation_imprecision) +add_bash_binary_test(mrcalc/calc_mode NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrcalc/expression_1 NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrcalc/expression_2 NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrcalc/expression_3 NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrcalc/expression_4 NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrcalc/expression_5 NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrcalc/dwscheme_preservation_imprecision NO_FILESYSTEM_LOCK) add_bash_binary_test(mrcat/axis) add_bash_binary_test(mrcat/dwscheme_merge) -add_bash_binary_test(mrcat/single_input) -add_bash_binary_test(mrcat/singlevoxel) +add_bash_binary_test(mrcat/single_input NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrcat/singlevoxel NO_FILESYSTEM_LOCK) add_bash_binary_test(mrclusterstats/clustersize) add_bash_binary_test(mrclusterstats/default) add_bash_binary_test(mrclusterstats/masked) add_bash_binary_test(mrclusterstats/posthoc) -add_bash_binary_test(mrcolour/bothlimits) -add_bash_binary_test(mrcolour/map_cool) -add_bash_binary_test(mrcolour/map_gray) -add_bash_binary_test(mrcolour/map_hot) -add_bash_binary_test(mrcolour/map_inferno) -add_bash_binary_test(mrcolour/map_jet) -add_bash_binary_test(mrcolour/map_pet) +add_bash_binary_test(mrcolour/bothlimits NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrcolour/map_cool NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrcolour/map_gray NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrcolour/map_hot NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrcolour/map_inferno NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrcolour/map_jet NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrcolour/map_pet NO_FILESYSTEM_LOCK) add_bash_binary_test(mrcolour/map_rgb) -add_bash_binary_test(mrcolour/map_viridis) +add_bash_binary_test(mrcolour/map_viridis NO_FILESYSTEM_LOCK) add_bash_binary_test(mrcolour/scaling) -add_bash_binary_test(mrcolour/upperlimit) +add_bash_binary_test(mrcolour/upperlimit NO_FILESYSTEM_LOCK) -add_bash_binary_test(mrconvert/big_endian) +add_bash_binary_test(mrconvert/big_endian NO_FILESYSTEM_LOCK) add_bash_binary_test(mrconvert/coord_end) add_bash_binary_test(mrconvert/format_mgh) add_bash_binary_test(mrconvert/format_mgz) @@ -303,53 +311,53 @@ add_bash_binary_test(mrconvert/format_mih) add_bash_binary_test(mrconvert/format_nii) add_bash_binary_test(mrconvert/format_nii_gz) add_bash_binary_test(mrconvert/format_png) -add_bash_binary_test(mrconvert/insert_axis) +add_bash_binary_test(mrconvert/insert_axis NO_FILESYSTEM_LOCK) add_bash_binary_test(mrconvert/multifile) add_bash_binary_test(mrconvert/multifile_singlevoxel) -add_bash_binary_test(mrconvert/passthrough) -add_bash_binary_test(mrconvert/real2complex) -add_bash_binary_test(mrconvert/strides) - -add_bash_binary_test(mrdegibbs/default) - -add_bash_binary_test(mrfilter/demodulate_3Din_linear_2Ddemod) -add_bash_binary_test(mrfilter/demodulate_3Din_linear_3Ddemod) -add_bash_binary_test(mrfilter/demodulate_3Din_nonlinear_2Ddemod) -add_bash_binary_test(mrfilter/demodulate_3Din_nonlinear_3Ddemod) -add_bash_binary_test(mrfilter/demodulate_4Din_linear_2Ddemod) -add_bash_binary_test(mrfilter/demodulate_4Din_linear_3Ddemod) -add_bash_binary_test(mrfilter/demodulate_4Din_nonlinear_2Ddemod) -add_bash_binary_test(mrfilter/demodulate_4Din_nonlinear_3Ddemod) +add_bash_binary_test(mrconvert/passthrough NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrconvert/real2complex NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrconvert/strides NO_FILESYSTEM_LOCK) + +add_bash_binary_test(mrdegibbs/default NO_FILESYSTEM_LOCK) + +add_bash_binary_test(mrfilter/demodulate_3Din_linear_2Ddemod NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrfilter/demodulate_3Din_linear_3Ddemod NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrfilter/demodulate_3Din_nonlinear_2Ddemod NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrfilter/demodulate_3Din_nonlinear_3Ddemod NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrfilter/demodulate_4Din_linear_2Ddemod NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrfilter/demodulate_4Din_linear_3Ddemod NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrfilter/demodulate_4Din_nonlinear_2Ddemod NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrfilter/demodulate_4Din_nonlinear_3Ddemod NO_FILESYSTEM_LOCK) add_bash_binary_test(mrfilter/gradient_default) add_bash_binary_test(mrfilter/gradient_magnitude) add_bash_binary_test(mrfilter/gradient_scanner) add_bash_binary_test(mrfilter/gradient_scanner_magnitude) -add_bash_binary_test(mrfilter/median_default) -add_bash_binary_test(mrfilter/median_extent_anisotropic) -add_bash_binary_test(mrfilter/median_extent_isotropic) -add_bash_binary_test(mrfilter/smooth_default) -add_bash_binary_test(mrfilter/smooth_extent) -add_bash_binary_test(mrfilter/smooth_fwhm) -add_bash_binary_test(mrfilter/smooth_stdev_3vector) -add_bash_binary_test(mrfilter/smooth_stdev_anisotropic) -add_bash_binary_test(mrfilter/smooth_stdev_scalar) - -add_bash_binary_test(mrgrid/crop_axis_range) -add_bash_binary_test(mrgrid/crop_axis_widths) -add_bash_binary_test(mrgrid/crop_mask_default) -add_bash_binary_test(mrgrid/crop_mask_nopadding) -add_bash_binary_test(mrgrid/pad_singleaxis) -add_bash_binary_test(mrgrid/pad_twoaxes) -add_bash_binary_test(mrgrid/pad_uniform) -add_bash_binary_test(mrgrid/pad_uniform_plus_singleaxis) -add_bash_binary_test(mrgrid/regrid_anisotropic_scale) -add_bash_binary_test(mrgrid/regrid_anisotropic_size) -add_bash_binary_test(mrgrid/regrid_anisotropic_vox) -add_bash_binary_test(mrgrid/regrid_downsample) -add_bash_binary_test(mrgrid/regrid_upsample_default) -add_bash_binary_test(mrgrid/regrid_upsample_linear) -add_bash_binary_test(mrgrid/regrid_upsample_nearest) -add_bash_binary_test(mrgrid/regrid_upsample_sinc) +add_bash_binary_test(mrfilter/median_default NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrfilter/median_extent_anisotropic NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrfilter/median_extent_isotropic NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrfilter/smooth_default NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrfilter/smooth_extent NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrfilter/smooth_fwhm NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrfilter/smooth_stdev_3vector NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrfilter/smooth_stdev_anisotropic NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrfilter/smooth_stdev_scalar NO_FILESYSTEM_LOCK) + +add_bash_binary_test(mrgrid/crop_axis_range NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrgrid/crop_axis_widths NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrgrid/crop_mask_default NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrgrid/crop_mask_nopadding NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrgrid/pad_singleaxis NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrgrid/pad_twoaxes NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrgrid/pad_uniform NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrgrid/pad_uniform_plus_singleaxis NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrgrid/regrid_anisotropic_scale NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrgrid/regrid_anisotropic_size NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrgrid/regrid_anisotropic_vox NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrgrid/regrid_downsample NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrgrid/regrid_upsample_default NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrgrid/regrid_upsample_linear NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrgrid/regrid_upsample_nearest NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrgrid/regrid_upsample_sinc NO_FILESYSTEM_LOCK) add_bash_binary_test(mrhistmatch/linear) add_bash_binary_test(mrhistmatch/scale) @@ -362,72 +370,72 @@ add_bash_binary_test(mrhistogram/masked) add_bash_binary_test(mrinfo/bvec_bval_nan) add_bash_binary_test(mrmath/multiimage_median) -add_bash_binary_test(mrmath/singleimage_mean) -add_bash_binary_test(mrmath/singleimage_norm) -add_bash_binary_test(mrmath/singleimage_rms) +add_bash_binary_test(mrmath/singleimage_mean NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrmath/singleimage_norm NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrmath/singleimage_rms NO_FILESYSTEM_LOCK) -add_bash_binary_test(mrregister/multicontrast_affine) -add_bash_binary_test(mrregister/multicontrast_affine_weights) +add_bash_binary_test(mrregister/multicontrast_affine NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrregister/multicontrast_affine_weights NO_FILESYSTEM_LOCK) add_bash_binary_test(mrregister/multicontrast_rigidaffine_fod) add_bash_binary_test(mrregister/multicontrast_rigidnonlinear_fod) -add_bash_binary_test(mrregister/singlecontrast_affine) +add_bash_binary_test(mrregister/singlecontrast_affine NO_FILESYSTEM_LOCK) add_bash_binary_test(mrregister/singlecontrast_rigidnonlinear_fod) add_bash_binary_test(mrstats/complex) add_bash_binary_test(mrstats/default) add_bash_binary_test(mrstats/masked) -add_bash_binary_test(mrthreshold/3d_4dmask) -add_bash_binary_test(mrthreshold/3d_abs) -add_bash_binary_test(mrthreshold/3d_bottomcount) -add_bash_binary_test(mrthreshold/3d_bottompercent) -add_bash_binary_test(mrthreshold/3d_default_noimageout) -add_bash_binary_test(mrthreshold/3d_default_withimageout) +add_bash_binary_test(mrthreshold/3d_4dmask NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrthreshold/3d_abs NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrthreshold/3d_bottomcount NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrthreshold/3d_bottompercent NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrthreshold/3d_default_noimageout NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrthreshold/3d_default_withimageout NO_FILESYSTEM_LOCK) add_bash_binary_test(mrthreshold/3d_ignorezero) -add_bash_binary_test(mrthreshold/3d_lessthan) -add_bash_binary_test(mrthreshold/3d_masked) -add_bash_binary_test(mrthreshold/3d_median) -add_bash_binary_test(mrthreshold/3d_median_masked) +add_bash_binary_test(mrthreshold/3d_lessthan NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrthreshold/3d_masked NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrthreshold/3d_median NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrthreshold/3d_median_masked NO_FILESYSTEM_LOCK) add_bash_binary_test(mrthreshold/3d_outmasked) -add_bash_binary_test(mrthreshold/3d_topcount) -add_bash_binary_test(mrthreshold/3d_toppercent) -add_bash_binary_test(mrthreshold/4d_default_noimageout) -add_bash_binary_test(mrthreshold/4d_default_withimageout) -add_bash_binary_test(mrthreshold/4d_masked) -add_bash_binary_test(mrthreshold/4d_median) -add_bash_binary_test(mrthreshold/4d_median_masked) +add_bash_binary_test(mrthreshold/3d_topcount NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrthreshold/3d_toppercent NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrthreshold/4d_default_noimageout NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrthreshold/4d_default_withimageout NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrthreshold/4d_masked NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrthreshold/4d_median NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrthreshold/4d_median_masked NO_FILESYSTEM_LOCK) add_bash_binary_test(mrthreshold/4d_verify_pervolume) -add_bash_binary_test(mrthreshold/allvolumes_default) -add_bash_binary_test(mrthreshold/allvolumes_masked) -add_bash_binary_test(mrthreshold/allvolumes_median) -add_bash_binary_test(mrthreshold/allvolumes_median_masked) - -add_bash_binary_test(mrtransform/fliplr) -add_bash_binary_test(mrtransform/fod_linear_reorient_noresample) -add_bash_binary_test(mrtransform/fod_linear_reorient_withresample) -add_bash_binary_test(mrtransform/fod_nonlinear) -add_bash_binary_test(mrtransform/identity) -add_bash_binary_test(mrtransform/linear) +add_bash_binary_test(mrthreshold/allvolumes_default NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrthreshold/allvolumes_masked NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrthreshold/allvolumes_median NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrthreshold/allvolumes_median_masked NO_FILESYSTEM_LOCK) + +add_bash_binary_test(mrtransform/fliplr NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrtransform/fod_linear_reorient_noresample NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrtransform/fod_linear_reorient_withresample NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrtransform/fod_nonlinear NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrtransform/identity NO_FILESYSTEM_LOCK) +add_bash_binary_test(mrtransform/linear NO_FILESYSTEM_LOCK) add_bash_binary_test(mrtransform/linear_inverse) add_bash_binary_test(mrtransform/linear_template) add_bash_binary_test(mrtransform/noop) -add_bash_binary_test(mrtransform/replace) +add_bash_binary_test(mrtransform/replace NO_FILESYSTEM_LOCK) add_bash_binary_test(mtnormalise/default) -add_bash_binary_test(peaks2amp/default) +add_bash_binary_test(peaks2amp/default NO_FILESYSTEM_LOCK) add_bash_binary_test(peaks2fixel/default) -add_bash_binary_test(peaksconvert/default_to_fsl3vector) -add_bash_binary_test(peaksconvert/default_to_ijk3vector) -add_bash_binary_test(peaksconvert/default_to_spherical) +add_bash_binary_test(peaksconvert/default_to_fsl3vector NO_FILESYSTEM_LOCK) +add_bash_binary_test(peaksconvert/default_to_ijk3vector NO_FILESYSTEM_LOCK) +add_bash_binary_test(peaksconvert/default_to_spherical NO_FILESYSTEM_LOCK) add_bash_binary_test(peaksconvert/default_to_unit3vector) -add_bash_binary_test(peaksconvert/default_to_unitspherical) -add_bash_binary_test(peaksconvert/fsl3vector_to_default) -add_bash_binary_test(peaksconvert/ijk3vector_to_default) -add_bash_binary_test(peaksconvert/passthrough) -add_bash_binary_test(peaksconvert/spherical_to_default) +add_bash_binary_test(peaksconvert/default_to_unitspherical NO_FILESYSTEM_LOCK) +add_bash_binary_test(peaksconvert/fsl3vector_to_default NO_FILESYSTEM_LOCK) +add_bash_binary_test(peaksconvert/ijk3vector_to_default NO_FILESYSTEM_LOCK) +add_bash_binary_test(peaksconvert/passthrough NO_FILESYSTEM_LOCK) +add_bash_binary_test(peaksconvert/spherical_to_default NO_FILESYSTEM_LOCK) add_bash_binary_test(peaksconvert/unitspherical_to_default) add_bash_binary_test(peaksvalidate/default) @@ -439,25 +447,25 @@ add_bash_binary_test(peaksvalidate/numvolumes) add_bash_binary_test(peaksvalidate/partial_nan) add_bash_binary_test(peaksvalidate/unity_norm) -add_bash_binary_test(sh2amp/default) -add_bash_binary_test(sh2amp/grad) -add_bash_binary_test(sh2amp/msmt) -add_bash_binary_test(sh2amp/nonnegative) +add_bash_binary_test(sh2amp/default NO_FILESYSTEM_LOCK) +add_bash_binary_test(sh2amp/grad NO_FILESYSTEM_LOCK) +add_bash_binary_test(sh2amp/msmt NO_FILESYSTEM_LOCK) +add_bash_binary_test(sh2amp/nonnegative NO_FILESYSTEM_LOCK) -add_bash_binary_test(sh2metric/entropy) +add_bash_binary_test(sh2metric/entropy NO_FILESYSTEM_LOCK) add_bash_binary_test(sh2metric/entropy_directions) -add_bash_binary_test(sh2metric/entropy_multiinput) -add_bash_binary_test(sh2metric/entropy_normalised) -add_bash_binary_test(sh2metric/entropy_invnorm) -add_bash_binary_test(sh2metric/power) +add_bash_binary_test(sh2metric/entropy_multiinput NO_FILESYSTEM_LOCK) +add_bash_binary_test(sh2metric/entropy_normalised NO_FILESYSTEM_LOCK) +add_bash_binary_test(sh2metric/entropy_invnorm NO_FILESYSTEM_LOCK) +add_bash_binary_test(sh2metric/power NO_FILESYSTEM_LOCK) -add_bash_binary_test(sh2peaks/default) -add_bash_binary_test(sh2peaks/fast) +add_bash_binary_test(sh2peaks/default NO_FILESYSTEM_LOCK) +add_bash_binary_test(sh2peaks/fast NO_FILESYSTEM_LOCK) add_bash_binary_test(sh2response/default) -add_bash_binary_test(shconv/default) -add_bash_binary_test(shconv/msmt) +add_bash_binary_test(shconv/default NO_FILESYSTEM_LOCK) +add_bash_binary_test(shconv/msmt NO_FILESYSTEM_LOCK) add_bash_binary_test(tck2connectome/assignment_forward_search) add_bash_binary_test(tck2connectome/default) @@ -504,10 +512,10 @@ add_bash_binary_test(tckglobal/default) add_bash_binary_test(tckglobal/masked) add_bash_binary_test(tckglobal/multitissue) -add_bash_binary_test(tckmap/dec) -add_bash_binary_test(tckmap/default_template) -add_bash_binary_test(tckmap/default_vox) -add_bash_binary_test(tckmap/tod) +add_bash_binary_test(tckmap/dec NO_FILESYSTEM_LOCK) +add_bash_binary_test(tckmap/default_template NO_FILESYSTEM_LOCK) +add_bash_binary_test(tckmap/default_vox NO_FILESYSTEM_LOCK) +add_bash_binary_test(tckmap/tod NO_FILESYSTEM_LOCK) add_bash_binary_test(tckresample/downsample) add_bash_binary_test(tckresample/endpoints) @@ -555,21 +563,21 @@ add_bash_binary_test(tckvalidate/novertices) add_bash_binary_test(tckvalidate/onevertex) add_bash_binary_test(tckvalidate/partialfinite) -add_bash_binary_test(tensor2metric/adc) +add_bash_binary_test(tensor2metric/adc NO_FILESYSTEM_LOCK) add_bash_binary_test(tensor2metric/dkt) -add_bash_binary_test(tensor2metric/eigenvalues) -add_bash_binary_test(tensor2metric/eigenvectors) -add_bash_binary_test(tensor2metric/fa) +add_bash_binary_test(tensor2metric/eigenvalues NO_FILESYSTEM_LOCK) +add_bash_binary_test(tensor2metric/eigenvectors NO_FILESYSTEM_LOCK) +add_bash_binary_test(tensor2metric/fa NO_FILESYSTEM_LOCK) add_bash_binary_test(tensor2metric/mo_na) add_bash_binary_test(transformcalc/average) add_bash_binary_test(transformcalc/header) add_bash_binary_test(transformcalc/interpolate) -add_bash_binary_test(transformcompose/affine_nonlinear) -add_bash_binary_test(transformcompose/affine_to_image) +add_bash_binary_test(transformcompose/affine_nonlinear NO_FILESYSTEM_LOCK) +add_bash_binary_test(transformcompose/affine_to_image NO_FILESYSTEM_LOCK) add_bash_binary_test(transformcompose/two_affines) -add_bash_binary_test(transformcompose/two_nonlinear) +add_bash_binary_test(transformcompose/two_nonlinear NO_FILESYSTEM_LOCK) add_bash_binary_test(transformconvert/flirt_import) add_bash_binary_test(transformconvert/itk_ants) @@ -599,12 +607,12 @@ add_bash_binary_test(vectorstats/4) add_bash_binary_test(voxel2fixel/default) add_bash_binary_test(warp2metric/fc) -add_bash_binary_test(warp2metric/jdet) -add_bash_binary_test(warp2metric/jmat) +add_bash_binary_test(warp2metric/jdet NO_FILESYSTEM_LOCK) +add_bash_binary_test(warp2metric/jmat NO_FILESYSTEM_LOCK) -add_bash_binary_test(warpcorrect/default) +add_bash_binary_test(warpcorrect/default NO_FILESYSTEM_LOCK) -add_bash_binary_test(warpinit/default) +add_bash_binary_test(warpinit/default NO_FILESYSTEM_LOCK) add_bash_binary_test(warpvalidate/deformation) add_bash_binary_test(warpvalidate/deformation_volumecount) diff --git a/testing/integration_tests/CMakeLists.txt b/testing/integration_tests/CMakeLists.txt index 9fda731e89..8a2294e1bf 100644 --- a/testing/integration_tests/CMakeLists.txt +++ b/testing/integration_tests/CMakeLists.txt @@ -41,6 +41,13 @@ dirs_to_unix(EXEC_DIRS "${EXEC_DIRS}") include(BashTests) function (add_bash_integration_test FILE_SRC) get_filename_component(NAME ${FILE_SRC} NAME_WE) + # Forward the NO_FILESYSTEM_LOCK opt-out keyword for tests that never write to disk. + set(no_filesystem_lock "") + foreach(arg ${ARGN}) + if(arg STREQUAL "NO_FILESYSTEM_LOCK") + set(no_filesystem_lock NO_FILESYSTEM_LOCK) + endif() + endforeach() add_bash_test( FILE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/${FILE_SRC}" PREFIX "integrationtest" @@ -48,6 +55,7 @@ function (add_bash_integration_test FILE_SRC) EXEC_DIRECTORIES "${EXEC_DIRS}" ENVIRONMENT "PYTHONPATH=${PYTHON_ENV_PATH}" LABELS "integration;${NAME}" + ${no_filesystem_lock} ) endfunction() diff --git a/testing/scripts/CMakeLists.txt b/testing/scripts/CMakeLists.txt index 941e57f29d..ca7f6a6fa4 100644 --- a/testing/scripts/CMakeLists.txt +++ b/testing/scripts/CMakeLists.txt @@ -9,9 +9,16 @@ dirs_to_unix(EXEC_DIRS "${EXEC_DIRS}") include(BashTests) function(add_bash_script_test file_path) + # Extra arguments are labels, except for the NO_FILESYSTEM_LOCK opt-out keyword + # which is forwarded to add_bash_test for tests that never write to disk. set(extra_labels "") - foreach(label ${ARGN}) - list(APPEND extra_labels ${label}) + set(no_filesystem_lock "") + foreach(arg ${ARGN}) + if(arg STREQUAL "NO_FILESYSTEM_LOCK") + set(no_filesystem_lock NO_FILESYSTEM_LOCK) + else() + list(APPEND extra_labels ${arg}) + endif() endforeach() # Set folder name @@ -24,6 +31,7 @@ function(add_bash_script_test file_path) WORKING_DIRECTORY ${SCRIPT_DATA_DIR} EXEC_DIRECTORIES "${EXEC_DIRS}" LABELS "script;${folder_name};${extra_labels}" + ${no_filesystem_lock} ) endfunction() @@ -33,7 +41,7 @@ add_bash_script_test(5ttgen/deepatropos_fromprob_default "pythonci") add_bash_script_test(5ttgen/deepatropos_fromprob_whitestem) add_bash_script_test(5ttgen/freesurfer_default "pythonci") add_bash_script_test(5ttgen/freesurfer_nocrop) -add_bash_script_test(5ttgen/freesurfer_piping) +add_bash_script_test(5ttgen/freesurfer_piping NO_FILESYSTEM_LOCK) add_bash_script_test(5ttgen/freesurfer_sgmamyghipp) add_bash_script_test(5ttgen/freesurfer_whitespace) add_bash_script_test(5ttgen/fsl_default) @@ -47,7 +55,7 @@ add_bash_script_test(5ttgen/hsvs_aseg) add_bash_script_test(5ttgen/hsvs_default) add_bash_script_test(5ttgen/hsvs_first) add_bash_script_test(5ttgen/hsvs_modules) -add_bash_script_test(5ttgen/hsvs_piping) +add_bash_script_test(5ttgen/hsvs_piping NO_FILESYSTEM_LOCK) add_bash_script_test(5ttgen/hsvs_template) add_bash_script_test(5ttgen/hsvs_whitespace) add_bash_script_test(5ttgen/hsvs_whitestem) @@ -87,10 +95,10 @@ add_bash_script_test(dwi2mask/hdbet_default) add_bash_script_test(dwi2mask/hdbet_piping) add_bash_script_test(dwi2mask/hdbet_whitespace) add_bash_script_test(dwi2mask/legacy_default "pythonci") -add_bash_script_test(dwi2mask/legacy_piping) +add_bash_script_test(dwi2mask/legacy_piping NO_FILESYSTEM_LOCK) add_bash_script_test(dwi2mask/legacy_whitespace) add_bash_script_test(dwi2mask/mean_default "pythonci") -add_bash_script_test(dwi2mask/mean_piping) +add_bash_script_test(dwi2mask/mean_piping NO_FILESYSTEM_LOCK) add_bash_script_test(dwi2mask/mean_whitespace) add_bash_script_test(dwi2mask/mtnorm_default "pythonci") add_bash_script_test(dwi2mask/mtnorm_initmask) @@ -103,7 +111,7 @@ add_bash_script_test(dwi2mask/synthstrip_piping) add_bash_script_test(dwi2mask/synthstrip_whitespace) add_bash_script_test(dwi2mask/trace_default "pythonci") add_bash_script_test(dwi2mask/trace_iterative) -add_bash_script_test(dwi2mask/trace_piping) +add_bash_script_test(dwi2mask/trace_piping NO_FILESYSTEM_LOCK) add_bash_script_test(dwi2mask/trace_whitespace) add_bash_script_test(dwi2response/dhollander_default) @@ -209,7 +217,7 @@ add_bash_script_test(dwifslpreproc/topup_files) add_bash_script_test(dwifslpreproc/whitespace) add_bash_script_test(dwigradcheck/default) -add_bash_script_test(dwigradcheck/piping) +add_bash_script_test(dwigradcheck/piping NO_FILESYSTEM_LOCK) add_bash_script_test(dwigradcheck/whitespace) add_bash_script_test(dwinormalise/group_default "pythonci") @@ -245,7 +253,7 @@ add_bash_script_test(labelsgmfirst/whitespace) add_bash_script_test(mask2glass/default "pythonci") add_bash_script_test(mask2glass/no4dseries "pythonci") -add_bash_script_test(mask2glass/piping) +add_bash_script_test(mask2glass/piping NO_FILESYSTEM_LOCK) add_bash_script_test(mask2glass/whitespace) add_bash_script_test(mrtrix_cleanup/default "pythonci") @@ -254,13 +262,13 @@ add_bash_script_test(mrtrix_cleanup/whitespace) add_bash_script_test(peakscheck/3vector_permutation) add_bash_script_test(peakscheck/all) -add_bash_script_test(peakscheck/default) -add_bash_script_test(peakscheck/mask) +add_bash_script_test(peakscheck/default NO_FILESYSTEM_LOCK) +add_bash_script_test(peakscheck/mask NO_FILESYSTEM_LOCK) add_bash_script_test(peakscheck/noshuffle "pythonci") add_bash_script_test(peakscheck/notransform "pythonci") add_bash_script_test(peakscheck/out_table) add_bash_script_test(peakscheck/reference) -add_bash_script_test(peakscheck/spherical) +add_bash_script_test(peakscheck/spherical NO_FILESYSTEM_LOCK) add_bash_script_test(peakscheck/spherical_permutation) add_bash_script_test(population_template/fa_affine) diff --git a/testing/ui_tests/CMakeLists.txt b/testing/ui_tests/CMakeLists.txt index b761d51ffd..9fc3b86951 100644 --- a/testing/ui_tests/CMakeLists.txt +++ b/testing/ui_tests/CMakeLists.txt @@ -39,6 +39,13 @@ dirs_to_unix(EXEC_DIRS "${EXEC_DIRS}") include(BashTests) function (add_bash_ui_test FILE_SRC) get_filename_component(NAME ${FILE_SRC} NAME_WE) + # Forward the NO_FILESYSTEM_LOCK opt-out keyword for tests that never write to disk. + set(no_filesystem_lock "") + foreach(arg ${ARGN}) + if(arg STREQUAL "NO_FILESYSTEM_LOCK") + set(no_filesystem_lock NO_FILESYSTEM_LOCK) + endif() + endforeach() add_bash_test( FILE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/${FILE_SRC}" PREFIX "uitest" @@ -46,6 +53,7 @@ function (add_bash_ui_test FILE_SRC) EXEC_DIRECTORIES "${EXEC_DIRS}" ENVIRONMENT "PYTHONPATH=${PYTHON_ENV_PATH}" LABELS "cli;${NAME}" + ${no_filesystem_lock} ) endfunction() diff --git a/testing/unit_tests/CMakeLists.txt b/testing/unit_tests/CMakeLists.txt index 099e87b213..d6bed33905 100644 --- a/testing/unit_tests/CMakeLists.txt +++ b/testing/unit_tests/CMakeLists.txt @@ -73,11 +73,19 @@ gtest_discover_tests(mrtrix-unit-tests include(BashTests) function (add_bash_unit_test FILE_SRC) get_filename_component(NAME ${FILE_SRC} NAME_WE) + # Forward the NO_FILESYSTEM_LOCK opt-out keyword for tests that never write to disk. + set(no_filesystem_lock "") + foreach(arg ${ARGN}) + if(arg STREQUAL "NO_FILESYSTEM_LOCK") + set(no_filesystem_lock NO_FILESYSTEM_LOCK) + endif() + endforeach() add_bash_test( FILE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/${FILE_SRC}" PREFIX "unittest" WORKING_DIRECTORY ${DATA_DIR} EXEC_DIRECTORIES "${EXEC_DIRS}" LABELS "unittest;${NAME}" + ${no_filesystem_lock} ) endfunction() From 6a4e7b4aa67b85fe21eccaa627e0bc4efe91122e Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Wed, 3 Jun 2026 21:09:51 +1000 Subject: [PATCH 2/2] Avoid filesystem locks in Python command tests via output piping Audited every Bash test of the Python commands for the pattern where the command under test is run solely to write a single output image that is then fed to a single evaluation command. In each such case the intermediate file was eliminated by piping the command output directly into the testing command via the "-" sentinel, allowing the test to be annotated NO_FILESYSTEM_LOCK in testing/scripts/CMakeLists.txt since it no longer touches disk. Twenty-four tests across 5ttgen, dwi2mask, dwinormalise, labelsgmfirst and mask2glass were converted. The dedicated 5ttgen/hsvs_piping test was then removed as redundant, as the transformed hsvs_default now exercises the identical output-piping pipeline and hsvs has no pipeable image input. Session prompts: 1. > Perform an audit of all Bash tests of Python commands. In all circumstances > where the command is simply run to generate a singular output image file, > and that file is then passed as input to a singular test evaluation command, > replace the saving and loading of that image file with the MRtrix3 temporary > image sentinel "-" and join the two commands with a Unix pipe, and then set > property NO_FILESYSTEM_LOCK for that test in testing/scripts/CMakeLists.txt. 2. > Check all Python command Bash tests for redundancy with respect to > command-line piping. If the modifications from the prior prompt, leading to > the use of piping of an output image to a testing command in order to no > longer require a filesystem lock, results in redundancy between a test whose > primary purpose is to ensure correct operation of image piping for that > particular command, then the test dedicated to evaluation of command-line > piping should be removed. Generated-by: Claude Opus 4.8 (1M context) --- testing/scripts/CMakeLists.txt | 49 +++++++++---------- .../tests/5ttgen/deepatropos_fromprob_default | 4 +- .../5ttgen/deepatropos_fromprob_whitestem | 4 +- .../tests/5ttgen/deepatropos_fromseg_default | 4 +- .../5ttgen/deepatropos_fromseg_whitestem | 4 +- .../scripts/tests/5ttgen/freesurfer_default | 4 +- .../scripts/tests/5ttgen/freesurfer_nocrop | 4 +- .../tests/5ttgen/freesurfer_sgmamyghipp | 4 +- testing/scripts/tests/5ttgen/fsl_mask | 4 +- testing/scripts/tests/5ttgen/fsl_nocrop | 4 +- testing/scripts/tests/5ttgen/hsvs_aseg | 4 +- testing/scripts/tests/5ttgen/hsvs_default | 4 +- testing/scripts/tests/5ttgen/hsvs_first | 4 +- testing/scripts/tests/5ttgen/hsvs_modules | 4 +- testing/scripts/tests/5ttgen/hsvs_piping | 7 --- testing/scripts/tests/5ttgen/hsvs_template | 4 +- testing/scripts/tests/5ttgen/hsvs_whitestem | 4 +- testing/scripts/tests/dwi2mask/legacy_default | 7 ++- testing/scripts/tests/dwi2mask/mean_default | 7 ++- testing/scripts/tests/dwi2mask/trace_default | 7 ++- .../scripts/tests/dwi2mask/trace_iterative | 7 ++- .../tests/dwinormalise/manual_percentile | 7 ++- testing/scripts/tests/labelsgmfirst/default | 4 +- .../scripts/tests/labelsgmfirst/freesurfer | 4 +- .../scripts/tests/labelsgmfirst/sgm_amyg_hipp | 4 +- testing/scripts/tests/mask2glass/default | 4 +- 26 files changed, 77 insertions(+), 90 deletions(-) delete mode 100644 testing/scripts/tests/5ttgen/hsvs_piping diff --git a/testing/scripts/CMakeLists.txt b/testing/scripts/CMakeLists.txt index ca7f6a6fa4..df6ff25cd8 100644 --- a/testing/scripts/CMakeLists.txt +++ b/testing/scripts/CMakeLists.txt @@ -35,30 +35,29 @@ function(add_bash_script_test file_path) ) endfunction() -add_bash_script_test(5ttgen/deepatropos_fromseg_default "pythonci") -add_bash_script_test(5ttgen/deepatropos_fromseg_whitestem) -add_bash_script_test(5ttgen/deepatropos_fromprob_default "pythonci") -add_bash_script_test(5ttgen/deepatropos_fromprob_whitestem) -add_bash_script_test(5ttgen/freesurfer_default "pythonci") -add_bash_script_test(5ttgen/freesurfer_nocrop) +add_bash_script_test(5ttgen/deepatropos_fromseg_default "pythonci" NO_FILESYSTEM_LOCK) +add_bash_script_test(5ttgen/deepatropos_fromseg_whitestem NO_FILESYSTEM_LOCK) +add_bash_script_test(5ttgen/deepatropos_fromprob_default "pythonci" NO_FILESYSTEM_LOCK) +add_bash_script_test(5ttgen/deepatropos_fromprob_whitestem NO_FILESYSTEM_LOCK) +add_bash_script_test(5ttgen/freesurfer_default "pythonci" NO_FILESYSTEM_LOCK) +add_bash_script_test(5ttgen/freesurfer_nocrop NO_FILESYSTEM_LOCK) add_bash_script_test(5ttgen/freesurfer_piping NO_FILESYSTEM_LOCK) -add_bash_script_test(5ttgen/freesurfer_sgmamyghipp) +add_bash_script_test(5ttgen/freesurfer_sgmamyghipp NO_FILESYSTEM_LOCK) add_bash_script_test(5ttgen/freesurfer_whitespace) add_bash_script_test(5ttgen/fsl_default) -add_bash_script_test(5ttgen/fsl_mask) -add_bash_script_test(5ttgen/fsl_nocrop) +add_bash_script_test(5ttgen/fsl_mask NO_FILESYSTEM_LOCK) +add_bash_script_test(5ttgen/fsl_nocrop NO_FILESYSTEM_LOCK) add_bash_script_test(5ttgen/fsl_piping) add_bash_script_test(5ttgen/fsl_premasked) add_bash_script_test(5ttgen/fsl_sgmamyghipp) add_bash_script_test(5ttgen/fsl_whitespace) -add_bash_script_test(5ttgen/hsvs_aseg) -add_bash_script_test(5ttgen/hsvs_default) -add_bash_script_test(5ttgen/hsvs_first) -add_bash_script_test(5ttgen/hsvs_modules) -add_bash_script_test(5ttgen/hsvs_piping NO_FILESYSTEM_LOCK) -add_bash_script_test(5ttgen/hsvs_template) +add_bash_script_test(5ttgen/hsvs_aseg NO_FILESYSTEM_LOCK) +add_bash_script_test(5ttgen/hsvs_default NO_FILESYSTEM_LOCK) +add_bash_script_test(5ttgen/hsvs_first NO_FILESYSTEM_LOCK) +add_bash_script_test(5ttgen/hsvs_modules NO_FILESYSTEM_LOCK) +add_bash_script_test(5ttgen/hsvs_template NO_FILESYSTEM_LOCK) add_bash_script_test(5ttgen/hsvs_whitespace) -add_bash_script_test(5ttgen/hsvs_whitestem) +add_bash_script_test(5ttgen/hsvs_whitestem NO_FILESYSTEM_LOCK) add_bash_script_test(dwi2mask/3dautomask_default) add_bash_script_test(dwi2mask/3dautomask_options) @@ -94,10 +93,10 @@ add_bash_script_test(dwi2mask/fslbet_whitespace) add_bash_script_test(dwi2mask/hdbet_default) add_bash_script_test(dwi2mask/hdbet_piping) add_bash_script_test(dwi2mask/hdbet_whitespace) -add_bash_script_test(dwi2mask/legacy_default "pythonci") +add_bash_script_test(dwi2mask/legacy_default "pythonci" NO_FILESYSTEM_LOCK) add_bash_script_test(dwi2mask/legacy_piping NO_FILESYSTEM_LOCK) add_bash_script_test(dwi2mask/legacy_whitespace) -add_bash_script_test(dwi2mask/mean_default "pythonci") +add_bash_script_test(dwi2mask/mean_default "pythonci" NO_FILESYSTEM_LOCK) add_bash_script_test(dwi2mask/mean_piping NO_FILESYSTEM_LOCK) add_bash_script_test(dwi2mask/mean_whitespace) add_bash_script_test(dwi2mask/mtnorm_default "pythonci") @@ -109,8 +108,8 @@ add_bash_script_test(dwi2mask/synthstrip_default) add_bash_script_test(dwi2mask/synthstrip_options) add_bash_script_test(dwi2mask/synthstrip_piping) add_bash_script_test(dwi2mask/synthstrip_whitespace) -add_bash_script_test(dwi2mask/trace_default "pythonci") -add_bash_script_test(dwi2mask/trace_iterative) +add_bash_script_test(dwi2mask/trace_default "pythonci" NO_FILESYSTEM_LOCK) +add_bash_script_test(dwi2mask/trace_iterative NO_FILESYSTEM_LOCK) add_bash_script_test(dwi2mask/trace_piping NO_FILESYSTEM_LOCK) add_bash_script_test(dwi2mask/trace_whitespace) @@ -224,7 +223,7 @@ add_bash_script_test(dwinormalise/group_default "pythonci") add_bash_script_test(dwinormalise/group_piping) add_bash_script_test(dwinormalise/group_whitespace) add_bash_script_test(dwinormalise/manual_default "pythonci") -add_bash_script_test(dwinormalise/manual_percentile) +add_bash_script_test(dwinormalise/manual_percentile NO_FILESYSTEM_LOCK) add_bash_script_test(dwinormalise/manual_piping) add_bash_script_test(dwinormalise/manual_whitespace) add_bash_script_test(dwinormalise/mtnorm_default "pythonci") @@ -244,14 +243,14 @@ add_bash_script_test(for_each/echo "pythonci") add_bash_script_test(for_each/exclude "pythonci") add_bash_script_test(for_each/parallel "pythonci") -add_bash_script_test(labelsgmfirst/default) -add_bash_script_test(labelsgmfirst/freesurfer) +add_bash_script_test(labelsgmfirst/default NO_FILESYSTEM_LOCK) +add_bash_script_test(labelsgmfirst/freesurfer NO_FILESYSTEM_LOCK) add_bash_script_test(labelsgmfirst/piping) add_bash_script_test(labelsgmfirst/premasked) -add_bash_script_test(labelsgmfirst/sgm_amyg_hipp) +add_bash_script_test(labelsgmfirst/sgm_amyg_hipp NO_FILESYSTEM_LOCK) add_bash_script_test(labelsgmfirst/whitespace) -add_bash_script_test(mask2glass/default "pythonci") +add_bash_script_test(mask2glass/default "pythonci" NO_FILESYSTEM_LOCK) add_bash_script_test(mask2glass/no4dseries "pythonci") add_bash_script_test(mask2glass/piping NO_FILESYSTEM_LOCK) add_bash_script_test(mask2glass/whitespace) diff --git a/testing/scripts/tests/5ttgen/deepatropos_fromprob_default b/testing/scripts/tests/5ttgen/deepatropos_fromprob_default index 5778dd6eb3..ac2e95dea1 100644 --- a/testing/scripts/tests/5ttgen/deepatropos_fromprob_default +++ b/testing/scripts/tests/5ttgen/deepatropos_fromprob_default @@ -2,5 +2,5 @@ # Verify default operation of "5ttgen deep_atropos" # where the input is the concatenation of tissue probability images # Outcome is compared to that generated using a prior software version -5ttgen deep_atropos 5ttgen/deep_atropos/probability_images.nii.gz tmp.mif -force -testing_diff_image tmp.mif 5ttgen/deep_atropos/fromprob_default.mif.gz +5ttgen deep_atropos 5ttgen/deep_atropos/probability_images.nii.gz - | \ +testing_diff_image - 5ttgen/deep_atropos/fromprob_default.mif.gz diff --git a/testing/scripts/tests/5ttgen/deepatropos_fromprob_whitestem b/testing/scripts/tests/5ttgen/deepatropos_fromprob_whitestem index 2ec776a17b..dc80ff6737 100644 --- a/testing/scripts/tests/5ttgen/deepatropos_fromprob_whitestem +++ b/testing/scripts/tests/5ttgen/deepatropos_fromprob_whitestem @@ -3,5 +3,5 @@ # where the input is the concatenation of tissue probability images # and the brain stem is allocated to WM rather than 5th volume # Outcome is compared to that generated using a prior software version -5ttgen deep_atropos 5ttgen/deep_atropos/probability_images.nii.gz tmp.mif -white_stem -force -testing_diff_image tmp.mif 5ttgen/deep_atropos/fromprob_whitestem.mif.gz +5ttgen deep_atropos 5ttgen/deep_atropos/probability_images.nii.gz - -white_stem | \ +testing_diff_image - 5ttgen/deep_atropos/fromprob_whitestem.mif.gz diff --git a/testing/scripts/tests/5ttgen/deepatropos_fromseg_default b/testing/scripts/tests/5ttgen/deepatropos_fromseg_default index d8d1133536..e3552a665a 100644 --- a/testing/scripts/tests/5ttgen/deepatropos_fromseg_default +++ b/testing/scripts/tests/5ttgen/deepatropos_fromseg_default @@ -2,5 +2,5 @@ # Verify default operation of "5ttgen deep_atropos" # where input image is the segmentation label image # Outcome is compared to that generated using a prior software version -5ttgen deep_atropos 5ttgen/deep_atropos/segmentation_image.nii.gz tmp.mif -force -testing_diff_image tmp.mif 5ttgen/deep_atropos/fromseg_default.mif.gz +5ttgen deep_atropos 5ttgen/deep_atropos/segmentation_image.nii.gz - | \ +testing_diff_image - 5ttgen/deep_atropos/fromseg_default.mif.gz diff --git a/testing/scripts/tests/5ttgen/deepatropos_fromseg_whitestem b/testing/scripts/tests/5ttgen/deepatropos_fromseg_whitestem index 5c6994d9a1..242291bd39 100644 --- a/testing/scripts/tests/5ttgen/deepatropos_fromseg_whitestem +++ b/testing/scripts/tests/5ttgen/deepatropos_fromseg_whitestem @@ -3,5 +3,5 @@ # where input image is the segmentation label image # and the brain stem is allocated to WM rather than 5th volume # Outcome is compared to that generated using a prior software version -5ttgen deep_atropos 5ttgen/deep_atropos/segmentation_image.nii.gz tmp.mif -white_stem -force -testing_diff_image tmp.mif 5ttgen/deep_atropos/fromseg_whitestem.mif.gz +5ttgen deep_atropos 5ttgen/deep_atropos/segmentation_image.nii.gz - -white_stem | \ +testing_diff_image - 5ttgen/deep_atropos/fromseg_whitestem.mif.gz diff --git a/testing/scripts/tests/5ttgen/freesurfer_default b/testing/scripts/tests/5ttgen/freesurfer_default index c21e4389be..e6a8e2ae7f 100644 --- a/testing/scripts/tests/5ttgen/freesurfer_default +++ b/testing/scripts/tests/5ttgen/freesurfer_default @@ -1,5 +1,5 @@ #!/bin/bash # Verify default operation of "5ttgen freesurfer" # Outcome is compared to that generated using a prior software version -5ttgen freesurfer BIDS/sub-01/anat/aparc+aseg.mgz tmp.mif -force -testing_diff_image tmp.mif 5ttgen/freesurfer/default.mif.gz +5ttgen freesurfer BIDS/sub-01/anat/aparc+aseg.mgz - | \ +testing_diff_image - 5ttgen/freesurfer/default.mif.gz diff --git a/testing/scripts/tests/5ttgen/freesurfer_nocrop b/testing/scripts/tests/5ttgen/freesurfer_nocrop index cebf875a18..3c6dcc2006 100644 --- a/testing/scripts/tests/5ttgen/freesurfer_nocrop +++ b/testing/scripts/tests/5ttgen/freesurfer_nocrop @@ -1,4 +1,4 @@ #!/bin/bash # Verify "5ttgen freesurfer" operation when the -nocrop option is specified -5ttgen freesurfer BIDS/sub-01/anat/aparc+aseg.mgz tmp.mif -nocrop -force -testing_diff_image tmp.mif 5ttgen/freesurfer/nocrop.mif.gz +5ttgen freesurfer BIDS/sub-01/anat/aparc+aseg.mgz - -nocrop | \ +testing_diff_image - 5ttgen/freesurfer/nocrop.mif.gz diff --git a/testing/scripts/tests/5ttgen/freesurfer_sgmamyghipp b/testing/scripts/tests/5ttgen/freesurfer_sgmamyghipp index b43995d869..a25435f532 100644 --- a/testing/scripts/tests/5ttgen/freesurfer_sgmamyghipp +++ b/testing/scripts/tests/5ttgen/freesurfer_sgmamyghipp @@ -1,4 +1,4 @@ #!/bin/bash # Verify "5ttgen freesurfer" operation when the -sgm_amyg_hipp option is specified -5ttgen freesurfer BIDS/sub-01/anat/aparc+aseg.mgz tmp.mif -sgm_amyg_hipp -force -testing_diff_image tmp.mif 5ttgen/freesurfer/sgm_amyg_hipp.mif.gz +5ttgen freesurfer BIDS/sub-01/anat/aparc+aseg.mgz - -sgm_amyg_hipp | \ +testing_diff_image - 5ttgen/freesurfer/sgm_amyg_hipp.mif.gz diff --git a/testing/scripts/tests/5ttgen/fsl_mask b/testing/scripts/tests/5ttgen/fsl_mask index b60b724f49..5a8b596f76 100644 --- a/testing/scripts/tests/5ttgen/fsl_mask +++ b/testing/scripts/tests/5ttgen/fsl_mask @@ -5,5 +5,5 @@ # as such, the slight change in outcomes of the standard_space_roi command # between FSL versions does not affect the outcome of the 5ttgen fsl command. # As such, the outcome can be directly compared to that computed using a prior MRtrix3 version -5ttgen fsl BIDS/sub-01/anat/sub-01_T1w.nii.gz tmp.mif -mask BIDS/sub-01/anat/sub-01_brainmask.nii.gz -force -testing_diff_header tmp.mif 5ttgen/fsl/masked.mif.gz +5ttgen fsl BIDS/sub-01/anat/sub-01_T1w.nii.gz - -mask BIDS/sub-01/anat/sub-01_brainmask.nii.gz | \ +testing_diff_header - 5ttgen/fsl/masked.mif.gz diff --git a/testing/scripts/tests/5ttgen/fsl_nocrop b/testing/scripts/tests/5ttgen/fsl_nocrop index dbec9a1997..6e0a742595 100644 --- a/testing/scripts/tests/5ttgen/fsl_nocrop +++ b/testing/scripts/tests/5ttgen/fsl_nocrop @@ -1,4 +1,4 @@ #!/bin/bash # Verify "5ttgen fsl" operation when the -nocrop option is specified -5ttgen fsl BIDS/sub-01/anat/sub-01_T1w.nii.gz tmp.mif -nocrop -force -testing_diff_header tmp.mif 5ttgen/fsl/nocrop.mif.gz +5ttgen fsl BIDS/sub-01/anat/sub-01_T1w.nii.gz - -nocrop | \ +testing_diff_header - 5ttgen/fsl/nocrop.mif.gz diff --git a/testing/scripts/tests/5ttgen/hsvs_aseg b/testing/scripts/tests/5ttgen/hsvs_aseg index f6a6b402aa..66a0fe9710 100644 --- a/testing/scripts/tests/5ttgen/hsvs_aseg +++ b/testing/scripts/tests/5ttgen/hsvs_aseg @@ -1,5 +1,5 @@ #!/bin/bash # Verify "5ttgen hsvs" operation when the segmentation of hippocampi and thalami # are explicitly requested to be pulled from the FreeSurfer aseg image -5ttgen hsvs freesurfer/sub-01 tmp.mif -hippocampi aseg -thalami aseg -force -testing_diff_header tmp.mif 5ttgen/hsvs/aseg.mif.gz +5ttgen hsvs freesurfer/sub-01 - -hippocampi aseg -thalami aseg | \ +testing_diff_header - 5ttgen/hsvs/aseg.mif.gz diff --git a/testing/scripts/tests/5ttgen/hsvs_default b/testing/scripts/tests/5ttgen/hsvs_default index 1fc5d04e04..6a0f3e4410 100644 --- a/testing/scripts/tests/5ttgen/hsvs_default +++ b/testing/scripts/tests/5ttgen/hsvs_default @@ -1,4 +1,4 @@ #!/bin/bash # Verify "5ttgen hsvs" algorithm under default usage -5ttgen hsvs freesurfer/sub-01 tmp.mif -force -testing_diff_header tmp.mif 5ttgen/hsvs/default.mif.gz +5ttgen hsvs freesurfer/sub-01 - | \ +testing_diff_header - 5ttgen/hsvs/default.mif.gz diff --git a/testing/scripts/tests/5ttgen/hsvs_first b/testing/scripts/tests/5ttgen/hsvs_first index d1f9da27b6..de0d5feff2 100644 --- a/testing/scripts/tests/5ttgen/hsvs_first +++ b/testing/scripts/tests/5ttgen/hsvs_first @@ -1,5 +1,5 @@ #!/bin/bash # Verify "5ttgen hsvs" operation when the segmentation of hippocampi and thalami # are explicitly requested to be performed using FSL FIRST -5ttgen hsvs freesurfer/sub-01 tmp.mif -hippocampi first -thalami first -force -testing_diff_header tmp.mif 5ttgen/hsvs/first.mif.gz +5ttgen hsvs freesurfer/sub-01 - -hippocampi first -thalami first | \ +testing_diff_header - 5ttgen/hsvs/first.mif.gz diff --git a/testing/scripts/tests/5ttgen/hsvs_modules b/testing/scripts/tests/5ttgen/hsvs_modules index 1f3bb2e8e1..efcd656d98 100644 --- a/testing/scripts/tests/5ttgen/hsvs_modules +++ b/testing/scripts/tests/5ttgen/hsvs_modules @@ -1,5 +1,5 @@ #!/bin/bash # Verify "5ttgen hsvs" operation when it is explicitly requested that # FreeSurfer sub-cortical gray matter nuclei segmentation modules are utilised -5ttgen hsvs freesurfer/sub-01 tmp.mif -hippocampi subfields -thalami nuclei -force -testing_diff_header tmp.mif 5ttgen/hsvs/modules.mif.gz +5ttgen hsvs freesurfer/sub-01 - -hippocampi subfields -thalami nuclei | \ +testing_diff_header - 5ttgen/hsvs/modules.mif.gz diff --git a/testing/scripts/tests/5ttgen/hsvs_piping b/testing/scripts/tests/5ttgen/hsvs_piping deleted file mode 100644 index fdf006e4a2..0000000000 --- a/testing/scripts/tests/5ttgen/hsvs_piping +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -# Ensure correct operation of the "5ttgen hsvs" command -# where the output image is sent down a pipe to a subsequent command -# There is no possibility of input piping to this command -# given that the input is a directory rather than an image -5ttgen hsvs freesurfer/sub-01 - | \ -testing_diff_header - 5ttgen/hsvs/default.mif.gz diff --git a/testing/scripts/tests/5ttgen/hsvs_template b/testing/scripts/tests/5ttgen/hsvs_template index 173079119c..2997352274 100644 --- a/testing/scripts/tests/5ttgen/hsvs_template +++ b/testing/scripts/tests/5ttgen/hsvs_template @@ -1,4 +1,4 @@ #!/bin/bash # Verify "5ttgen hsvs" operation when the 5TT image is generated on a user-specified template voxel grid -5ttgen hsvs freesurfer/sub-01 tmp.mif -template BIDS/sub-01/anat/sub-01_T1w.nii.gz -force -testing_diff_header tmp.mif 5ttgen/hsvs/template.mif.gz +5ttgen hsvs freesurfer/sub-01 - -template BIDS/sub-01/anat/sub-01_T1w.nii.gz | \ +testing_diff_header - 5ttgen/hsvs/template.mif.gz diff --git a/testing/scripts/tests/5ttgen/hsvs_whitestem b/testing/scripts/tests/5ttgen/hsvs_whitestem index 1a76978abb..8e85f71abd 100644 --- a/testing/scripts/tests/5ttgen/hsvs_whitestem +++ b/testing/scripts/tests/5ttgen/hsvs_whitestem @@ -1,4 +1,4 @@ #!/bin/bash # Verify "5ttgen hsvs" command when command-line flag "-white_stem" is specified -5ttgen hsvs freesurfer/sub-01 tmp.mif -white_stem -force -testing_diff_header tmp.mif 5ttgen/hsvs/white_stem.mif.gz +5ttgen hsvs freesurfer/sub-01 - -white_stem | \ +testing_diff_header - 5ttgen/hsvs/white_stem.mif.gz diff --git a/testing/scripts/tests/dwi2mask/legacy_default b/testing/scripts/tests/dwi2mask/legacy_default index e2c353d851..1a2f7fc051 100644 --- a/testing/scripts/tests/dwi2mask/legacy_default +++ b/testing/scripts/tests/dwi2mask/legacy_default @@ -4,7 +4,6 @@ # from software versions 3.0.x, # however it is reimplemented in Python # The outcome is compared to what was generated from the obsolete C++ binary -dwi2mask legacy BIDS/sub-01/dwi/sub-01_dwi.nii.gz tmp.mif -force \ --fslgrad BIDS/sub-01/dwi/sub-01_dwi.bvec BIDS/sub-01/dwi/sub-01_dwi.bval - -testing_diff_image tmp.mif dwi2mask/legacy.mif.gz +dwi2mask legacy BIDS/sub-01/dwi/sub-01_dwi.nii.gz - \ +-fslgrad BIDS/sub-01/dwi/sub-01_dwi.bvec BIDS/sub-01/dwi/sub-01_dwi.bval | \ +testing_diff_image - dwi2mask/legacy.mif.gz diff --git a/testing/scripts/tests/dwi2mask/mean_default b/testing/scripts/tests/dwi2mask/mean_default index d910f87e3e..f0ae126fa4 100644 --- a/testing/scripts/tests/dwi2mask/mean_default +++ b/testing/scripts/tests/dwi2mask/mean_default @@ -1,7 +1,6 @@ #!/bin/bash # Verify "dwi2mask mean" algorithm # under default operation -dwi2mask mean BIDS/sub-01/dwi/sub-01_dwi.nii.gz tmp.mif -force \ --fslgrad BIDS/sub-01/dwi/sub-01_dwi.bvec BIDS/sub-01/dwi/sub-01_dwi.bval - -testing_diff_image tmp.mif dwi2mask/mean.mif.gz +dwi2mask mean BIDS/sub-01/dwi/sub-01_dwi.nii.gz - \ +-fslgrad BIDS/sub-01/dwi/sub-01_dwi.bvec BIDS/sub-01/dwi/sub-01_dwi.bval | \ +testing_diff_image - dwi2mask/mean.mif.gz diff --git a/testing/scripts/tests/dwi2mask/trace_default b/testing/scripts/tests/dwi2mask/trace_default index 21ec60a6f2..a80a1c722f 100644 --- a/testing/scripts/tests/dwi2mask/trace_default +++ b/testing/scripts/tests/dwi2mask/trace_default @@ -1,7 +1,6 @@ #!/bin/bash # Verify result of "dwi2mask trace" algorithm # when executed under default behaviour -dwi2mask trace BIDS/sub-01/dwi/sub-01_dwi.nii.gz tmp.mif -force \ --fslgrad BIDS/sub-01/dwi/sub-01_dwi.bvec BIDS/sub-01/dwi/sub-01_dwi.bval - -testing_diff_image tmp.mif dwi2mask/trace_default.mif.gz +dwi2mask trace BIDS/sub-01/dwi/sub-01_dwi.nii.gz - \ +-fslgrad BIDS/sub-01/dwi/sub-01_dwi.bvec BIDS/sub-01/dwi/sub-01_dwi.bval | \ +testing_diff_image - dwi2mask/trace_default.mif.gz diff --git a/testing/scripts/tests/dwi2mask/trace_iterative b/testing/scripts/tests/dwi2mask/trace_iterative index a4ad38fa84..d64c96babb 100644 --- a/testing/scripts/tests/dwi2mask/trace_iterative +++ b/testing/scripts/tests/dwi2mask/trace_iterative @@ -1,8 +1,7 @@ #!/bin/bash # Verify result of "dwi2mask trace" algorithm, # when the iterative optimisation algorithm is engaged -dwi2mask trace BIDS/sub-01/dwi/sub-01_dwi.nii.gz tmp.mif -force \ +dwi2mask trace BIDS/sub-01/dwi/sub-01_dwi.nii.gz - \ -fslgrad BIDS/sub-01/dwi/sub-01_dwi.bvec BIDS/sub-01/dwi/sub-01_dwi.bval \ --iterative - -testing_diff_image tmp.mif dwi2mask/trace_iterative.mif.gz +-iterative | \ +testing_diff_image - dwi2mask/trace_iterative.mif.gz diff --git a/testing/scripts/tests/dwinormalise/manual_percentile b/testing/scripts/tests/dwinormalise/manual_percentile index a6760d873e..91281f6048 100644 --- a/testing/scripts/tests/dwinormalise/manual_percentile +++ b/testing/scripts/tests/dwinormalise/manual_percentile @@ -1,8 +1,7 @@ #!/bin/bash # Test operation of the "dwinormalise manual" algorithm # when the -percentile option is specified to modulate which statistic is used to map to the reference intensity -dwinormalise manual BIDS/sub-01/dwi/sub-01_dwi.nii.gz BIDS/sub-01/dwi/sub-01_brainmask.nii.gz tmp.mif -force \ +dwinormalise manual BIDS/sub-01/dwi/sub-01_dwi.nii.gz BIDS/sub-01/dwi/sub-01_brainmask.nii.gz - \ -fslgrad BIDS/sub-01/dwi/sub-01_dwi.bvec BIDS/sub-01/dwi/sub-01_dwi.bval \ --percentile 40 - -testing_diff_image tmp.mif dwinormalise/manual/percentile.mif.gz -frac 1e-5 +-percentile 40 | \ +testing_diff_image - dwinormalise/manual/percentile.mif.gz -frac 1e-5 diff --git a/testing/scripts/tests/labelsgmfirst/default b/testing/scripts/tests/labelsgmfirst/default index 88b909700c..3153d215e8 100644 --- a/testing/scripts/tests/labelsgmfirst/default +++ b/testing/scripts/tests/labelsgmfirst/default @@ -1,5 +1,5 @@ #!/bin/bash # Verify operation on data where the input parcellation image # already has indices incrementing sequentially from 1 -labelsgmfirst BIDS/sub-01/anat/sub-01_parc-desikan_indices.nii.gz BIDS/sub-01/anat/sub-01_T1w.nii.gz BIDS/parc-desikan_lookup.txt tmp.mif -force -testing_diff_header tmp.mif labelsgmfirst/default.mif.gz +labelsgmfirst BIDS/sub-01/anat/sub-01_parc-desikan_indices.nii.gz BIDS/sub-01/anat/sub-01_T1w.nii.gz BIDS/parc-desikan_lookup.txt - | \ +testing_diff_header - labelsgmfirst/default.mif.gz diff --git a/testing/scripts/tests/labelsgmfirst/freesurfer b/testing/scripts/tests/labelsgmfirst/freesurfer index 46f024d0fd..35ad9873a3 100644 --- a/testing/scripts/tests/labelsgmfirst/freesurfer +++ b/testing/scripts/tests/labelsgmfirst/freesurfer @@ -1,5 +1,5 @@ #!/bin/bash # Verify operation where the input parcellation image comes directly from FreeSurfer, # with parcel indices defined by lookup table FreeSurferColorLUT.txt -labelsgmfirst BIDS/sub-01/anat/aparc+aseg.mgz BIDS/sub-01/anat/sub-01_T1w.nii.gz labelsgmfirst/FreeSurferColorLUT.txt tmp.mif -force -testing_diff_header tmp.mif labelsgmfirst/freesurfer.mif.gz +labelsgmfirst BIDS/sub-01/anat/aparc+aseg.mgz BIDS/sub-01/anat/sub-01_T1w.nii.gz labelsgmfirst/FreeSurferColorLUT.txt - | \ +testing_diff_header - labelsgmfirst/freesurfer.mif.gz diff --git a/testing/scripts/tests/labelsgmfirst/sgm_amyg_hipp b/testing/scripts/tests/labelsgmfirst/sgm_amyg_hipp index 3222f29074..3e05dc9b01 100644 --- a/testing/scripts/tests/labelsgmfirst/sgm_amyg_hipp +++ b/testing/scripts/tests/labelsgmfirst/sgm_amyg_hipp @@ -1,5 +1,5 @@ #!/bin/bash # Test command execution when the -sgm_amyg_hipp command-line flag is specified, # such that the hippocampi and amygdalae are also substituted with estimates from FSL FIRST -labelsgmfirst BIDS/sub-01/anat/sub-01_parc-desikan_indices.nii.gz BIDS/sub-01/anat/sub-01_T1w.nii.gz BIDS/parc-desikan_lookup.txt tmp.mif -sgm_amyg_hipp -force -testing_diff_header tmp.mif labelsgmfirst/sgm_amyg_hipp.mif.gz +labelsgmfirst BIDS/sub-01/anat/sub-01_parc-desikan_indices.nii.gz BIDS/sub-01/anat/sub-01_T1w.nii.gz BIDS/parc-desikan_lookup.txt - -sgm_amyg_hipp | \ +testing_diff_header - labelsgmfirst/sgm_amyg_hipp.mif.gz diff --git a/testing/scripts/tests/mask2glass/default b/testing/scripts/tests/mask2glass/default index a2abd6e71d..0e50a20170 100644 --- a/testing/scripts/tests/mask2glass/default +++ b/testing/scripts/tests/mask2glass/default @@ -1,5 +1,5 @@ #!/bin/bash # Verify operation of the "mask2glass" command # under default operation -mask2glass BIDS/sub-01/dwi/sub-01_brainmask.nii.gz tmp.mif -force -testing_diff_image tmp.mif mask2glass/out.mif.gz +mask2glass BIDS/sub-01/dwi/sub-01_brainmask.nii.gz - | \ +testing_diff_image - mask2glass/out.mif.gz