How can I test if a function is executed without any error using the unit test framework in MATLAB R2020b?
48 ビュー (過去 30 日間)
古いコメントを表示
MathWorks Support Team
2023 年 11 月 6 日
編集済み: MathWorks Support Team
2024 年 12 月 30 日 14:20
Hi, I am using the MATLAB Unit Test Framework, which includes a verification function called "verifyWarningFree". This function can verify if a function runs without any warnings. However, I would like to check if the function executes without any errors, not just warnings. Is there a command available that can achieve this?
採用された回答
MathWorks Support Team
2024 年 12 月 30 日 0:00
編集済み: MathWorks Support Team
2024 年 12 月 30 日 14:20
You can simply invoke the function being tested, and the test framework will report a failure if the function executes with any error.
0 件のコメント
その他の回答 (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!