TestRunner
classin packageklyn.unittest
public class TestRunner:
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.

Example
import klyn.io
import klyn.unittest

runner = TestRunner(FolderPath("tests"))
report = runner.run(["klyn.collections"])
assert report.classCount > 0
Properties
Modifier and Type Member Description
public property consoleOutput
consoleOutput as Boolean = true
Whether progress and results are rendered on the console.
public property observer
observer as TestRunObserver = null
Optional observer notified as each test class starts and completes.
public readonly property root
root as FolderPath:
Root directory scanned by this runner.
Constructors
Modifier and Type Member Description
public TestRunner Creates a test runner rooted at root.
Methods
Modifier and Type Member Description
public discover
discover(packageFilters as IList<String>) as ArrayList<FilePath>:
Discovers test files matching zero or more package roots.
public run
run(packageFilters as IList<String>) as TestReport:
Executes all selected test classes sequentially.
public runSources
runSources(sources as IList<FilePath>) as TestReport:
Executes an explicit list of test source files.