mlUnit is a unit testing framework for the MATLAB .m language, slUnit a unit testing framework for Simulink. Both frameworks consider the patterns of the xUnit family, include assertions, test cases and suites as well as the fixture.
Be the first to post a text review of mlUnit. Rate and review a project by clicking thumbs up or thumbs down in the right column.
mlUnit 2 is the re-implementation of mlUnit for MATLAB's new classdef syntax. This not only allows to define all test methods in one file, but also to put all test cases into one or more packages. All classes of mlunit have been moved to the package mlunit. Furthermore all test cases of mlUnit 2.0 have been moved to the package mlunit_test, and can be called with >> mlunit_test.run; An example test case looks like this: >> edit test.sin.m classdef test_sin < mlunit.test_case methods function self = test_sin(varargin) self = self@mlunit.test_case(varargin{:}); end function self = test_null(self) mlunit.assert_equals(0, sin(0)); end function self = test_sin_cos(self) mlunit.assert_equals(cos(0), sin(pi/2)); end end end and can be executed by the following commands: >> runner = mlunit.text_test_runner(1, 1); >> loader = mlunit.test_loader; >> run(runner, load_tests_from_test_case(loader, 'test_sin')); Furthermore the function load_tests_from_mfile has been removed from test_loader as MATLAB R2008a has a changed behaviour of evalin, see the comments at http://blogs.mathworks.com/loren/2006/11/17/some-ways-to-create-function-handles/ This is a beta release. If you have a question, a comment or a bug report, please send an email to thomas@dohmke.de. Usually I try to answer within 24 hours. Spam and other crap goes automatically to the trash bin, so please use a precise subject.
Be the first person to add a text review.
Copyright © 2009 Geeknet, Inc. All rights reserved. Terms of Use
Thanks for your rating!
Would you also like to write a review?