gnu-octave / octave-doctest

Doctests for Octave/Matlab
https://gnu-octave.github.io/packages/doctest/
BSD 3-Clause "New" or "Revised" License
16 stars 4 forks source link

Run octave bist tests on Matlab #213

Open cbm755 opened 5 years ago

cbm755 commented 5 years ago

Good to have the coverage and to ensure they behaviour as similar as possible... I have some code somewhere to help with this, might need some polish.

cbm755 commented 4 years ago

My current implementation (https://github.com/cbm755/octsympy/blob/master/misc/) is GPL licensed. Probably I could twist my own arm to re-license as BSD for this project...

However, it includes 16 lines of code from GNU Octave:

% This code from Octave source: /scripts/testfun/test.m
% Copyright (C) 2005-2013 Paul Kienzle
% GPL
function body = __extract_test_code (nm)
...

This function looks through a file and selects those lines that start with %!. It then stripts %! from them. We could simply reimplement that algorithm...

cbm755 commented 4 years ago

Perhaps it would be more sensible to maintain Matlab-style unit tests for use with their runtests.

I guess the issue is whether we autogenerate them from out Octave BIST or just maintain both. Latter might be easier, as there are plenty of differences Octave and Matlab anyway...