From d693a722ad6c92b445ef1f5862e096e6fa354a10 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Mon, 11 Jul 2022 21:00:19 +0200 Subject: [PATCH 1/3] add tests for copy atlas function --- tests/test_copyAtlasToSpmDir.m | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 tests/test_copyAtlasToSpmDir.m diff --git a/tests/test_copyAtlasToSpmDir.m b/tests/test_copyAtlasToSpmDir.m new file mode 100644 index 0000000..af83353 --- /dev/null +++ b/tests/test_copyAtlasToSpmDir.m @@ -0,0 +1,22 @@ +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() + + 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 From 63f3c1ee0abbea80ec8792cfbb54421ee4a6baef Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Mon, 11 Jul 2022 21:18:46 +0200 Subject: [PATCH 2/3] silence test in CI --- tests/test_copyAtlasToSpmDir.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/test_copyAtlasToSpmDir.m b/tests/test_copyAtlasToSpmDir.m index af83353..7f6634e 100644 --- a/tests/test_copyAtlasToSpmDir.m +++ b/tests/test_copyAtlasToSpmDir.m @@ -9,6 +9,10 @@ function test_copyAtlasToSpmDir_basic() + if isGithubCi() + return + end + copyAtlasToSpmDir('AAL', 'verbose', false); spmAtlasDir = fullfile(spm('dir'), 'atlas'); From 5af848e4a23a668cae0d646b456e66f55bb4a142 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Mon, 11 Jul 2022 21:19:26 +0200 Subject: [PATCH 3/3] FCI --- .github/workflows/run_tests_matlab.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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: