ihct
(I Hate C Testing)
Testing functions

More general macros for function. More...

Macros

#define IHCT_RUN(argc, argv)
 Runs all tests. Is to be called once in the main entrypoint. More...
 
#define IHCT_TEST(name)
 Create a new test unit, which can take any number of asserts. More...
 

Detailed Description

More general macros for function.

Macro Definition Documentation

◆ IHCT_RUN

#define IHCT_RUN (   argc,
  argv 
)

Runs all tests. Is to be called once in the main entrypoint.

int main(int argc, char **argv) {
return IHCT_RUN(argc, argv);
}
#define IHCT_RUN(argc, argv)
Runs all tests. Is to be called once in the main entrypoint.
Definition: ihct.h:112
Parameters
argcargument count, directly passed from main.
argvargument array, directly passed from main.

◆ IHCT_TEST

#define IHCT_TEST (   name)

Create a new test unit, which can take any number of asserts.

IHCT_TEST(basic_test) {
IHCT_ASSERT(1 == 1);
}
#define IHCT_ASSERT(expr)
Asserts a statement inside a test unit. If the expression is false, the unit will fail the test.
Definition: ihct.h:50
#define IHCT_TEST(name)
Create a new test unit, which can take any number of asserts.
Definition: ihct.h:126
Parameters
namethe name of the test.

Can be shortened to remove 'IHCT_' prefix by defining IHCT_SHORT.