How to use runtests() command

2 visualizaciones (últimos 30 días)
doyz
doyz el 21 de Ag. de 2018
Respondida: Viggnesh Venkatakrishnan el 17 de Dic. de 2018
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.

Respuestas (1)

Viggnesh Venkatakrishnan
Viggnesh Venkatakrishnan el 17 de Dic. de 2018
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

Categorías

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

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by