matlab.unittest.TestCase Test Cases in Multiple Files
Mostrar comentarios más antiguos
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).
Respuesta aceptada
Más respuestas (1)
Jeremy Ward
el 31 de En. de 2018
0 votos
2 comentarios
Steven Lord
el 31 de En. de 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
el 31 de En. de 2018
Categorías
Más información sobre Testing Frameworks en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!