unit_threaded.runner.runner

This module implements functions to run the unittests with command-line options.

Members

Functions

replaceModuleUnitTester
void replaceModuleUnitTester()

Replace the D runtime's normal unittest block tester. If this is not done, the tests will run twice.

runTests
int runTests(string[] args, from!"unit_threaded.runner.reflection".TestData[] testData)

Runs all tests in passed-in testData. Arguments are taken from the command-line. -s Can be passed to run in single-threaded mode. The rest of argv is considered to be test names to be run.

runTests
int runTests(from!"unit_threaded.runner.options".Options options, from!"unit_threaded.runner.reflection".TestData[] testData)
Undocumented in source. Be warned that the author may not have intended to support it.

Mixin templates

collectAndRunTestsMain
mixintemplate collectAndRunTestsMain(Modules...)

Generates a main function for collectAndRunTests.

disableDefaultRunner
mixintemplate disableDefaultRunner()

A template mixin for a static constructor that disables druntimes's default test runner so that unit-threaded can take over.

runTestsMain
mixintemplate runTestsMain(Modules...)

Runs all tests in passed-in modules. Modules can be symbols or strings but they can't mix and match - either all symbols or all strings. It's recommended to use strings since then the modules don't have to be imported first. Generates a main function and substitutes the default D runtime unittest runner. This mixin should be used instead of runTests if a shared library is used instead of an executable.

Templates

collectAndRunTests
template collectAndRunTests(Modules...)

Collects test data from each module in Modules and runs tests with the supplied command-line arguments.

runTests
template runTests(Modules...)

Runs all tests in passed-in modules. Modules can be symbols or strings but they can't mix and match - either all symbols or all strings. It's recommended to use strings since then the modules don't have to be imported first. Arguments are taken from the command-line. -s Can be passed to run in single-threaded mode. The rest of argv is considered to be test names to be run.

Meta