How to use runtests() command
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (1)
Viggnesh Venkatakrishnan
le 17 Déc 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
0 commentaires
Voir également
Catégories
En savoir plus sur Write Unit Tests 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!