unit_threaded.runner.reflection

Compile-time reflection to find unit tests and set their properties.

Members

Aliases

TestFunction
alias TestFunction = void delegate()

Functions

allTestData
const(TestData)[] allTestData()

Finds all test cases (functions, classes, built-in unittest blocks) Template parameters are module strings

allTestData
const(TestData)[] allTestData()

Finds all test cases (functions, classes, built-in unittest blocks) Template parameters are module symbols

moduleTestClasses
TestData[] moduleTestClasses()

Finds all test classes (classes implementing a test() function) in the given module

moduleTestFunctions
TestData[] moduleTestFunctions()

Finds all test functions in the given module. Returns an array of TestData structs

moduleUnitTests
TestData[] moduleUnitTests()

Finds all built-in unittest blocks in the given modules. Recurses into structs, classes, and unions of the modules.

tagsFromAttrs
string[] tagsFromAttrs()
Undocumented in source. Be warned that the author may not have intended to support it.
unittestFunctionName
string unittestFunctionName(size_t line)
Undocumented in source. Be warned that the author may not have intended to support it.

Mixin templates

Test
mixintemplate Test(string testName, alias Body, size_t line = __LINE__)

An alternative to writing test functions by hand to avoid compile-time performance penalties by using -unittest.

Structs

TestData
struct TestData

Common data for test functions and test classes

Templates

TestNameFromAttr
template TestNameFromAttr(alias testFunction)

Names a test function / built-in unittest based on @Name or string UDAs on it. If none are found, "returns" an empty string

Meta