120#define AST_TEST_DEFINE(hdr) static enum ast_test_result_state hdr(struct ast_test_info *info, enum ast_test_command cmd, struct ast_test *test)
121#define AST_TEST_REGISTER(cb) ast_test_register(cb)
122#define AST_TEST_UNREGISTER(cb) ast_test_unregister(cb)
126#define AST_TEST_DEFINE(hdr) static enum ast_test_result_state attribute_unused hdr(struct ast_test_info *info, enum ast_test_command cmd, struct ast_test *test)
127#define AST_TEST_REGISTER(cb)
128#define AST_TEST_UNREGISTER(cb)
129#define ast_test_status_update(a,b,c...)
130#define ast_test_debug(test, fmt, ...) ast_cli
162struct ast_test_suite_message_payload;
170struct ast_json *ast_test_suite_get_blob(
struct ast_test_suite_message_payload *payload);
182#define ast_test_suite_event_notify(s, f, ...) \
183 __ast_test_suite_event_notify(__FILE__, __PRETTY_FUNCTION__, __LINE__, (s), (f), ## __VA_ARGS__)
184void __ast_test_suite_event_notify(
const char *
file,
const char *func,
int line,
const char *
state,
const char *fmt, ...)
185 __attribute__((format(printf, 5, 6)));
189#define ast_test_suite_event_notify(s, f, ...)
314int ast_test_unregister(ast_test_cb_t *cb);
324int ast_test_register(ast_test_cb_t *cb);
341int ast_test_register_init(
const char *category, ast_test_init_cb_t *cb);
357int ast_test_register_cleanup(
const char *category, ast_test_cleanup_cb_t *cb);
367void ast_test_debug(
struct ast_test *
test,
const char *fmt, ...) __attribute__((format(printf, 2, 3)));
389#define ast_test_status_update(t, f, ...) __ast_test_status_update(__FILE__, __PRETTY_FUNCTION__, __LINE__, (t), (f), ## __VA_ARGS__)
390int __ast_test_status_update(
const char *
file,
const char *func,
int line,
struct ast_test *
test,
const char *fmt, ...)
391 __attribute__((format(printf, 5, 6)));
410#define ast_test_validate(test, condition, ...) \
412 if (!(condition)) { \
413 __ast_test_status_update(__FILE__, __PRETTY_FUNCTION__, __LINE__, (test), "%s: %s\n", strlen(#__VA_ARGS__) ? #__VA_ARGS__ : "Condition failed", #condition); \
414 return AST_TEST_FAIL; \
433#define ast_test_validate_cleanup(test, condition, rc_variable, cleanup_label) ({ \
434 if (!(condition)) { \
435 ast_test_status_update((test), "%s: %s\n", "Condition failed", #condition); \
436 rc_variable = AST_TEST_FAIL; \
437 goto cleanup_label; \
484int ast_test_capture_command(
struct ast_test_capture *capture,
const char *
file,
char *
const argv[],
const char *data,
unsigned datalen);
Standard Command Line Interface.
String manipulation functions.
Abstract JSON element (object, array, string, int, ...).
A capture of running an external process.
char * outbuf
buffer holding stdout
char * errbuf
buffer holding stderr
size_t errlen
length of buffer holding stderr
pid_t pid
process id of child
size_t outlen
length of buffer holding stdout
int exitcode
exit code of child
Contains all the initialization information required to store a new test definition.
const char * summary
Short summary of test.
const char * category
test category
unsigned int explicit_only
Only run if explicitly named.
const char * description
More detailed description of test.
const char * name
name of test, unique to category
#define ast_test_debug(test, fmt,...)