Contract

Defines a contract test by mixing in a new test function.

The test function actually does a few things: * Verify the contract that libclang returns what we expect it to. * Use the *same* code to construct a mock translation unit cursor that also satisfies the contract. * Verifies the mock also passes the test.

Two functions are generated: the contract test, and a helper function that does the heavy lifting. The separation is so the 2nd function can be called from unit tests to generate the mock.

This 2nd function isn't supposed to be called directly, but is found via compile-time reflection in mockTU.

Members

Aliases

udas
alias udas = getUDAs!(contractFunction, ContractFunction)
Undocumented in source.

Manifest constants

code
enum code;
Undocumented in source.
codeURL
enum codeURL;
Undocumented in source.
testFunctionName
enum testFunctionName;
Undocumented in source.

Parameters

testName

The name of the new test.

contractFunction

The function that verifies the contract or creates the mock.

Meta