new generation unit test framework for C
Value: static char * nm ;\ static const struct __np_param_dec *__np_parameter_##nm(void) __attribute__((unused)); \ static const struct __np_param_dec *__np_parameter_##nm(void) \ { \ static const struct __np_param_dec d = { & nm , vals }; \ return &d; \ }
static char* variable called nm, and declare it as a test parameter on the testnode corresponding to the source file in which it appears, with a set of values defined by splitting up the string literal vals on whitespace and commas. For example: NP_PARAMETER(db_backend, "mysql,postgres"); db_backend in the current file, and at runtime every test function in this file will be run twice, once with the variable db_backend set to "mysql" and once with it set to "postgres" .
|