How can I test if a function is executed without any error using the unit test framework in MATLAB R2020b?
18 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
MathWorks Support Team
le 6 Nov 2023
Modifié(e) : MathWorks Support Team
le 30 Déc 2024
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?
Réponse acceptée
MathWorks Support Team
le 30 Déc 2024
Modifié(e) : MathWorks Support Team
le 30 Déc 2024
You can simply invoke the function being tested, and the test framework will report a failure if the function executes with any error.
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Testing Frameworks dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!