Hello,
I want to run a testCase in a specific folder without going in there.
I have a test test1.m in the folders 'src/classes/test_folder/cases'. I know that I can run it if I'm in cases using
runtests -verbose test1
but I want to run this test from the src folder. I tried
runtests -verbose classes/test_folder/cases/test1
runtests -verbose classes/test_folder/cases/test1.m
runtests -verbose 'classes/test_folder/cases/test1'
runtests -verbose 'classes/test_folder/cases/test1.m'
...
but it says "No test cases found."
I'm working with Matlab R2010b, using an old version of xunit (not available on file exchange apparently).
Thanks

댓글 수: 1

per isakson
per isakson 2016년 8월 8일
...
'BaseFolder' — Name of base folder character vector
Name of the base folder that contains the file defining the test class, function, or script, specified as a character vector. For a test element to be included in the suite, the test element must be contained in the specified base folder. Use the wildcard character * to match any number of characters. Use the question mark character ? to match a single character. For test files defined in packages, the base folder is the parent of the top-level package folder.

댓글을 달려면 로그인하십시오.

 채택된 답변

Valentin Debris
Valentin Debris 2016년 8월 9일

0 개 추천

Thanks isakson, I solved my problem.
I make my "cases" folder a package (just add a "+" at the beggining, +cases). So now, I can call a specific test using
runtests('cases.test1')

추가 답변 (0개)

카테고리

도움말 센터 및 File Exchange에서 Write Unit Tests에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by