Skip to content

Commit 080dfe5

Browse files
committed
update test and CI
1 parent 482626d commit 080dfe5

File tree

4 files changed

+49
-5
lines changed

4 files changed

+49
-5
lines changed

.github/workflows/moxunit.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,19 @@ jobs:
1515
with:
1616
submodules: true
1717
fetch-depth: 1
18+
1819
- name: MOxUnit Action
19-
uses: joergbrech/moxunit-action@v1.1
20+
uses: joergbrech/moxunit-action@v1.2.0
2021
with:
2122
tests: tests
2223
src: subfun
24+
# add CPP_PTB to the path but don't include it the coverage
25+
ext: lib/CPP_PTB/src
26+
# Octave packages needed
27+
pkg: statistics
2328
with_coverage: true
2429
cover_xml_file: coverage.xml
30+
2531
- name: Code coverage
2632
uses: codecov/codecov-action@v1
2733
with:

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
*.tsv
77
*.mat
88

9+
% tests and coverage
10+
coverage*
11+
test_report.log
12+
913
output
1014

1115
## virtual env

runTests.m

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
function runTests()
2+
%
3+
% (C) Copyright 2022 CPP visual motion localizer developers
4+
5+
% Elapsed time is ??? seconds.
6+
7+
tic;
8+
9+
initEnv();
10+
11+
if bids.internal.is_github_ci
12+
fprintf(1, '\nThis is github CI\n');
13+
else
14+
fprintf(1, '\nThis is not github CI\n');
15+
end
16+
17+
fprintf('\nHome is %s\n', getenv('HOME'));
18+
19+
warning('OFF');
20+
21+
folderToCover = fullfile(pwd, 'subfun');
22+
testFolder = fullfile(pwd, 'tests');
23+
24+
success = moxunit_runtests(testFolder, ...
25+
'-verbose', '-recursive', '-with_coverage', ...
26+
'-cover', folderToCover, ...
27+
'-cover_xml_file', 'coverage.xml', ...
28+
'-cover_html_dir', fullfile(pwd, 'coverage_html'));
29+
30+
if success
31+
system('echo 0 > test_report.log');
32+
else
33+
system('echo 1 > test_report.log');
34+
end
35+
36+
toc;
37+
38+
end

tests/test_expDesign.m

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88

99
function test_exDesignBasic()
1010

11-
initEnv();
12-
1311
cfg.design.motionType = 'translation';
1412
cfg.design.motionDirections = [0 0 180 180];
1513
cfg.design.names = {'static'; 'motion'};
@@ -43,8 +41,6 @@ function test_exDesignBasic()
4341

4442
function test_exDesignBasicOtherSetUp()
4543

46-
initEnv();
47-
4844
cfg.design.motionType = 'translation';
4945
cfg.design.motionDirections = [0 90 180 270];
5046
cfg.design.names = {'static'; 'motion'};

0 commit comments

Comments
 (0)