Skip to content

Commit ab2352e

Browse files
committed
no coverage on windows
1 parent 87a5a09 commit ab2352e

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

.github/workflows/matlab_test_and_coverage.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,12 @@ jobs:
5959
}
6060
6161
- name: Code coverage
62+
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
63+
# no coverage on windows as long as MOcov does not support it
64+
# see https://github.com/MOcov/MOcov/issues/28
6265
uses: codecov/codecov-action@v3
6366
with:
6467
file: coverage.xml # optional
65-
flags: matlab # optional
68+
flags: ${{ matrix.os }}_matlab-${{ matrix.version }}
6669
name: codecov-umbrella # optional
6770
fail_ci_if_error: true # optional (default = false)

run_tests.m

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,19 @@ function run_tests()
1717
folder_to_cover = fullfile(pwd, 'src');
1818

1919
test_folder = fullfile(pwd, 'tests');
20+
21+
addpath(genpath(folder_to_cover));
2022

21-
success = moxunit_runtests(test_folder, ...
22-
'-verbose', '-recursive', '-with_coverage', ...
23-
'-cover', folder_to_cover, ...
24-
'-cover_xml_file', 'coverage.xml', ...
25-
'-cover_html_dir', fullfile(pwd, 'coverage_html'));
23+
if ispc
24+
success = moxunit_runtests(test_folder);
25+
26+
else
27+
success = moxunit_runtests(test_folder, ...
28+
'-verbose', '-recursive', '-with_coverage', ...
29+
'-cover', folder_to_cover, ...
30+
'-cover_xml_file', 'coverage.xml', ...
31+
'-cover_html_dir', fullfile(pwd, 'coverage_html'));
32+
end
2633

2734
fileID = fopen('test_report.log', 'w');
2835
if success

0 commit comments

Comments
 (0)