Skip to content
This repository has been archived by the owner on Nov 16, 2022. It is now read-only.

Template MATLAB toolbox with tests/docs/CI/coverage

License

Notifications You must be signed in to change notification settings

dstansby/matlab-toolbox-template

Repository files navigation

❗ This repository is no longer actively developed or maintained. You are encouraged to fork it if it is useful and you want to make changes/updates!

matlab-sandbox

Run MATLAB tests codecov

A sample MATLAB package with all the nuts and bolts needed for a nice open source package. The package source code is in +mypackage.

Tests

Example tests live in the tests directory. run_tests.m contains a script to run the tests and generate code coverage. To run tests locally use:

matlab -batch run_tests

The tests are run on GitHub actions - see run_tests.yml for CI configuration. Code coverage is collected and uploaded to codecov.

To run a subset of the tests instead of all of them, make sure the test you want to run is on the MATLAB path and use run(my_test_file).

The tests will output a file with test timings to artifacts/results.xml. This can be parsed into a JSON file using benchmarks/parse_performance.py.

Docs

Documentation is automatically generated from MATLAB comments, e.g.

%% Description
% |addOne| adds one to the input.
%
%% Usage
%
%   a = addOne(b)
%
%% Inputs
%  |b| - (number) Number to add one to.
%
%% Outputs
%
% |a| - (number) Input plus one.
function result = addOne(x)
    result = x + 1
end

The documentation is compiled into static HTML pages using the make_docs.m script.

Linting

The run_code_quality.m script runs linting on the MATLAB code to check for any code linting errors.

About

Template MATLAB toolbox with tests/docs/CI/coverage

Topics

Resources

License

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •