Keith - On my Mac, MATLAB xUnit passes 150 of the 151 test cases in its own test suite. (The one failure seems to be a bad test case.) Use the contact form on my author page (http://www.mathworks.com/matlabcentral/fileexchange/authors/22204) to send me more details about the problem you are experiencing.
Hey, I understand that xUnit is superceded by the official unit test framework in 2013b, but I have a lot of test functions set up for xUnit. When I try to run them in 2013b, even with xUnit put at the top of the path, it doesn't work. Is there a way to either (a) get my old functions to work, or (b) automatically convert my xUnit tests to the new system?
I am sorry it took me so long to post here the promised link to the mocking framework created by Vladimir Peric, a student of mine.
You can download mmockito from GitHub:
It is a lightweight package, that definitely cannot do all the mocking things out there, but for the basic usage it shall be quite handy.
It is created using the new MATLAB unit test framework and should be compliant with it. It should also work with Steve Edins' MATLAB xUnit Framework, although maybe with a bit limited capabilities.
Feel free to report any issues directly on the GitHub page.
We hope you will find it useful.
You say, "I believe that xUnit creates a new object for each method in that class for testing rather than iterating through the methods of a single (subclassed) TestCase object." That's correct, and that's a classic xUnit design pattern to ensure order independence of individual test methods. See http://martinfowler.com/bliki/JunitNewInstance.html.
Although it's possible to consider adding setup and teardown methods on a TestSuite level, I haven't done so for MATLAB xUnit.
Because of the release of a new unit testing framework in MATLAB itself (in R2013a), I probably will not put further effort into developing my MATLAB xUnit package. If you can upgrade to R2013a, I encourage you to give the new testing framework a try.
This maybe a my misunderstanding of the testing architecture. However, I believe that it would be useful if there were an init method in TestCase. This would be run once to setup particular parameters of dependencies. To illustrate my request further, I am using xUnit to test the submodules of a Simulink model which I am building up with model referenced components. I would like the ability to compile the model once in some init method(to take account of any new changes) and then to turn off the automatic rebuild/checking for efficiency of running the subsequent tests. Is this possible? I believe that xUnit creates a new object for each method in that class for testing rather than iterating through the methods of a single (subclassed) TestCase object.