diff --git a/.github/workflows/run_tests_matlab.yml b/.github/workflows/run_tests_matlab.yml index d6c1f34..cefaced 100644 --- a/.github/workflows/run_tests_matlab.yml +++ b/.github/workflows/run_tests_matlab.yml @@ -20,7 +20,7 @@ on: workflow_dispatch: jobs: - build: + tests_matlab: runs-on: ubuntu-20.04 steps: diff --git a/tests/test_copyAtlasToSpmDir.m b/tests/test_copyAtlasToSpmDir.m new file mode 100644 index 0000000..7f6634e --- /dev/null +++ b/tests/test_copyAtlasToSpmDir.m @@ -0,0 +1,26 @@ +function test_suite = test_copyAtlasToSpmDir %#ok<*STOUT> + % (C) Copyright 2022 CPP ROI developers + try % assignment of 'localfunctions' is necessary in Matlab >= 2016 + test_functions = localfunctions(); %#ok<*NASGU> + catch % no problem; early Matlab versions can use initTestSuite fine + end + initTestSuite; +end + +function test_copyAtlasToSpmDir_basic() + + if isGithubCi() + return + end + + copyAtlasToSpmDir('AAL', 'verbose', false); + + spmAtlasDir = fullfile(spm('dir'), 'atlas'); + + targetAtlasImage = fullfile(spmAtlasDir, 'AAL3v1_1mm.nii'); + targetAtlasXml = fullfile(spmAtlasDir, 'AAL3v1_1mm.xml'); + + assertEqual(exist(targetAtlasImage, 'file'), 2); + assertEqual(exist(targetAtlasXml, 'file'), 2); + +end