matlab.unittest.TestCase Test Cases in Multiple Files
Afficher commentaires plus anciens
Is it possible to use the standard class folder structure and the matlab.unittest.TestCase infrastructure? The collection of all of my unit tests for a given DUT is 50k lines long. I desire to break each test into it's own file. But in the "Write Simple Test Case Using Classes" SolverTest.m example, when I make an @SolverTest directory, add the class def to that folder and put the testRealSolution function in it's own file in that directory, Matlab fails to find it when I run(testCase).
Réponse acceptée
Plus de réponses (1)
Jeremy Ward
le 31 Jan 2018
0 votes
2 commentaires
Steven Lord
le 31 Jan 2018
This page in the documentation goes into a little bit more detail about how to define class methods in separate files.
I recommend you consider the unittest directory with multiple classdef files. If you organize those test classes well, you may only need to run a subset of your test files when you modify a particular part of your software under test's functionality. For example, you could have testConstruction.m, testIndexing.m, testSum.m, etc. If you are only changing the sum overloaded method, you may not need to run the tests for the constructor or the indexing tests as they (shouldn't) be affected by changes to the sum method.
Jeremy Ward
le 31 Jan 2018
Catégories
En savoir plus sur Testing Frameworks dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!