Here is the workaround I came up with for now. Define `packageName`, e.g. `mypackage.test`, then build up the test suite from the files in the package. There is probably a more straightforward way to implement something like this directly xunit, which I'll investigate when I have more time.
ts = TestSuite();
for i = 1:numel( fileName )
fqClassName = [ packageName '.' fileName(i).name(1:end-2) ];
if xunit.utils.isTestCaseSubclass( fqClassName )
ts.add( TestSuite( fqClassName ) );
Dennis, thanks for the proposed fix. This fix wouldn't directly apply to my situation because I'm running tests cases in a package, by passing the package name to `runtests`. If I try specifying the relative or full path to a package, I get "No test cases found", which seems to be because fully qualified function names are not being used to build up the test suite. So your fix might work for the case of specifying a package name if some additional modifications were made to the `fromName` function.
When a package name is specified when calling runtests, the issue seems to be that matlab's meta.package.fromName (line 283 in TestSuite.m) will not return in the list of classes any class that has a syntax error. I'm not sure how to work around that.
Bug report: I have a package of tests, let's call it mypkg.tests. I run all of the tests in the package by typing `runtests mypkg.tests`. I have noticed that if there is a syntax error in one of the test classes, it will be silently skipped. However, if I run the test class by specifying the class explicitly, e.g. `runtests mypkg.tests.MyTestClass`, I see that the tests fail to run because of the syntax error. The syntax error can be an incorrect import statement, or something else equally likely to arise in practice. We have hundreds of tests and dozens of test classes, so this can cause problems for us that are not obvious.
30 Dec 2009
A MATLAB class which controls layout and resize of a figure/uipanel/uicontainer.
Author has done a great job of responding to suggestions and making improvements and minor bug fixes.
Excellent resource for those of us who are new to Kalman filtering. Thank you! What if the state of my system is given by a vector rather than a scalar? Can Kalman filtering work in n dimensions? If I want to train the filter on one set of data and then apply it to another, how would I do that? What if my observations are a sum of two or more signals, plus noise? How do I "tell" the Kalman filter which of the signals I want it to estimate?
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?