Test Cases 🔗

Define and configure test cases.

Structures 🔗

struct TestOptions

Test configuration options.

Macros 🔗

#define TEST(
SUITE_NAME, TEST_NAME, ...)

Entry point for a unit test.

TEST_NAME, COUNT)

Set number of test iterations.

Variables 🔗

int32_t TEST_ITERATION

The iteration index of the currently executing test case.

const int32_t DYNAMIC_ITERATIONS

Constant indicating the number of test iterations is set dynamically.

Types 🔗

typedef int64_t StatusCode

Integer representing an application status code.

Discussion 🔗

Test cases are defined using the TEST macro. An example of a simple test case is demonstrated in the code snippet below. In the snippet the test case bar is defined in the suite foo.

TEST(foo, bar) {
   // ...
}

Test cases can have options associated with them. These options are defined by the TestOptions structure. You specify which options you want as the third parameter to the TEST macro. In the snippet below the iteration and sandbox options are specified.

TEST(foo, bar, .iterations=3, .sandbox=true) {
   // ...
}

Test cases are automatically registered by Audition. To learn more about writing tests cases see the Writing Tests. To learn more about customizing which tests are run see Running Tests.