Created
February 17, 2021 20:47
-
-
Save scivision/543a7fe2746379960959d78018963762 to your computer and use it in GitHub Desktop.
Matlab CI on Azure Pipelines
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pool: | |
vmImage: ubuntu-latest | |
steps: | |
- task: InstallMATLAB@0 | |
- task: RunMATLABCommand@0 | |
inputs: | |
command: TestAll | |
- task: PublishTestResults@2 | |
condition: succeededOrFailed() | |
inputs: | |
testResultsFiles: test-results/results.xml | |
- task: PublishCodeCoverageResults@1 | |
inputs: | |
codeCoverageTool: Cobertura | |
summaryFileLocation: code-coverage/coverage.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% this script is run on Azure (or local) | |
import matlab.unittest.TestRunner | |
import matlab.unittest.Verbosity | |
import matlab.unittest.plugins.CodeCoveragePlugin | |
import matlab.unittest.plugins.XMLPlugin | |
import matlab.unittest.plugins.codecoverage.CoberturaFormat | |
name = "MyProject"; | |
suite = testsuite(name); | |
runner = TestRunner.withTextOutput('OutputDetail', Verbosity.Detailed); | |
mkdir('code-coverage'); | |
mkdir('test-results'); | |
runner.addPlugin(XMLPlugin.producingJUnitFormat('test-results/results.xml')); | |
runner.addPlugin(CodeCoveragePlugin.forPackage(name, 'Producing', CoberturaFormat('code-coverage/coverage.xml'))); | |
results = runner.run(suite); | |
assert(~isempty(results), "no tests found") | |
assertSuccess(results) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment