diff --git a/.github/workflows/run_tests_octave.yml b/.github/workflows/run_tests_octave.yml index 959cc9d..5d5641b 100644 --- a/.github/workflows/run_tests_octave.yml +++ b/.github/workflows/run_tests_octave.yml @@ -1,6 +1,9 @@ --- name: tests and coverage with octave +env: + OCTFLAGS: --no-gui --no-window-system --silent + concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true @@ -18,7 +21,7 @@ on: workflow_dispatch: jobs: - tests_matlab: + tests_octave: runs-on: ubuntu-latest steps: @@ -66,7 +69,6 @@ jobs: octave $OCTFLAGS --eval "addpath(fullfile(pwd, 'tests', 'utils')); savepath();" octave $OCTFLAGS --eval "cd(fullfile(getenv('GITHUB_WORKSPACE'), '.github', 'workflows')); run tests_matlab;" - - name: Code coverage uses: codecov/codecov-action@v4 with: diff --git a/.github/workflows/tests_matlab.m b/.github/workflows/tests_matlab.m index 21f8fb4..437e1d1 100644 --- a/.github/workflows/tests_matlab.m +++ b/.github/workflows/tests_matlab.m @@ -8,6 +8,7 @@ addpath(fullfile(root_dir, 'MOcov', 'MOcov')); cd(fullfile(root_dir, 'MOxUnit', 'MOxUnit')); +pwd; run moxunit_set_path(); cd(fullfile(root_dir)); diff --git a/src/atlas/extractRoiFromAtlas.m b/src/atlas/extractRoiFromAtlas.m index 0783d86..455a64c 100644 --- a/src/atlas/extractRoiFromAtlas.m +++ b/src/atlas/extractRoiFromAtlas.m @@ -39,9 +39,9 @@ args = inputParser; addRequired(args, 'outputDir', isChar); - addRequired(args, 'atlasName', @(x) isAKnownAtlas(x)); + addRequired(args, 'atlasName'); addRequired(args, 'roiName', isChar); - addRequired(args, 'hemisphere', @(x) ismember(x, {'L', 'R'})); + addRequired(args, 'hemisphere'); parse(args, varargin{:}); @@ -50,6 +50,15 @@ roiName = args.Results.roiName; hemisphere = args.Results.hemisphere; + if ~ismember(hemisphere, {'L', 'R'}) + msg = sprintf('"hemisphere must be "L" or "R"": %s\nGot: "%s"', ... + hemisphere); + bids.internal.error_handling(mfilename(), ... + 'invalidHemisphere', msg, false); + end + + isAKnownAtlas(atlasName); + [atlasFile, lut] = getAtlasAndLut(atlasName); switch lower(atlasName)