We use a series of unit and integration tests to make sure the code behaves as expected and to also help in development.
If you are not sure what unit and integration tests are, check the excellent chapter about that in the Turing way.
See HERE for general information on how to run the tests.
Helps to detect some very obvious bugs.
Mostly just smoke tests to do a dry run of the workflows with no actual assertions.
current lists of files with no assert:
╰─⠠⠵ grep -riL "assert" tests_*/
tests_batches/test_setBatchCoregistrationFmap.m
tests_batches/test_setBatchCreateVDMs.m
tests_unit/test_utils.m
tests_utils/test_elapsedTime.m
tests_workflows/test_bidsSegmentSkullStrip.m
tests_workflows/test_bidsLesionSegmentation.m
tests_workflows/test_bidsRename.m
tests_workflows/test_bidsSmoothing.m
tests_workflows/test_bidsRealignUnwarp.m
tests_workflows/test_bidsRealignReslice.m
There are a some help functions you need to be added to the Matlab / Octave path to run the tests:
addpath(fullfile('tests', 'utils'))
You need to run a bash script to create some empty data files:
From within the tests
folder.
make data
Once you have done this, run generateLayoutMat(true)
to generate the layout of
the tests datasets.
From the root folder of the bids-matlab folder, you can run the test with one the following commands.
% with coverage
run_tests
% without coverage
moxunit_runtests -recursive -verbose tests
% Or if you want more feedback
moxunit_runtests -verbose tests
% to run only subsets of tests indicate the folder or the file
% or run the test function file directly
moxunit_runtests -verbose tests/tests_unit
See HERE to add more tests