62#define TEST_LIST const struct acutest_test_ acutest_list_[]
64#define TEST_TERMINATOR { .name = NULL }
86#define TEST_CHECK_(cond,...) acutest_check_((cond), __FILE__, __LINE__, __VA_ARGS__)
87#define TEST_CHECK(cond) acutest_check_((cond), __FILE__, __LINE__, "%s", #cond)
105#define TEST_ASSERT_(cond,...) \
107 if(!acutest_check_((cond), __FILE__, __LINE__, __VA_ARGS__)) \
110#define TEST_ASSERT(cond) \
112 if(!acutest_check_((cond), __FILE__, __LINE__, "%s", #cond)) \
132#define TEST_EXCEPTION(code, exctype) \
134 bool exc_ok_ = false; \
135 const char *msg_ = NULL; \
138 msg_ = "No exception thrown."; \
139 } catch(exctype const&) { \
142 msg_ = "Unexpected exception thrown."; \
144 acutest_check_(exc_ok_, __FILE__, __LINE__, #code " throws " #exctype);\
146 acutest_message_(false, "%s", msg_); \
148#define TEST_EXCEPTION_(code, exctype, ...) \
150 bool exc_ok_ = false; \
151 const char *msg_ = NULL; \
154 msg_ = "No exception thrown."; \
155 } catch(exctype const&) { \
158 msg_ = "Unexpected exception thrown."; \
160 acutest_check_(exc_ok_, __FILE__, __LINE__, __VA_ARGS__); \
162 acutest_message_(false, "%s", msg_); \
185#define TEST_CASE_(...) acutest_case_(__VA_ARGS__)
186#define TEST_CASE(name) acutest_case_("%s", name)
192#ifndef TEST_CASE_MAXSIZE
193 #define TEST_CASE_MAXSIZE 64
217#define TEST_MSG(...) TEST_MSG_FAIL(__VA_ARGS__)
218#define TEST_MSG_FAIL(...) acutest_message_(false, __VA_ARGS__)
224#define TEST_MSG_ALWAYS(...) acutest_message_(true, __VA_ARGS__)
229#ifndef TEST_MSG_MAXSIZE
230 #define TEST_MSG_MAXSIZE 1024
245#define TEST_DUMP(title, addr, size) TEST_DUMP_FAIL(title, addr, size)
246#define TEST_DUMP_FAIL(title, addr, size) acutest_dump_(false, title, addr, size);
251#define TEST_DUMP_ALWAYS(title, addr, size) acutest_dump_(true, title, addr, size);
256#ifndef TEST_DUMP_MAXSIZE
257 #define TEST_DUMP_MAXSIZE 1024
264#define TEST_LOG_MAXSIZE ((TEST_DUMP_MAXSIZE * 3) + TEST_MSG_MAXSIZE + 3)
301#if defined(unix) || defined(__unix__) || defined(__unix) || defined(__APPLE__)
302 #define ACUTEST_UNIX_ 1
306 #include <sys/types.h>
307 #include <sys/wait.h>
311 #if defined CLOCK_PROCESS_CPUTIME_ID && defined CLOCK_MONOTONIC
312 #define ACUTEST_HAS_POSIX_TIMER_ 1
316#if defined(_gnu_linux_) || defined(__linux__)
317 #define ACUTEST_LINUX_ 1
319 #include <sys/stat.h>
322#if defined(_WIN32) || defined(__WIN32__) || defined(__WINDOWS__)
323 #define ACUTEST_WIN_ 1
333 #if __has_include(<valgrind.h>)
334 #include <valgrind.h>
339#if defined(__GNUC__) || defined(__clang__)
340 #define ACUTEST_ATTRIBUTE_(attr) __attribute__((attr))
342 #define ACUTEST_ATTRIBUTE_(attr)
356 #pragma warning(push)
357 #pragma warning(disable: 4996)
392void acutest_dump_(
bool always,
const char* title,
const void* addr,
size_t size);
428#if defined ACUTEST_WIN_
429HANDLE hChildWrite = NULL;
443#if defined ACUTEST_WIN_
446 fprintf(stderr,
"Upable to write to pipe");
458acutest_exit_(
int exit_code)
464#if defined ACUTEST_WIN_
466 static LARGE_INTEGER acutest_timer_freq_;
473 QueryPerformanceFrequency(´st_timer_freq_);
479 QueryPerformanceCounter(ts);
485 double duration = (double)(end.QuadPart - start.QuadPart);
486 duration /= (double)acutest_timer_freq_.QuadPart;
495#elif defined ACUTEST_HAS_POSIX_TIMER_
496 static clockid_t acutest_timer_id_;
505 acutest_timer_id_ = CLOCK_MONOTONIC;
507 acutest_timer_id_ = CLOCK_PROCESS_CPUTIME_ID;
513 clock_gettime(acutest_timer_id_, ts);
524 endns += end.tv_nsec;
526 startns = start.tv_sec;
528 startns += start.tv_nsec;
530 return ((endns - startns)/ 1e9);
567#define ACUTEST_COLOR_DEFAULT_ 0
568#define ACUTEST_COLOR_GREEN_ 1
569#define ACUTEST_COLOR_RED_ 2
570#define ACUTEST_COLOR_DEFAULT_INTENSIVE_ 3
571#define ACUTEST_COLOR_GREEN_INTENSIVE_ 4
572#define ACUTEST_COLOR_RED_INTENSIVE_ 5
575acutest_colored_printf_(
int color, const
char*
fmt, ...)
587 return printf(
"%s",
buffer);
590#if defined ACUTEST_UNIX_
599 default: col_str =
"\033[0m";
break;
601 printf(
"%s", col_str);
606#elif defined ACUTEST_WIN_
609 CONSOLE_SCREEN_BUFFER_INFO info;
612 h = GetStdHandle(STD_OUTPUT_HANDLE);
613 GetConsoleScreenBufferInfo(h, &info);
621 default: attr = 0;
break;
624 SetConsoleTextAttribute(h, attr);
626 SetConsoleTextAttribute(h, info.wAttributes);
660 const char* str = (result == 0) ?
"ok" :
"not ok";
665 printf(
"# Duration: ");
671 const char* str = (result == 0) ?
"OK" :
"FAILED";
673 acutest_colored_printf_(color,
"%s", str);
688 static const char spaces[] =
" ";
738 const char* lastsep1 = strrchr(
file,
'\\');
739 const char* lastsep2 = strrchr(
file,
'/');
744 file = (lastsep1 > lastsep2 ? lastsep1 : lastsep2) + 1;
746 const char* lastsep = strrchr(
file,
'/');
750 printf(
"%s:%d: Check ",
file,
line);
776 fprintf(stderr,
"Out of memory.\n");
798 fprintf(stderr,
"Out of memory.\n");
875 static const size_t BYTES_PER_LINE = 16;
878 size_t buflen = (size * 3) + strlen(title) + 2;
897 buffer = (
char *)calloc(buflen,
sizeof(
char));
901 printf((title[strlen(title)-1] ==
':') ?
"%s\n" :
"%s:\n", title);
904 p =
buffer + strlen(title);
905 if (title[strlen(title) - 1] !=
':') {
915 printf(
"%08lx: ", (
unsigned long)
line_beg);
918 printf(
" %02x", ((
const unsigned char*)addr)[off]);
919 snprintf(p, end - p,
" %02x", ((
const unsigned char*)addr)[off]);
927 unsigned char byte = ((
const unsigned char*)addr)[off];
929 printf(
"%c", (iscntrl(
byte) ?
'.' : byte));
939 printf(
" ... (and more %u bytes)\n", (
unsigned) truncate);
989 printf(
"Unit tests:\n");
991 printf(
" %s\n", test->
name);
1019 static const char word_delim[] =
" \t-_/.,:;";
1023 pattern_len = strlen(pattern);
1025 substr = strstr(
name, pattern);
1026 while(substr != NULL) {
1027 int starts_on_word_boundary = (substr ==
name || strchr(word_delim, substr[-1]) != NULL);
1028 int ends_on_word_boundary = (substr[pattern_len] ==
'\0' || strchr(word_delim, substr[pattern_len]) != NULL);
1030 if(starts_on_word_boundary && ends_on_word_boundary)
1033 substr = strstr(substr+1, pattern);
1082acutest_error_(const
char*
fmt, ...)
1145 printf(
"All conditions have passed.\n");
1149 printf(
"Duration: ");
1156 printf(
"%d condition%s %s failed.\n",
1161 printf(
"Aborted.\n");
1172 }
catch(std::exception& e) {
1173 const char* what = e.what();
1181 printf(
"C++ exception.\n\n");
1189 printf(
"C++ exception.\n\n");
1216#if defined(ACUTEST_UNIX_)
1229 if (pipe(fd) == -1) {
1230 fprintf(stderr,
"Unable to create pipe.\n");
1235 if(pid == (pid_t)-1) {
1236 acutest_error_(
"Cannot fork. %s [%d]", strerror(errno), errno);
1238 }
else if(pid == 0) {
1250 fprintf(stderr,
"Unable to write to pipe\n");
1256 acutest_exit_(failed ? 1 : 0);
1263 case 0: failed = 0;
break;
1265 default: acutest_error_(
"Unexpected exit code [%d]",
WEXITSTATUS(exit_code));
1267 }
else if(WIFSIGNALED(exit_code)) {
1269 const char* signame;
1270 switch(WTERMSIG(exit_code)) {
1271 case SIGINT: signame =
"SIGINT";
break;
1272 case SIGHUP: signame =
"SIGHUP";
break;
1273 case SIGQUIT: signame =
"SIGQUIT";
break;
1274 case SIGABRT: signame =
"SIGABRT";
break;
1275 case SIGKILL: signame =
"SIGKILL";
break;
1276 case SIGSEGV: signame =
"SIGSEGV";
break;
1277 case SIGILL: signame =
"SIGILL";
break;
1278 case SIGTERM: signame =
"SIGTERM";
break;
1279 default:
snprintf(tmp,
sizeof(tmp),
"signal %d", WTERMSIG(exit_code)); signame = tmp;
break;
1281 acutest_error_(
"Test interrupted by %s.", signame);
1283 acutest_error_(
"Test ended in an unexpected way [%d].", exit_code);
1291 while (read(fd[0], p,
sizeof(
char))) {
1301 fprintf(stderr,
"Log message from child too large");
1308#elif defined(ACUTEST_WIN_)
1311 STARTUPINFOA startupInfo;
1312 PROCESS_INFORMATION processInfo;
1314 HANDLE hRead = NULL;
1315 HANDLE hWrite = NULL;
1316 SECURITY_ATTRIBUTES lpPipeAttribute;
1317 lpPipeAttribute.nLength =
sizeof(lpPipeAttribute);
1318 lpPipeAttribute.lpSecurityDescriptor = NULL;
1319 lpPipeAttribute.bInheritHandle = TRUE;
1325 if (!CreatePipe(&hRead, &hWrite, &lpPipeAttribute, 0)) {
1326 fprintf(stderr,
"Error creating pipe\n");
1333 "%s --worker=%d %s --no-exec --no-summary %s --verbose=%d --color=%s --pipe=%I64d -- \"%s\"",
1338 memset(&startupInfo, 0,
sizeof(startupInfo));
1339 startupInfo.cb =
sizeof(STARTUPINFO);
1340 if(CreateProcessA(NULL,
buffer, NULL, NULL, TRUE, 0, NULL, NULL, &startupInfo, &processInfo)) {
1341 WaitForSingleObject(processInfo.hProcess, INFINITE);
1342 GetExitCodeProcess(processInfo.hProcess, &exitCode);
1343 CloseHandle(processInfo.hThread);
1344 CloseHandle(processInfo.hProcess);
1351 while (ReadFile(hRead, p,
sizeof(
char), NULL, NULL)) {
1362 fprintf(stderr,
"Log message from child too large");
1368 CloseHandle(hWrite);
1369 failed = (exitCode != 0);
1372 case 3: acutest_error_(
"Aborted.");
break;
1373 case 0xC0000005: acutest_error_(
"Access violation.");
break;
1374 default: acutest_error_(
"Test ended in an unexpected way [%lu].", exitCode);
break;
1378 acutest_error_(
"Cannot create unit test subprocess [%ld].", GetLastError());
1405#if defined(ACUTEST_WIN_)
1408acutest_seh_exception_filter_(EXCEPTION_POINTERS *ptrs)
1411 acutest_message_(
false,
"Exception code: 0x%08lx", ptrs->ExceptionRecord->ExceptionCode);
1412 acutest_message_(
false,
"Exception address: 0x%p", ptrs->ExceptionRecord->ExceptionAddress);
1417 return EXCEPTION_EXECUTE_HANDLER;
1422#define ACUTEST_CMDLINE_OPTFLAG_OPTIONALARG_ 0x0001
1423#define ACUTEST_CMDLINE_OPTFLAG_REQUIREDARG_ 0x0002
1425#define ACUTEST_CMDLINE_OPTID_NONE_ 0
1426#define ACUTEST_CMDLINE_OPTID_UNKNOWN_ (-0x7fffffff + 0)
1427#define ACUTEST_CMDLINE_OPTID_MISSINGARG_ (-0x7fffffff + 1)
1428#define ACUTEST_CMDLINE_OPTID_BOGUSARG_ (-0x7fffffff + 2)
1439 const char* arggroup,
1440 int (*callback)(
int ,
const char* ))
1446 for(i = 0; arggroup[i] !=
'\0'; i++) {
1447 for(opt = options; opt->
id != 0; opt++) {
1453 ret = callback(opt->
id, NULL);
1457 badoptname[0] =
'-';
1458 badoptname[1] = arggroup[i];
1459 badoptname[2] =
'\0';
1471#define ACUTEST_CMDLINE_AUXBUF_SIZE_ 32
1475 int (*callback)(
int ,
const char* ))
1480 int after_doubledash = 0;
1487 if(after_doubledash || strcmp(argv[i],
"-") == 0) {
1490 }
else if(strcmp(argv[i],
"--") == 0) {
1492 after_doubledash = 1;
1493 }
else if(argv[i][0] !=
'-') {
1497 for(opt = options; opt->
id != 0; opt++) {
1498 if(opt->
longname != NULL && strncmp(argv[i],
"--", 2) == 0) {
1499 size_t len = strlen(opt->
longname);
1500 if(strncmp(argv[i]+2, opt->
longname, len) == 0) {
1502 if(argv[i][2+len] ==
'\0') {
1505 ret = callback(opt->
id, NULL);
1509 }
else if(argv[i][2+len] ==
'=') {
1512 ret = callback(opt->
id, argv[i]+2+len+1);
1522 }
else if(opt->
shortname !=
'\0' && argv[i][0] ==
'-') {
1526 if(argv[i][2] !=
'\0')
1527 ret = callback(opt->
id, argv[i]+2);
1529 ret = callback(opt->
id, argv[++i]);
1534 ret = callback(opt->
id, NULL);
1538 if(ret == 0 && argv[i][2] !=
'\0')
1547 if(argv[i][0] !=
'-') {
1552 char* badoptname = argv[i];
1554 if(strncmp(badoptname,
"--", 2) == 0) {
1556 char* assignment = strchr(badoptname,
'=');
1557 if(assignment != NULL) {
1558 size_t len = assignment - badoptname;
1561 strncpy(auxbuf, badoptname, len);
1563 badoptname = auxbuf;
1585 printf(
"Run the specified unit tests; or if the option '--skip' is used, run all\n");
1586 printf(
"tests in the suite but those listed. By default, if no tests are specified\n");
1587 printf(
"on the command line, all unit tests in the suite are run.\n");
1589 printf(
"Options:\n");
1590 printf(
" -s, --skip Execute all unit tests but the listed ones\n");
1591 printf(
" --exec[=WHEN] If supported, execute unit tests as child processes\n");
1592 printf(
" (WHEN is one of 'auto', 'always', 'never')\n");
1593 printf(
" -E, --no-exec Same as --exec=never\n");
1594#if defined ACUTEST_WIN_
1595 printf(
" -t, --time Measure test duration\n");
1596#elif defined ACUTEST_HAS_POSIX_TIMER_
1597 printf(
" -t, --time Measure test duration (real time)\n");
1598 printf(
" --time=TIMER Measure test duration, using given timer\n");
1599 printf(
" (TIMER is one of 'real', 'cpu')\n");
1601 printf(
" --no-summary Suppress printing of test results summary\n");
1602 printf(
" --tap Produce TAP-compliant output\n");
1603 printf(
" (See https://testanything.org/)\n");
1604 printf(
" -x, --xml-output=FILE Enable XUnit output to the given file\n");
1605 printf(
" -l, --list List unit tests in the suite and exit\n");
1606 printf(
" -v, --verbose Make output more verbose\n");
1607 printf(
" --verbose=LEVEL Set verbose level to LEVEL:\n");
1608 printf(
" 0 ... Be silent\n");
1609 printf(
" 1 ... Output one line per test (and summary)\n");
1610 printf(
" 2 ... As 1 and failed conditions (this is default)\n");
1611 printf(
" 3 ... As 1 and all conditions (and extended summary)\n");
1612 printf(
" -q, --quiet Same as --verbose=0\n");
1613 printf(
" --color[=WHEN] Enable colorized output\n");
1614 printf(
" (WHEN is one of 'auto', 'always', 'never')\n");
1615 printf(
" --no-color Same as --color=never\n");
1616 printf(
" -h, --help Display this help and exit\n");
1625 {
's',
"skip",
's', 0 },
1627 {
'E',
"no-exec",
'E', 0 },
1628#if defined ACUTEST_WIN_
1629 {
't',
"time",
't', 0 },
1630 { 0,
"timer",
't', 0 },
1632#elif defined ACUTEST_HAS_POSIX_TIMER_
1636 { 0,
"no-summary",
'S', 0 },
1637 { 0,
"tap",
'T', 0 },
1638 {
'l',
"list",
'l', 0 },
1640 {
'q',
"quiet",
'q', 0 },
1642 { 0,
"no-color",
'C', 0 },
1643 {
'h',
"help",
'h', 0 },
1658 if(arg == NULL || strcmp(arg,
"always") == 0) {
1660 }
else if(strcmp(arg,
"never") == 0) {
1662 }
else if(strcmp(arg,
"auto") == 0) {
1665 fprintf(stderr,
"%s: Unrecognized argument '%s' for option --exec.\n",
acutest_argv0_, arg);
1666 fprintf(stderr,
"Try '%s --help' for more information.\n",
acutest_argv0_);
1676#if defined ACUTEST_WIN_ || defined ACUTEST_HAS_POSIX_TIMER_
1677 if(arg == NULL || strcmp(arg,
"real") == 0) {
1679 #ifndef ACUTEST_WIN_
1680 }
else if(strcmp(arg,
"cpu") == 0) {
1684 fprintf(stderr,
"%s: Unrecognized argument '%s' for option --time.\n",
acutest_argv0_, arg);
1685 fprintf(stderr,
"Try '%s --help' for more information.\n",
acutest_argv0_);
1708#if defined ACUTEST_WIN_
1710 hChildWrite = (HANDLE)(ULONG_PTR)_atoi64(arg);
1718 if(arg == NULL || strcmp(arg,
"always") == 0) {
1720 }
else if(strcmp(arg,
"never") == 0) {
1722 }
else if(strcmp(arg,
"auto") == 0) {
1725 fprintf(stderr,
"%s: Unrecognized argument '%s' for option --color.\n",
acutest_argv0_, arg);
1726 fprintf(stderr,
"Try '%s --help' for more information.\n",
acutest_argv0_);
1747 fprintf(stderr,
"Unable to open '%s': %s\n", arg, strerror(errno));
1754 fprintf(stderr,
"%s: Unrecognized unit test '%s'\n",
acutest_argv0_, arg);
1755 fprintf(stderr,
"Try '%s --list' for list of unit tests.\n",
acutest_argv0_);
1761 fprintf(stderr,
"Unrecognized command line option '%s'.\n", arg);
1762 fprintf(stderr,
"Try '%s --help' for more information.\n",
acutest_argv0_);
1767 fprintf(stderr,
"The command line option '%s' requires an argument.\n", arg);
1768 fprintf(stderr,
"Try '%s --help' for more information.\n",
acutest_argv0_);
1773 fprintf(stderr,
"The command line option '%s' does not expect an argument.\n", arg);
1774 fprintf(stderr,
"Try '%s --help' for more information.\n",
acutest_argv0_);
1783#ifdef ACUTEST_LINUX_
1785acutest_is_tracer_present_(
void)
1788 static const int OVERLAP = 32;
1790 char buf[256+OVERLAP+1];
1791 int tracer_present = 0;
1795 fd = open(
"/proc/self/status", O_RDONLY);
1800 static const char pattern[] =
"TracerPid:";
1803 while(n_read <
sizeof(buf) - 1) {
1806 n = read(fd, buf + n_read,
sizeof(buf) - 1 - n_read);
1813 field = strstr(buf, pattern);
1814 if(field != NULL && field < buf +
sizeof(buf) - OVERLAP) {
1815 pid_t tracer_pid = (pid_t) atoi(field +
sizeof(pattern) - 1);
1816 tracer_present = (tracer_pid != 0);
1820 if(n_read ==
sizeof(buf)-1) {
1821 memmove(buf, buf +
sizeof(buf)-1 - OVERLAP, OVERLAP);
1829 return tracer_present;
1841#if defined ACUTEST_UNIX_
1843#elif defined ACUTEST_WIN_
1844 #if defined _BORLANDC_
1860 fprintf(stderr,
"Out of memory.\n");
1870#if defined(ACUTEST_WIN_)
1871 SetUnhandledExceptionFilter(acutest_seh_exception_filter_);
1873 _set_abort_behavior(0, _WRITE_ABORT_MSG);
1891 if(IsDebuggerPresent())
1894#ifdef ACUTEST_LINUX_
1895 if(acutest_is_tracer_present_())
1898#ifdef RUNNING_ON_VALGRIND
1942 printf(
" All unit tests have passed.\n");
1945 printf(
" %d of %d unit tests %s failed.\n",
1955#if defined ACUTEST_UNIX_
1956 char *suite_name = basename(argv[0]);
1957#elif defined ACUTEST_WIN_
1958 char suite_name[_MAX_FNAME];
1959 _splitpath(argv[0], NULL, NULL, suite_name, NULL);
1961 const char *suite_name = argv[0];
1965 fprintf(
acutest_xml_output_,
"<testsuite name=\"%s\" tests=\"%d\" errors=\"%d\" failures=\"%d\" skip=\"%d\">\n",
1995 #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)