public class TestRunner:
Discovers and executes packaged Klyn test classes in isolated processes.
Source files are selected when they declare @TestClass; their filename does not affect discovery. Every child process uses the compiler-generated test runner, while this class aggregates its structured report. Isolation ensures that a crash or leaked global state in one source cannot corrupt the following sources.
import klyn.io
import klyn.unittest
runner = TestRunner(FolderPath("tests"))
report = runner.run(["klyn.collections"])
assert report.classCount > 0| Modifier and Type | Member | Description |
|---|---|---|
| public property | consoleOutputconsoleOutput as Boolean = true |
Whether progress and results are rendered on the console. |
| public property | observerobserver as TestRunObserver = null |
Optional observer notified as each test class starts and completes. |
| public readonly property | rootroot as FolderPath: |
Root directory scanned by this runner. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | TestRunnerTestRunner(root as FolderPath): |
Creates a test runner rooted at root. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | discover | Discovers test files matching zero or more package roots. |
| public | runrun(packageFilters as IList<String>) as TestReport: |
Executes all selected test classes sequentially. |
| public | runSourcesrunSources(sources as IList<FilePath>) as TestReport: |
Executes an explicit list of test source files. |