runtests
- : runtests
()¶ - : runtests
(directory)¶ - :
result =runtests(directory)¶ - :
[result, coverage] =runtests(…)¶ Recursively scan directory (default: current directory) for test files and execute them.
Files whose base name starts with
"test_"are run as scripts and are deemed to pass if they run without raising an error. Other .m files are scanned for embedded%!testblocks, each of which is evaluated independently.With no output argument, a terse
PASS/FAILlisting plus a summary line is printed. With an output argument, a struct array with fieldsfile,name,passed,message, andblockCountis returned instead of printing.MATLAB-style calls that request a second output (for example
ReportCoverageFor) forward both outputs frommatlab.unittest.runtests.