views:

95

answers:

2

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.
+1  A: 

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.

gnovice
+4  A: 

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"?

Steve Eddins
the name of the file did not started with "Test"
Jader Dias
OK, you should rename your test files, then. Take a look at the doc link I posted earlier.
Steve Eddins
I have a new question for you: http://stackoverflow.com/questions/1477376/how-to-pass-multiple-parameters-to-tests-that-share-the-same-setup-code-in-matlab
Jader Dias