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
291 stars 179 forks source link

Add argument to specify environment for bash tests #2845

Closed daljit46 closed 4 months ago

daljit46 commented 7 months ago

This adds a new function argument to add_bash_tests() to specify environment variables that should be defined for running a test. Usage example:

add_bash_tests(
    FILE_PATH file
    PREFIX script
    WORKING_DIRECTORY ${DATA_DIR}
    ENVIRONMENT "PYTHONPATH=${PROJECT_BINARY_DIR}/lib"
)

In #2678, the possibility of specifying PYTHONPATH for a given test seems to be useful. This PR addresses this need more generally, by allowing the specification of any environment variables when running a collection of tests specified in a text file.

@Lestropie this should be enough to address the issue raised, but let me know if this actually solves the problem.

github-actions[bot] commented 7 months ago

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

github-actions[bot] commented 7 months ago

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

github-actions[bot] commented 7 months ago

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

Lestropie commented 4 months ago

Included in merge of #2678.