15#include <sys/resource.h>
22#ifndef CRM_COMMON_UNITTEST_INTERNAL__H
23#define CRM_COMMON_UNITTEST_INTERNAL__H
47#define pcmk__assert_asserts(stmt) \
51 struct rlimit cores = { 0, 0 }; \
52 setrlimit(RLIMIT_CORE, &cores); \
57 if (waitpid(p, &wstatus, 0) == -1) { \
58 fail_msg("waitpid failed"); \
60 if (!(WIFSIGNALED(wstatus) && WTERMSIG(wstatus) == SIGABRT)) { \
61 fail_msg("statement terminated in child without asserting"); \
64 fail_msg("unable to fork for assert test"); \
73#define PCMK__UNIT_TEST(group_setup, group_teardown, ...) \
75main(int argc, char **argv) \
77 const struct CMUnitTest t[] = { \
80 cmocka_set_message_output(CM_OUTPUT_TAP); \
81 return cmocka_run_group_tests(t, group_setup, group_teardown); \