How can I test if a function is executed without any error using the unit test framework in MATLAB R2020b?

16 visualizaciones (últimos 30 días)
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?

Respuesta aceptada

MathWorks Support Team
MathWorks Support Team el 30 de Dic. de 2024
Editada: MathWorks Support Team el 30 de Dic. de 2024
You can simply invoke the function being tested, and the test framework will report a failure if the function executes with any error.

Más respuestas (0)

Categorías

Más información sobre Testing Frameworks en Help Center y File Exchange.

Productos


Versión

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by