Macro

TEST

Entry point for a unit test.

Since v1.0
#define TEST(
SUITE_NAME, TEST_NAME, ...)

Parameters 🔗

SUITE_NAME in

Test suite this unit test is part of.

TEST_NAME in

Name of the unit test.

... in

Optional test options.

Discussion 🔗

This macro defines a new test case with the name TEST_NAME belonging to test suite SUITE_NAME. There is no special logic required to create a suite; a suite is created implicitly the first time a test case references it.

The TEST macro should be followed by a pair of opening and closing curly braces with the test statements inserted between them.

Writing unit tests is discussed in detail in Writing Tests.