Skip to content

Commit 4922936

Browse files
committed
infra - add tools to help local testing
1 parent ba39937 commit 4922936

File tree

4 files changed

+26
-14
lines changed

4 files changed

+26
-14
lines changed

.github/workflows/run_tests_matlab.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ on:
55
branches:
66
- dev
77
- main
8-
- master
98
pull_request:
109
branches: ['*']
1110
schedule:
@@ -41,8 +40,7 @@ jobs:
4140
git clone https://github.com/MOcov/MOcov.git --depth 1
4241
4342
- name: Add bids-matlab
44-
run: |
45-
git clone https://github.com/bids-standard/bids-matlab.git --depth 1
43+
run: make install_dev
4644

4745
- name: Run commands
4846
uses: matlab-actions/[email protected]

.gitignore

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,6 @@
99

1010
*.html
1111

12-
# files in the demo folder related to running the demo analysis
13-
# demos/roi
14-
15-
atlas/visual_topography_probability_atlas/
16-
17-
# test folder and dummy data
18-
1912
# ignore content of the build folder of the doc
2013
docs/build/*
2114

@@ -25,8 +18,17 @@ envs/*
2518
# visual studio code stuff
2619
.vscode
2720

21+
# files in the demo folder related to running the demo analysis
22+
# demos/roi
23+
24+
atlas/visual_topography_probability_atlas/
25+
2826
demos/*/*.json
2927
demos/*/*/*.json
3028
demos/*/derivatives
3129

3230
atlas/*.json
31+
32+
#for testing
33+
coveragage_html
34+
lib/bids-matlab

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.PHONY: clean install_dev
2+
3+
clean:
4+
rm -rf coverage*
5+
install_dev:
6+
git clone https://github.com/bids-standard/bids-matlab.git --branch dev --depth 1 lib/bids-matlab

run_tests.m

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,25 @@
66

77
spm('defaults', 'fMRI');
88

9-
testFolder = fullfile(fileparts(mfilename('fullpath')), 'tests');
9+
thisDir = fullfile(fileparts(mfilename('fullpath')));
10+
11+
testFolder = fullfile(thisDir, 'tests');
1012

1113
addpath(fullfile(testFolder, 'utils'));
12-
addpath(fullfile(fileparts(mfilename('fullpath')), 'atlas'));
14+
addpath(fullfile(thisDir, 'atlas'));
15+
16+
if isdir(fullfile(thisDir, 'lib', 'bids-matlab'))
17+
addpath(fullfile(thisDir, 'lib', 'bids-matlab'));
18+
end
1319

14-
folderToCover = fullfile(testFolder, '..', 'src');
20+
folderToCover = fullfile(thisDir, 'src');
1521

1622
success = moxunit_runtests( ...
1723
testFolder, ...
1824
'-verbose', '-recursive', '-with_coverage', ...
1925
'-cover', folderToCover, ...
2026
'-cover_xml_file', 'coverage.xml', ...
21-
'-cover_html_dir', fullfile(pwd, 'coverage_html'));
27+
'-cover_html_dir', fullfile(thisDir, 'coverage_html'));
2228

2329
if success
2430
system('echo 0 > test_report.log');

0 commit comments

Comments
 (0)