开发者

Is there a Matlab tool similar to Python's Doctest?

In my Python development开发者_Go百科, doctest has really helped both to

  • make writing unit tests less annoying, and
  • integrate usage examples with documentation.

I was wondering, is there anything like this available in the Matlab world? It doesn't have to literally use code comments as a test, but if it had those two desirable qualities, that would be great!


This exists now! There are three versions out there:

  • An Octave-compatible version that still gets some development
  • A version of Matlab-xUnit with an integrated doctest runner
  • The original version from 2010, which is self-contained and emits results in TAP format


Not yet, but there is something to generate documentation called M2HTML.

It is very useful, and you can take a look at the examples at that page to see how wonderful results it's producing (even dependency graphs :) ).

For unit testing in MATLAB, even if there are many solutions, mlUnit was the most efficient to me.


There is no direct equivalent to doctest in MATLAB.

There is, however, a nice unit testing framework on the Matlab File Exchange.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜