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

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.