How to make MATLAB xUnit work on MATLAB R2008b (7.7)?
-
12-09-2019 - |
Question
I copied the matlab_xunit folder to C:\Program Files, and included it (and its subfolders) on the MATLAB path. Now MATLAB recognizes new commands such as
runtests
But this command does not find any tests on the current folder. What I have done wrong? What else can I do?
>> runtests
Starting test run with 0 test cases.
PASSED in 0.000 seconds.
Solution
I am the creator of MATLAB xUnit. The most likely explanation for what you are seeing is some problem in the test files. Can you post a sample test file so I can look at it?
If you are writing subfunction-style test files, do any files in your current directory start with "test" or "Test"? Does the file contain any subfunctions that begin with "test" or "Test"? When you call one of those files with no input arguments and a single output argument, does it return a TestSuite object? If not, then double-check the documentation about creating subfunction tests.
Are you instead writing test files that subclass TestCase? Do they contain methods that begin with "test" or "Test"?
OTHER TIPS
This document on the File Exchange page for the MATLAB xUnit Test Framework submission should help. It says that you have to create a folder with your test-case M-files in it, then make that your working directory using CD.