How to use runtests() command
5 ビュー (過去 30 日間)
古いコメントを表示
I have created a test script Test1.m using classes located in a folder called "test".
classdef Test1 < matlab.unittest.TestCase
... code...
end
I can run the tests by entering
run(Test1)
in the command window. Some members of my team are familiar with clicking 'Run Tests' button (or the equivalent of runtests() in command window). However, runtests("Test1.m") does not work with the below error:
Error using runtests
Do not know what to run. Try "unit" or
"acceptance"
Is it due to the folder structure? How may i be able to run test script with 'Run Tests' button.
0 件のコメント
回答 (1 件)
Viggnesh Venkatakrishnan
2018 年 12 月 17 日
Hi doyz,
I understand your problem with using runtests() to run the test script that you have written. I can safely assume with your code snippet that you are working with class based unit tests in MATLAB. There is a specific way to write class based unit tests for it to be registered as tests in MATLAB. Refer to the following page and the example given in the page that talks in detail about class based unit tests in MATLAB.
Thanks and Regards,
Viggnesh Venkatakrishnan
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Write Unit Tests についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!