https://github.com/mathworks/examplesdriventester
Examples driven tester is a tool for users which uses MATLAB® scripts which are already present in toolbox to provide a preliminary "smoke test" of the toolbox functionality.
https://github.com/mathworks/examplesdriventester
examples exampletesting matlab smoketesting testing
Last synced: 8 months ago
JSON representation
Examples driven tester is a tool for users which uses MATLAB® scripts which are already present in toolbox to provide a preliminary "smoke test" of the toolbox functionality.
- Host: GitHub
- URL: https://github.com/mathworks/examplesdriventester
- Owner: mathworks
- License: bsd-3-clause
- Created: 2023-11-23T04:33:42.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-10-07T05:26:37.000Z (9 months ago)
- Last Synced: 2025-10-07T07:12:32.594Z (9 months ago)
- Topics: examples, exampletesting, matlab, smoketesting, testing
- Language: MATLAB
- Homepage:
- Size: 54.7 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.MD
- License: license.txt
- Security: SECURITY.md
Awesome Lists containing this project
README
# Examples Driven Tester
[](https://in.mathworks.com/matlabcentral/fileexchange/156374-examplesdriventester)
Examples driven tester is a tool for users which uses MATLAB® scripts which are already present in toolbox to provide a preliminary "smoke test" of the toolbox functionality. It runs MATLAB scripts via the [MATLAB Function-Based unit test](https://www.mathworks.com/help/matlab/matlab_prog/function-based-unit-tests.html) framework and generates a test and code coverage report. This tool is intended for preliminary qualification or Smoke testing of toolboxes. It is recommended to add unit tests for exhaustive functional testing of your code.
### MathWorks Products [https://www.mathworks.com](https://www.mathworks.com)
* MATLAB R2019b or newer
## Installation
* Launch MATLAB and download Examples driven tester from Add-On Explorer in MATLAB
* Examples driven tester will be downloaded and should be ready to use!
## Usage
```matlab
obj = examplesTester(testFiles);
obj = examplesTester(testFiles, Name, Value)
```
`testFiles` - Can have 2 possible values:
1. An array of folders containing M files
2. A path to json file which contains list of folders containing M files
### Name Value pairs
* **CreateTestReport** - Should test report be generated. ***Possible values:**[true], false*
* **TestReportFormat** - Format of test report. ***Possible values:** "pdf", "docx" , ["html”], “xml”*
* **OutputPath** - Directory where reports will be generated. Default is pwd.
* **CodeCoveragePlugin** - [MATLAB Code Coverage plugin](https://www.mathworks.com/help/matlab/ref/matlab.unittest.plugins.codecoverageplugin-class.html).
***Note:** Values enclosed in square braces are default values.*
### Basic workflows
Run MATLAB scripts from specified folders, for e.g. "doc" and "examples" and generate a test report
```matlab
obj = examplesTester(["examples", "doc"]);
obj.executeTests;
```
Run MATLAB scripts from specified folders, for e.g. "doc" and "examples" but do not generate a test report
```matlab
obj = examplesTester(["examples", "doc"], CreateTestReport = false);
obj.executeTests;
```
Run MATLAB scripts from specified folders, for e.g. "doc" and "examples" and generate a test report in PDF format.
```matlab
obj = examplesTester(["examples", "doc"], TestReportFormat = "PDF");
obj.executeTests;
```
Run MATLAB scripts from specified folders, for e.g. "doc" and "examples" and generate a code coverage report for code placed in "code" folder.
```matlab
reportFormat = matlab.unittest.plugins.codecoverage.CoverageReport('coverage-report');
covPlugin = matlab.unittest.plugins.CodeCoveragePlugin.forFolder("code", "Producing", reportFormat);
obj = examplesTester(["examples", "doc"], CodeCoveragePlugin = covPlugin);
obj.executeTests;
```
## License
The license is available in the [LICENSE.txt](license.txt) file within this repository
## Community Support
[MATLAB Central](https://www.mathworks.com/matlabcentral)
*Copyright 2023 The MathWorks, Inc.*