public class TestRunner:
Discovers and executes packaged Klyn test classes in one isolated process.
Source files are selected when they declare @TestClass; their filename does not affect discovery. One child process owns the complete compiler and JIT session, while each source receives a separate JIT namespace. This avoids repeating process, compiler and standard-library initialization for every class.
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. |