62#define TEST_LIST const struct acutest_test_ acutest_list_[]
84#define TEST_CHECK_(cond,...) acutest_check_((cond), __FILE__, __LINE__, __VA_ARGS__)
85#define TEST_CHECK(cond) acutest_check_((cond), __FILE__, __LINE__, "%s", #cond)
103#define TEST_ASSERT_(cond,...) \
105 if(!acutest_check_((cond), __FILE__, __LINE__, __VA_ARGS__)) \
108#define TEST_ASSERT(cond) \
110 if(!acutest_check_((cond), __FILE__, __LINE__, "%s", #cond)) \
130#define TEST_EXCEPTION(code, exctype) \
132 bool exc_ok_ = false; \
133 const char *msg_ = NULL; \
136 msg_ = "No exception thrown."; \
137 } catch(exctype const&) { \
140 msg_ = "Unexpected exception thrown."; \
142 acutest_check_(exc_ok_, __FILE__, __LINE__, #code " throws " #exctype);\
144 acutest_message_(false, "%s", msg_); \
146#define TEST_EXCEPTION_(code, exctype, ...) \
148 bool exc_ok_ = false; \
149 const char *msg_ = NULL; \
152 msg_ = "No exception thrown."; \
153 } catch(exctype const&) { \
156 msg_ = "Unexpected exception thrown."; \
158 acutest_check_(exc_ok_, __FILE__, __LINE__, __VA_ARGS__); \
160 acutest_message_(false, "%s", msg_); \
183#define TEST_CASE_(...) acutest_case_(__VA_ARGS__)
184#define TEST_CASE(name) acutest_case_("%s", name)
190#ifndef TEST_CASE_MAXSIZE
191 #define TEST_CASE_MAXSIZE 64
215#define TEST_MSG(...) TEST_MSG_FAIL(__VA_ARGS__)
216#define TEST_MSG_FAIL(...) acutest_message_(false, __VA_ARGS__)
222#define TEST_MSG_ALWAYS(...) acutest_message_(true, __VA_ARGS__)
227#ifndef TEST_MSG_MAXSIZE
228 #define TEST_MSG_MAXSIZE 1024
243#define TEST_DUMP(title, addr, size) TEST_DUMP_FAIL(title, addr, size)
244#define TEST_DUMP_FAIL(title, addr, size) acutest_dump_(false, title, addr, size);
249#define TEST_DUMP_ALWAYS(title, addr, size) acutest_dump_(true, title, addr, size);
254#ifndef TEST_DUMP_MAXSIZE
255 #define TEST_DUMP_MAXSIZE 1024
262#define TEST_LOG_MAXSIZE ((TEST_DUMP_MAXSIZE * 3) + TEST_MSG_MAXSIZE + 3)
299#if defined(unix) || defined(__unix__) || defined(__unix) || defined(__APPLE__)
300 #define ACUTEST_UNIX_ 1
304 #include <sys/types.h>
305 #include <sys/wait.h>
309 #if defined CLOCK_PROCESS_CPUTIME_ID && defined CLOCK_MONOTONIC
310 #define ACUTEST_HAS_POSIX_TIMER_ 1
314#if defined(_gnu_linux_) || defined(__linux__)
315 #define ACUTEST_LINUX_ 1
317 #include <sys/stat.h>
320#if defined(_WIN32) || defined(__WIN32__) || defined(__WINDOWS__)
321 #define ACUTEST_WIN_ 1
331 #if __has_include(<valgrind.h>)
332 #include <valgrind.h>
337#if defined(__GNUC__) || defined(__clang__)
338 #define ACUTEST_ATTRIBUTE_(attr) __attribute__((attr))
340 #define ACUTEST_ATTRIBUTE_(attr)
354 #pragma warning(push)
355 #pragma warning(disable: 4996)
390void acutest_dump_(
bool always,
const char* title,
const void* addr,
size_t size);
426#if defined ACUTEST_WIN_
427HANDLE hChildWrite = NULL;
441#if defined ACUTEST_WIN_
444 fprintf(stderr,
"Upable to write to pipe");
456acutest_exit_(
int exit_code)
462#if defined ACUTEST_WIN_
464 static LARGE_INTEGER acutest_timer_freq_;
471 QueryPerformanceFrequency(´st_timer_freq_);
477 QueryPerformanceCounter(ts);
483 double duration = (double)(end.QuadPart - start.QuadPart);
484 duration /= (double)acutest_timer_freq_.QuadPart;
493#elif defined ACUTEST_HAS_POSIX_TIMER_
494 static clockid_t acutest_timer_id_;
503 acutest_timer_id_ = CLOCK_MONOTONIC;
505 acutest_timer_id_ = CLOCK_PROCESS_CPUTIME_ID;
511 clock_gettime(acutest_timer_id_, ts);
522 endns += end.tv_nsec;
524 startns = start.tv_sec;
526 startns += start.tv_nsec;
528 return ((endns - startns)/ 1e9);
565#define ACUTEST_COLOR_DEFAULT_ 0
566#define ACUTEST_COLOR_GREEN_ 1
567#define ACUTEST_COLOR_RED_ 2
568#define ACUTEST_COLOR_DEFAULT_INTENSIVE_ 3
569#define ACUTEST_COLOR_GREEN_INTENSIVE_ 4
570#define ACUTEST_COLOR_RED_INTENSIVE_ 5
573acutest_colored_printf_(
int color, const
char*
fmt, ...)
585 return printf(
"%s",
buffer);
588#if defined ACUTEST_UNIX_
597 default: col_str =
"\033[0m";
break;
599 printf(
"%s", col_str);
604#elif defined ACUTEST_WIN_
607 CONSOLE_SCREEN_BUFFER_INFO info;
610 h = GetStdHandle(STD_OUTPUT_HANDLE);
611 GetConsoleScreenBufferInfo(h, &info);
619 default: attr = 0;
break;
622 SetConsoleTextAttribute(h, attr);
624 SetConsoleTextAttribute(h, info.wAttributes);
658 const char* str = (result == 0) ?
"ok" :
"not ok";
663 printf(
"# Duration: ");
669 const char* str = (result == 0) ?
"OK" :
"FAILED";
671 acutest_colored_printf_(color,
"%s", str);
686 static const char spaces[] =
" ";
736 const char* lastsep1 = strrchr(
file,
'\\');
737 const char* lastsep2 = strrchr(
file,
'/');
742 file = (lastsep1 > lastsep2 ? lastsep1 : lastsep2) + 1;
744 const char* lastsep = strrchr(
file,
'/');
748 printf(
"%s:%d: Check ",
file,
line);
774 fprintf(stderr,
"Out of memory.\n");
796 fprintf(stderr,
"Out of memory.\n");
873 static const size_t BYTES_PER_LINE = 16;
876 size_t buflen = (size * 3) + strlen(title) + 2;
895 buffer = (
char *)calloc(buflen,
sizeof(
char));
899 printf((title[strlen(title)-1] ==
':') ?
"%s\n" :
"%s:\n", title);
902 p =
buffer + strlen(title);
903 if (title[strlen(title) - 1] !=
':') {
913 printf(
"%08lx: ", (
unsigned long)
line_beg);
916 printf(
" %02x", ((
const unsigned char*)addr)[off]);
917 snprintf(p, end - p,
" %02x", ((
const unsigned char*)addr)[off]);
925 unsigned char byte = ((
const unsigned char*)addr)[off];
927 printf(
"%c", (iscntrl(
byte) ?
'.' : byte));
937 printf(
" ... (and more %u bytes)\n", (
unsigned) truncate);
987 printf(
"Unit tests:\n");
989 printf(
" %s\n", test->
name);
1017 static const char word_delim[] =
" \t-_/.,:;";
1021 pattern_len = strlen(pattern);
1023 substr = strstr(
name, pattern);
1024 while(substr != NULL) {
1025 int starts_on_word_boundary = (substr ==
name || strchr(word_delim, substr[-1]) != NULL);
1026 int ends_on_word_boundary = (substr[pattern_len] ==
'\0' || strchr(word_delim, substr[pattern_len]) != NULL);
1028 if(starts_on_word_boundary && ends_on_word_boundary)
1031 substr = strstr(substr+1, pattern);
1080acutest_error_(const
char*
fmt, ...)
1143 printf(
"All conditions have passed.\n");
1147 printf(
"Duration: ");
1154 printf(
"%d condition%s %s failed.\n",
1159 printf(
"Aborted.\n");
1170 }
catch(std::exception& e) {
1171 const char* what = e.what();
1179 printf(
"C++ exception.\n\n");
1187 printf(
"C++ exception.\n\n");
1214#if defined(ACUTEST_UNIX_)
1227 if (pipe(fd) == -1) {
1228 fprintf(stderr,
"Unable to create pipe.\n");
1233 if(pid == (pid_t)-1) {
1234 acutest_error_(
"Cannot fork. %s [%d]", strerror(errno), errno);
1236 }
else if(pid == 0) {
1248 fprintf(stderr,
"Unable to write to pipe\n");
1254 acutest_exit_(failed ? 1 : 0);
1261 case 0: failed = 0;
break;
1263 default: acutest_error_(
"Unexpected exit code [%d]",
WEXITSTATUS(exit_code));
1265 }
else if(WIFSIGNALED(exit_code)) {
1267 const char* signame;
1268 switch(WTERMSIG(exit_code)) {
1269 case SIGINT: signame =
"SIGINT";
break;
1270 case SIGHUP: signame =
"SIGHUP";
break;
1271 case SIGQUIT: signame =
"SIGQUIT";
break;
1272 case SIGABRT: signame =
"SIGABRT";
break;
1273 case SIGKILL: signame =
"SIGKILL";
break;
1274 case SIGSEGV: signame =
"SIGSEGV";
break;
1275 case SIGILL: signame =
"SIGILL";
break;
1276 case SIGTERM: signame =
"SIGTERM";
break;
1277 default:
snprintf(tmp,
sizeof(tmp),
"signal %d", WTERMSIG(exit_code)); signame = tmp;
break;
1279 acutest_error_(
"Test interrupted by %s.", signame);
1281 acutest_error_(
"Test ended in an unexpected way [%d].", exit_code);
1289 while (read(fd[0], p,
sizeof(
char))) {
1299 fprintf(stderr,
"Log message from child too large");
1306#elif defined(ACUTEST_WIN_)
1309 STARTUPINFOA startupInfo;
1310 PROCESS_INFORMATION processInfo;
1312 HANDLE hRead = NULL;
1313 HANDLE hWrite = NULL;
1314 SECURITY_ATTRIBUTES lpPipeAttribute;
1315 lpPipeAttribute.nLength =
sizeof(lpPipeAttribute);
1316 lpPipeAttribute.lpSecurityDescriptor = NULL;
1317 lpPipeAttribute.bInheritHandle = TRUE;
1323 if (!CreatePipe(&hRead, &hWrite, &lpPipeAttribute, 0)) {
1324 fprintf(stderr,
"Error creating pipe\n");
1331 "%s --worker=%d %s --no-exec --no-summary %s --verbose=%d --color=%s --pipe=%I64d -- \"%s\"",
1336 memset(&startupInfo, 0,
sizeof(startupInfo));
1337 startupInfo.cb =
sizeof(STARTUPINFO);
1338 if(CreateProcessA(NULL,
buffer, NULL, NULL, TRUE, 0, NULL, NULL, &startupInfo, &processInfo)) {
1339 WaitForSingleObject(processInfo.hProcess, INFINITE);
1340 GetExitCodeProcess(processInfo.hProcess, &exitCode);
1341 CloseHandle(processInfo.hThread);
1342 CloseHandle(processInfo.hProcess);
1349 while (ReadFile(hRead, p,
sizeof(
char), NULL, NULL)) {
1360 fprintf(stderr,
"Log message from child too large");
1366 CloseHandle(hWrite);
1367 failed = (exitCode != 0);
1370 case 3: acutest_error_(
"Aborted.");
break;
1371 case 0xC0000005: acutest_error_(
"Access violation.");
break;
1372 default: acutest_error_(
"Test ended in an unexpected way [%lu].", exitCode);
break;
1376 acutest_error_(
"Cannot create unit test subprocess [%ld].", GetLastError());
1403#if defined(ACUTEST_WIN_)
1406acutest_seh_exception_filter_(EXCEPTION_POINTERS *ptrs)
1409 acutest_message_(
false,
"Exception code: 0x%08lx", ptrs->ExceptionRecord->ExceptionCode);
1410 acutest_message_(
false,
"Exception address: 0x%p", ptrs->ExceptionRecord->ExceptionAddress);
1415 return EXCEPTION_EXECUTE_HANDLER;
1420#define ACUTEST_CMDLINE_OPTFLAG_OPTIONALARG_ 0x0001
1421#define ACUTEST_CMDLINE_OPTFLAG_REQUIREDARG_ 0x0002
1423#define ACUTEST_CMDLINE_OPTID_NONE_ 0
1424#define ACUTEST_CMDLINE_OPTID_UNKNOWN_ (-0x7fffffff + 0)
1425#define ACUTEST_CMDLINE_OPTID_MISSINGARG_ (-0x7fffffff + 1)
1426#define ACUTEST_CMDLINE_OPTID_BOGUSARG_ (-0x7fffffff + 2)
1437 const char* arggroup,
1438 int (*callback)(
int ,
const char* ))
1444 for(i = 0; arggroup[i] !=
'\0'; i++) {
1445 for(opt = options; opt->
id != 0; opt++) {
1451 ret = callback(opt->
id, NULL);
1455 badoptname[0] =
'-';
1456 badoptname[1] = arggroup[i];
1457 badoptname[2] =
'\0';
1469#define ACUTEST_CMDLINE_AUXBUF_SIZE_ 32
1473 int (*callback)(
int ,
const char* ))
1478 int after_doubledash = 0;
1485 if(after_doubledash || strcmp(argv[i],
"-") == 0) {
1488 }
else if(strcmp(argv[i],
"--") == 0) {
1490 after_doubledash = 1;
1491 }
else if(argv[i][0] !=
'-') {
1495 for(opt = options; opt->
id != 0; opt++) {
1496 if(opt->
longname != NULL && strncmp(argv[i],
"--", 2) == 0) {
1497 size_t len = strlen(opt->
longname);
1498 if(strncmp(argv[i]+2, opt->
longname, len) == 0) {
1500 if(argv[i][2+len] ==
'\0') {
1503 ret = callback(opt->
id, NULL);
1507 }
else if(argv[i][2+len] ==
'=') {
1510 ret = callback(opt->
id, argv[i]+2+len+1);
1520 }
else if(opt->
shortname !=
'\0' && argv[i][0] ==
'-') {
1524 if(argv[i][2] !=
'\0')
1525 ret = callback(opt->
id, argv[i]+2);
1527 ret = callback(opt->
id, argv[++i]);
1532 ret = callback(opt->
id, NULL);
1536 if(ret == 0 && argv[i][2] !=
'\0')
1545 if(argv[i][0] !=
'-') {
1550 char* badoptname = argv[i];
1552 if(strncmp(badoptname,
"--", 2) == 0) {
1554 char* assignment = strchr(badoptname,
'=');
1555 if(assignment != NULL) {
1556 size_t len = assignment - badoptname;
1559 strncpy(auxbuf, badoptname, len);
1561 badoptname = auxbuf;
1583 printf(
"Run the specified unit tests; or if the option '--skip' is used, run all\n");
1584 printf(
"tests in the suite but those listed. By default, if no tests are specified\n");
1585 printf(
"on the command line, all unit tests in the suite are run.\n");
1587 printf(
"Options:\n");
1588 printf(
" -s, --skip Execute all unit tests but the listed ones\n");
1589 printf(
" --exec[=WHEN] If supported, execute unit tests as child processes\n");
1590 printf(
" (WHEN is one of 'auto', 'always', 'never')\n");
1591 printf(
" -E, --no-exec Same as --exec=never\n");
1592#if defined ACUTEST_WIN_
1593 printf(
" -t, --time Measure test duration\n");
1594#elif defined ACUTEST_HAS_POSIX_TIMER_
1595 printf(
" -t, --time Measure test duration (real time)\n");
1596 printf(
" --time=TIMER Measure test duration, using given timer\n");
1597 printf(
" (TIMER is one of 'real', 'cpu')\n");
1599 printf(
" --no-summary Suppress printing of test results summary\n");
1600 printf(
" --tap Produce TAP-compliant output\n");
1601 printf(
" (See https://testanything.org/)\n");
1602 printf(
" -x, --xml-output=FILE Enable XUnit output to the given file\n");
1603 printf(
" -l, --list List unit tests in the suite and exit\n");
1604 printf(
" -v, --verbose Make output more verbose\n");
1605 printf(
" --verbose=LEVEL Set verbose level to LEVEL:\n");
1606 printf(
" 0 ... Be silent\n");
1607 printf(
" 1 ... Output one line per test (and summary)\n");
1608 printf(
" 2 ... As 1 and failed conditions (this is default)\n");
1609 printf(
" 3 ... As 1 and all conditions (and extended summary)\n");
1610 printf(
" -q, --quiet Same as --verbose=0\n");
1611 printf(
" --color[=WHEN] Enable colorized output\n");
1612 printf(
" (WHEN is one of 'auto', 'always', 'never')\n");
1613 printf(
" --no-color Same as --color=never\n");
1614 printf(
" -h, --help Display this help and exit\n");
1623 {
's',
"skip",
's', 0 },
1625 {
'E',
"no-exec",
'E', 0 },
1626#if defined ACUTEST_WIN_
1627 {
't',
"time",
't', 0 },
1628 { 0,
"timer",
't', 0 },
1630#elif defined ACUTEST_HAS_POSIX_TIMER_
1634 { 0,
"no-summary",
'S', 0 },
1635 { 0,
"tap",
'T', 0 },
1636 {
'l',
"list",
'l', 0 },
1638 {
'q',
"quiet",
'q', 0 },
1640 { 0,
"no-color",
'C', 0 },
1641 {
'h',
"help",
'h', 0 },
1656 if(arg == NULL || strcmp(arg,
"always") == 0) {
1658 }
else if(strcmp(arg,
"never") == 0) {
1660 }
else if(strcmp(arg,
"auto") == 0) {
1663 fprintf(stderr,
"%s: Unrecognized argument '%s' for option --exec.\n",
acutest_argv0_, arg);
1664 fprintf(stderr,
"Try '%s --help' for more information.\n",
acutest_argv0_);
1674#if defined ACUTEST_WIN_ || defined ACUTEST_HAS_POSIX_TIMER_
1675 if(arg == NULL || strcmp(arg,
"real") == 0) {
1677 #ifndef ACUTEST_WIN_
1678 }
else if(strcmp(arg,
"cpu") == 0) {
1682 fprintf(stderr,
"%s: Unrecognized argument '%s' for option --time.\n",
acutest_argv0_, arg);
1683 fprintf(stderr,
"Try '%s --help' for more information.\n",
acutest_argv0_);
1706#if defined ACUTEST_WIN_
1708 hChildWrite = (HANDLE)(ULONG_PTR)_atoi64(arg);
1716 if(arg == NULL || strcmp(arg,
"always") == 0) {
1718 }
else if(strcmp(arg,
"never") == 0) {
1720 }
else if(strcmp(arg,
"auto") == 0) {
1723 fprintf(stderr,
"%s: Unrecognized argument '%s' for option --color.\n",
acutest_argv0_, arg);
1724 fprintf(stderr,
"Try '%s --help' for more information.\n",
acutest_argv0_);
1745 fprintf(stderr,
"Unable to open '%s': %s\n", arg, strerror(errno));
1752 fprintf(stderr,
"%s: Unrecognized unit test '%s'\n",
acutest_argv0_, arg);
1753 fprintf(stderr,
"Try '%s --list' for list of unit tests.\n",
acutest_argv0_);
1759 fprintf(stderr,
"Unrecognized command line option '%s'.\n", arg);
1760 fprintf(stderr,
"Try '%s --help' for more information.\n",
acutest_argv0_);
1765 fprintf(stderr,
"The command line option '%s' requires an argument.\n", arg);
1766 fprintf(stderr,
"Try '%s --help' for more information.\n",
acutest_argv0_);
1771 fprintf(stderr,
"The command line option '%s' does not expect an argument.\n", arg);
1772 fprintf(stderr,
"Try '%s --help' for more information.\n",
acutest_argv0_);
1781#ifdef ACUTEST_LINUX_
1783acutest_is_tracer_present_(
void)
1786 static const int OVERLAP = 32;
1788 char buf[256+OVERLAP+1];
1789 int tracer_present = 0;
1793 fd = open(
"/proc/self/status", O_RDONLY);
1798 static const char pattern[] =
"TracerPid:";
1801 while(n_read <
sizeof(buf) - 1) {
1804 n = read(fd, buf + n_read,
sizeof(buf) - 1 - n_read);
1811 field = strstr(buf, pattern);
1812 if(field != NULL && field < buf +
sizeof(buf) - OVERLAP) {
1813 pid_t tracer_pid = (pid_t) atoi(field +
sizeof(pattern) - 1);
1814 tracer_present = (tracer_pid != 0);
1818 if(n_read ==
sizeof(buf)-1) {
1819 memmove(buf, buf +
sizeof(buf)-1 - OVERLAP, OVERLAP);
1827 return tracer_present;
1839#if defined ACUTEST_UNIX_
1841#elif defined ACUTEST_WIN_
1842 #if defined _BORLANDC_
1858 fprintf(stderr,
"Out of memory.\n");
1868#if defined(ACUTEST_WIN_)
1869 SetUnhandledExceptionFilter(acutest_seh_exception_filter_);
1871 _set_abort_behavior(0, _WRITE_ABORT_MSG);
1889 if(IsDebuggerPresent())
1892#ifdef ACUTEST_LINUX_
1893 if(acutest_is_tracer_present_())
1896#ifdef RUNNING_ON_VALGRIND
1940 printf(
" All unit tests have passed.\n");
1943 printf(
" %d of %d unit tests %s failed.\n",
1953#if defined ACUTEST_UNIX_
1954 char *suite_name = basename(argv[0]);
1955#elif defined ACUTEST_WIN_
1956 char suite_name[_MAX_FNAME];
1957 _splitpath(argv[0], NULL, NULL, suite_name, NULL);
1959 const char *suite_name = argv[0];
1963 fprintf(
acutest_xml_output_,
"<testsuite name=\"%s\" tests=\"%d\" errors=\"%d\" failures=\"%d\" skip=\"%d\">\n",
1993 #pragma warning(pop)
#define ACUTEST_CMDLINE_OPTID_NONE_
#define ACUTEST_ATTRIBUTE_(attr)
vsnprintf(buffer, sizeof(buffer), fmt, args)
static void acutest_init_(const char *test_name)
struct acutest_test_CMDLINE_OPTION_ ACUTEST_CMDLINE_OPTION_
static int acutest_test_failures_
#define ACUTEST_COLOR_DEFAULT_INTENSIVE_
static const ACUTEST_CMDLINE_OPTION_ acutest_cmdline_options_[]
static int const char char buffer[256]
static void acutest_line_indent_(int level)
#define ACUTEST_COLOR_GREEN_INTENSIVE_
static int acutest_name_contains_word_(const char *name, const char *pattern)
static int acutest_test_already_logged_
static int acutest_no_exec_
static FILE * acutest_xml_output_
int acutest_check_(int cond, const char *file, int line, const char *fmt,...)
static int acutest_worker_
static int acutest_stat_run_units_
static int acutest_colorize_
static char acutest_case_name_[TEST_CASE_MAXSIZE]
static void acutest_cleanup_(void)
int main(int argc, char **argv)
static int acutest_cond_failed_
static void acutest_timer_print_diff_(void)
#define ACUTEST_COLOR_GREEN_
static int acutest_case_already_logged_
void acutest_dump_(bool always, const char *title, const void *addr, size_t size)
static const struct acutest_test_ * acutest_current_test_
#define TEST_CASE_MAXSIZE
static void acutest_set_duration_(int i, double duration)
static void acutest_help_(void)
static int acutest_timer_
static void acutest_finish_test_line_(int result)
#define ACUTEST_CMDLINE_OPTID_MISSINGARG_
acutest_test_data_[acutest_current_index_] log_tail
static void acutest_fini_(const char *test_name)
void acutest_message_(bool always, const char *fmt,...)
static void acutest_timer_get_time_(int *ts)
#define ACUTEST_CMDLINE_OPTID_UNKNOWN_
#define ACUTEST_CMDLINE_OPTID_BOGUSARG_
static void acutest_list_names_(void)
static int acutest_cmdline_read_(const ACUTEST_CMDLINE_OPTION_ *options, int argc, char **argv, int(*callback)(int, const char *))
static void acutest_run_(const struct acutest_test_ *test, int index, int master_index)
static void acutest_set_success_(int i, int success)
static int acutest_verbose_level_
const struct acutest_test_ acutest_list_[]
static int acutest_skip_mode_
static int acutest_cmdline_handle_short_opt_group_(const ACUTEST_CMDLINE_OPTION_ *options, const char *arggroup, int(*callback)(int, const char *))
void acutest_timer_init_(void)
#define ACUTEST_CMDLINE_AUXBUF_SIZE_
static int acutest_abort_has_jmp_buf_
acutest_data_log_ * log_tail
acutest_data_log_ * log_head
strcpy(log_entry->msg, buffer)
static void acutest_begin_test_line_(const struct acutest_test_ *test)
static void acutest_remember_(int i)
static int acutest_lookup_(const char *pattern)
void const char char * line_beg
int const char int const char int result_color
static int acutest_do_run_(const struct acutest_test_ *test, int index)
static double acutest_timer_diff_(int start, int end)
static int acutest_was_aborted_
void acutest_abort_(void) ACUTEST_ATTRIBUTE_(noreturn)
#define ACUTEST_CMDLINE_OPTFLAG_REQUIREDARG_
static int const char * fmt
static int acutest_worker_index_
static int acutest_cmdline_callback_(int id, const char *arg)
static size_t acutest_count_
void acutest_log_(const char *fmt,...)
static jmp_buf acutest_abort_jmp_buf_
#define ACUTEST_COLOR_RED_INTENSIVE_
static int acutest_stat_failed_units_
#define ACUTEST_COLOR_RED_
#define TEST_DUMP_MAXSIZE
static acutest_timer_type_ acutest_timer_start_
static int acutest_current_index_
static int acutest_no_summary_
static char * acutest_argv0_
static acutest_timer_type_ acutest_timer_end_
#define ACUTEST_CMDLINE_OPTFLAG_OPTIONALARG_
void acutest_case_(const char *fmt,...)
void acutest_data_log_ * log_entry
static size_t acutest_list_size_
static char const * spaces
#define RUNNING_ON_VALGRIND
waitpid(reap->pid_ev->pid, &status, 0)
#define WIFEXITED(stat_val)
#define WEXITSTATUS(stat_val)
Signals that can be sent to a request.
PUBLIC int snprintf(char *string, size_t length, char *format, va_alist)