Is there an easy way to build a test suite from all tests in a folder containing multiple packages?
Ältere Kommentare anzeigen
I have a non-package directory, containing several packages. Each package may contain subpackages. The packages have class-based unit tests. I can run all the tests for a given package by calling
runtests('mypackage1', "IncludeSubpackages", true)
Is there an easy way to run all tests for all packages?
If I call
runtests(pwd, "IncludeSubfolders", true, "IncludeSubpackages", true)
No tests are run.
Akzeptierte Antwort
Weitere Antworten (1)
Sean de Wolski
am 2 Dez. 2019
Bearbeitet: Sean de Wolski
am 2 Dez. 2019
0 Stimmen
Have you considered adopting projects? I'd recommend it (for most things and especially for this use case) then you can just create the TestSuite from all files in the project.
https://www.mathworks.com/help/releases/R2019b/matlab/ref/matlab.unittest.testsuite.fromproject.html
Otherwise, shy of manually appending multiple TestSuites I don't know a way. My team usually keeps all tests as classes optionally in subppackages of a parent +test package so it's obvious it's a test.
Kategorien
Mehr zu Model and Code Testing Metrics finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!