Skip to content

Commit 66b000e

Browse files
committed
Squashed commit of the following:
commit e200e89 Author: Michael Hirsch <scivision@users.noreply.github.com> Date: Mon Nov 9 14:47:44 2020 -0500 add top level TestAll for Azure commit 9cf605d Author: Michael Hirsch <scivision@users.noreply.github.com> Date: Mon Nov 9 14:04:59 2020 -0500 ci: specify package name commit cc8882e Author: Michael Hirsch <scivision@users.noreply.github.com> Date: Mon Nov 9 13:51:04 2020 -0500 matlab azure ci
1 parent 7e3e7e6 commit 66b000e

File tree

5 files changed

+46
-1
lines changed

5 files changed

+46
-1
lines changed
File renamed without changes.

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
code-coverage/
2+
test-results/
3+
*.asv

Readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![DOI](https://zenodo.org/badge/273830124.svg)](https://zenodo.org/badge/latestdoi/273830124)
44
[![View matlab-hdf5 on File Exchange](https://www.mathworks.com/matlabcentral/images/matlab-file-exchange.svg)](https://www.mathworks.com/matlabcentral/fileexchange/78673-matlab-hdf5)
5-
[![Build Status](https://travis-ci.com/geospace-code/matlab-hdf5.svg?branch=master)](https://travis-ci.com/geospace-code/matlab-hdf5)
5+
[![Build Status](https://dev.azure.com/mhirsch0512/matlab-hdf5/_apis/build/status/geospace-code.matlab-hdf5?branchName=master)](https://dev.azure.com/mhirsch0512/matlab-hdf5/_build/latest?definitionId=18&branchName=master)
66

77
These HDF5 and NetCDF4 functions should be built into Matlab itself, but since they're not yet, we provide them.
88

TestAll.m

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
% this script is run on Azure (or locall)
2+
3+
import matlab.unittest.TestRunner;
4+
import matlab.unittest.Verbosity;
5+
import matlab.unittest.plugins.CodeCoveragePlugin;
6+
import matlab.unittest.plugins.XMLPlugin;
7+
import matlab.unittest.plugins.codecoverage.CoberturaFormat;
8+
9+
name = "hdf5nc";
10+
11+
suite = testsuite(name);
12+
13+
mkdir('code-coverage');
14+
mkdir('test-results');
15+
16+
runner = TestRunner.withTextOutput('OutputDetail', Verbosity.Detailed);
17+
runner.addPlugin(XMLPlugin.producingJUnitFormat('test-results/results.xml'));
18+
runner.addPlugin(CodeCoveragePlugin.forPackage(name, 'Producing', CoberturaFormat('code-coverage/coverage.xml')));
19+
20+
results = runner.run(suite);
21+
assert(~isempty(results), "no tests found")
22+
23+
nfailed = nnz([results.Failed]);
24+
assert(nfailed == 0, '%d test(s) failed.', nfailed)

azure-pipelines.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
pool:
2+
vmImage: ubuntu-latest
3+
steps:
4+
- task: InstallMATLAB@0
5+
inputs:
6+
release: R2020a
7+
- task: RunMATLABTests@0
8+
inputs:
9+
testResultsJUnit: test-results/results.xml
10+
codeCoverageCobertura: code-coverage/coverage.xml
11+
- task: PublishTestResults@2
12+
condition: succeededOrFailed()
13+
inputs:
14+
testResultsFiles: test-results/results.xml
15+
- task: PublishCodeCoverageResults@1
16+
inputs:
17+
codeCoverageTool: Cobertura
18+
summaryFileLocation: code-coverage/coverage.xml

0 commit comments

Comments
 (0)