suite = nelson.unittest.discover(targets)
suite = nelson.unittest.discover(targets, Name, Value)
| Parameter | Description |
|---|---|
| targets | module name, directory, file name, or cell array of targets. |
| Name, Value | Kind selection option. |
| Parameter | Description |
|---|---|
| suite | TestSuite structure containing discovered TestCase entries. |
nelson.unittest.discover finds test_*.m, bug_*.m, and bench_*.m files.
Discovery reads file tags on every call and records stable TestCase fields such as id, module, file, name, kind, tags, mode, resources, timeout, and weight.
For an external module, the module field comes from its module.json manifest and its root is located by the enclosing etc/startup.m file. This also supports versioned installations, temporary package staging directories, and nested tests. Shipped modules and registered legacy modules are identified from their module roots. A directory name alone does not identify a module; files without a valid module identity have an empty module field.
suite = nelson.unittest.discover('string', 'Kind', 'all_tests');