35 #if (__cplusplus >= 199711L && !defined __cpp_exceptions) || \
36 ((defined(__GNUC__) || defined(__clang__)) && !defined __EXCEPTIONS)
37 #ifndef TEST_NO_EXCEPTIONS
38 #define TEST_NO_EXCEPTIONS
75#define TEST_LIST const struct acutest_test_ acutest_list_[]
77#define TEST_TERMINATOR { .name = NULL }
99#define TEST_CHECK_(cond,...) \
100 acutest_check_(!!(cond), __FILE__, __LINE__, __VA_ARGS__)
101#define TEST_CHECK(cond) \
102 acutest_check_(!!(cond), __FILE__, __LINE__, "%s", #cond)
120#define TEST_ASSERT_(cond,...) \
122 if(!acutest_check_(!!(cond), __FILE__, __LINE__, __VA_ARGS__)) \
125#define TEST_ASSERT(cond) \
127 if(!acutest_check_(!!(cond), __FILE__, __LINE__, "%s", #cond)) \
133#ifndef TEST_NO_EXCEPTIONS
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__, #code " throws " #exctype);\
162 acutest_message_(false, "%s", msg_); \
164#define TEST_EXCEPTION_(code, exctype, ...) \
166 bool exc_ok_ = false; \
167 const char *msg_ = NULL; \
170 msg_ = "No exception thrown."; \
171 } catch(exctype const&) { \
174 msg_ = "Unexpected exception thrown."; \
176 acutest_check_(exc_ok_, __FILE__, __LINE__, __VA_ARGS__); \
178 acutest_message_(false, "%s", msg_); \
202#define TEST_CASE_(...) acutest_case_(__VA_ARGS__)
203#define TEST_CASE(name) acutest_case_("%s", name)
209#ifndef TEST_CASE_MAXSIZE
210 #define TEST_CASE_MAXSIZE 64
234#define TEST_MSG(...) TEST_MSG_FAIL(__VA_ARGS__)
235#define TEST_MSG_FAIL(...) acutest_message_(false, __VA_ARGS__)
241#define TEST_MSG_ALWAYS(...) acutest_message_(true, __VA_ARGS__)
246#ifndef TEST_MSG_MAXSIZE
247 #define TEST_MSG_MAXSIZE 1024
262#define TEST_DUMP(title, addr, size) TEST_DUMP_FAIL(title, addr, size)
263#define TEST_DUMP_FAIL(title, addr, size) acutest_dump_(false, title, addr, size);
268#define TEST_DUMP_ALWAYS(title, addr, size) acutest_dump_(true, title, addr, size);
273#ifndef TEST_DUMP_MAXSIZE
274 #define TEST_DUMP_MAXSIZE 1024
281#define TEST_LOG_MAXSIZE ((TEST_DUMP_MAXSIZE * 3) + TEST_MSG_MAXSIZE + 3)
290#define TEST_SKIP(...) acutest_skip_(__FILE__, __LINE__, __VA_ARGS__)
330#if defined(__GNUC__) || defined(__clang__)
331 #define ACUTEST_ATTRIBUTE_(attr) __attribute__((attr))
333 #define ACUTEST_ATTRIBUTE_(attr)
357void acutest_dump_(
bool always,
const char* title,
const void* addr,
size_t size);
371#if defined(unix) || defined(__unix__) || defined(__unix) || defined(__APPLE__)
372 #define ACUTEST_UNIX_ 1
376 #include <sys/types.h>
377 #include <sys/wait.h>
381 #if defined CLOCK_PROCESS_CPUTIME_ID && defined CLOCK_MONOTONIC
382 #define ACUTEST_HAS_POSIX_TIMER_ 1
386#if defined(_gnu_linux_) || defined(__linux__)
387 #define ACUTEST_LINUX_ 1
389 #include <sys/stat.h>
392#if defined(_WIN32) || defined(__WIN32__) || defined(__WINDOWS__)
393 #define ACUTEST_WIN_ 1
398#if defined(__APPLE__)
399 #define ACUTEST_MACOS_
402 #include <sys/types.h>
404 #include <sys/sysctl.h>
408#ifndef TEST_NO_EXCEPTIONS
414 #if __has_include(<valgrind.h>)
415 #include <valgrind.h>
430 #pragma warning(push)
431 #pragma warning(disable: 4996)
499#if defined ACUTEST_WIN_
500HANDLE hChildWrite = NULL;
514#if defined ACUTEST_WIN_
517 fprintf(stderr,
"Upable to write to pipe");
529acutest_exit_(
int exit_code)
536#if defined ACUTEST_WIN_
538 static LARGE_INTEGER acutest_timer_freq_;
545 QueryPerformanceFrequency(´st_timer_freq_);
551 QueryPerformanceCounter(ts);
557 double duration = (double)(end.QuadPart - start.QuadPart);
558 duration /= (double)acutest_timer_freq_.QuadPart;
567#elif defined ACUTEST_HAS_POSIX_TIMER_
568 static clockid_t acutest_timer_id_;
577 acutest_timer_id_ = CLOCK_MONOTONIC;
579 acutest_timer_id_ = CLOCK_PROCESS_CPUTIME_ID;
585 clock_gettime(acutest_timer_id_, ts);
591 return (
double)(end.tv_sec - start.tv_sec) + (
double)(end.tv_nsec - start.tv_nsec) / 1e9;
628#define ACUTEST_COLOR_DEFAULT_ 0
629#define ACUTEST_COLOR_RED_ 1
630#define ACUTEST_COLOR_GREEN_ 2
631#define ACUTEST_COLOR_YELLOW_ 3
632#define ACUTEST_COLOR_DEFAULT_INTENSIVE_ 10
633#define ACUTEST_COLOR_RED_INTENSIVE_ 11
634#define ACUTEST_COLOR_GREEN_INTENSIVE_ 12
635#define ACUTEST_COLOR_YELLOW_INTENSIVE_ 13
638acutest_colored_printf_(
int color, const
char*
fmt, ...)
650 return printf(
"%s",
buffer);
653#if defined ACUTEST_UNIX_
664 default: col_str =
"\033[0m";
break;
666 printf(
"%s", col_str);
671#elif defined ACUTEST_WIN_
674 CONSOLE_SCREEN_BUFFER_INFO info;
677 h = GetStdHandle(STD_OUTPUT_HANDLE);
678 GetConsoleScreenBufferInfo(h, &info);
688 default: attr = 0;
break;
691 SetConsoleTextAttribute(h, attr);
693 SetConsoleTextAttribute(h, info.wAttributes);
707 name = strrchr(path,
'/');
715 const char* alt_name;
717 alt_name = strrchr(path,
'\\');
756 printf(
"%s %d - %s%s\n",
763 printf(
"# Duration: ");
779 acutest_colored_printf_(color,
"%s", str);
794 static const char spaces[] =
" ";
927 fprintf(stderr,
"Out of memory.\n");
949 fprintf(stderr,
"Out of memory.\n");
1026 static const size_t BYTES_PER_LINE = 16;
1028 size_t truncate = 0;
1029 size_t buflen = (size * 3) + strlen(title) + 2;
1048 buffer = (
char *)calloc(buflen,
sizeof(
char));
1052 printf((title[strlen(title)-1] ==
':') ?
"%s\n" :
"%s:\n", title);
1055 p =
buffer + strlen(title);
1056 if (title[strlen(title) - 1] !=
':') {
1066 printf(
"%08lx: ", (
unsigned long)
line_beg);
1069 printf(
" %02x", ((
const unsigned char*)addr)[off]);
1070 snprintf(p, end - p,
" %02x", ((
const unsigned char*)addr)[off]);
1078 unsigned char byte = ((
const unsigned char*)addr)[off];
1080 printf(
"%c", (iscntrl(
byte) ?
'.' : byte));
1090 printf(
" ... (and more %u bytes)\n", (
unsigned) truncate);
1142 printf(
"Unit tests:\n");
1144 printf(
" %s\n", test->
name);
1150 static const char word_delim[] =
" \t-_/.,:;";
1154 pattern_len = strlen(pattern);
1156 substr = strstr(
name, pattern);
1157 while(substr != NULL) {
1158 int starts_on_word_boundary = (substr ==
name || strchr(word_delim, substr[-1]) != NULL);
1159 int ends_on_word_boundary = (substr[pattern_len] ==
'\0' || strchr(word_delim, substr[pattern_len]) != NULL);
1161 if(starts_on_word_boundary && ends_on_word_boundary)
1164 substr = strstr(substr+1, pattern);
1213acutest_error_(const
char*
fmt, ...)
1250#ifndef TEST_NO_EXCEPTIONS
1289 printf(
"All conditions have passed.\n");
1293 printf(
"Duration: ");
1306 printf(
"%d condition%s %s failed.\n",
1316#ifndef TEST_NO_EXCEPTIONS
1317 }
catch(std::exception& e) {
1318 const char* what = e.what();
1326 printf(
"C++ exception.\n\n");
1334 printf(
"C++ exception.\n\n");
1362#if defined(ACUTEST_UNIX_)
1375 if (pipe(fd) == -1) {
1376 fprintf(stderr,
"Unable to create pipe.\n");
1381 if(pid == (pid_t)-1) {
1382 acutest_error_(
"Cannot fork. %s [%d]", strerror(errno), errno);
1383 }
else if(pid == 0) {
1395 fprintf(stderr,
"Unable to write to pipe\n");
1401 acutest_exit_((
int) state);
1405 waitpid(pid, &exit_code, 0);
1408 }
else if(WIFSIGNALED(exit_code)) {
1410 const char* signame;
1411 switch(WTERMSIG(exit_code)) {
1412 case SIGINT: signame =
"SIGINT";
break;
1413 case SIGHUP: signame =
"SIGHUP";
break;
1414 case SIGQUIT: signame =
"SIGQUIT";
break;
1415 case SIGABRT: signame =
"SIGABRT";
break;
1416 case SIGKILL: signame =
"SIGKILL";
break;
1417 case SIGSEGV: signame =
"SIGSEGV";
break;
1418 case SIGILL: signame =
"SIGILL";
break;
1419 case SIGTERM: signame =
"SIGTERM";
break;
1420 default:
snprintf(tmp,
sizeof(tmp),
"signal %d", WTERMSIG(exit_code)); signame = tmp;
break;
1422 acutest_error_(
"Test interrupted by %s.", signame);
1424 acutest_error_(
"Test ended in an unexpected way [%d].", exit_code);
1432 while (read(fd[0], p,
sizeof(
char))) {
1442 fprintf(stderr,
"Log message from child too large");
1449#elif defined(ACUTEST_WIN_)
1452 STARTUPINFOA startupInfo;
1453 PROCESS_INFORMATION processInfo;
1455 HANDLE hRead = NULL;
1456 HANDLE hWrite = NULL;
1457 SECURITY_ATTRIBUTES lpPipeAttribute;
1458 lpPipeAttribute.nLength =
sizeof(lpPipeAttribute);
1459 lpPipeAttribute.lpSecurityDescriptor = NULL;
1460 lpPipeAttribute.bInheritHandle = TRUE;
1466 if (!CreatePipe(&hRead, &hWrite, &lpPipeAttribute, 0)) {
1467 fprintf(stderr,
"Error creating pipe\n");
1474 "%s --worker=%d %s --no-exec --no-summary %s --verbose=%d --color=%s --pipe=%I64d -- \"%s\"",
1479 memset(&startupInfo, 0,
sizeof(startupInfo));
1480 startupInfo.cb =
sizeof(STARTUPINFO);
1481 if(CreateProcessA(NULL,
buffer, NULL, NULL, TRUE, 0, NULL, NULL, &startupInfo, &processInfo)) {
1482 WaitForSingleObject(processInfo.hProcess, INFINITE);
1483 GetExitCodeProcess(processInfo.hProcess, &exitCode);
1484 CloseHandle(processInfo.hThread);
1485 CloseHandle(processInfo.hProcess);
1492 while (ReadFile(hRead, p,
sizeof(
char), NULL, NULL)) {
1503 fprintf(stderr,
"Log message from child too large");
1509 CloseHandle(hWrite);
1514 case 3: acutest_error_(
"Aborted.");
break;
1515 case 0xC0000005: acutest_error_(
"Access violation.");
break;
1516 default: acutest_error_(
"Test ended in an unexpected way [%lu].", exitCode);
break;
1519 acutest_error_(
"Cannot create unit test subprocess [%ld].", GetLastError());
1541#if defined(ACUTEST_WIN_)
1544acutest_seh_exception_filter_(EXCEPTION_POINTERS *ptrs)
1547 acutest_message_(
false,
"Exception code: 0x%08lx", ptrs->ExceptionRecord->ExceptionCode);
1548 acutest_message_(
false,
"Exception address: 0x%p", ptrs->ExceptionRecord->ExceptionAddress);
1553 return EXCEPTION_EXECUTE_HANDLER;
1558#define ACUTEST_CMDLINE_OPTFLAG_OPTIONALARG_ 0x0001
1559#define ACUTEST_CMDLINE_OPTFLAG_REQUIREDARG_ 0x0002
1561#define ACUTEST_CMDLINE_OPTID_NONE_ 0
1562#define ACUTEST_CMDLINE_OPTID_UNKNOWN_ (-0x7fffffff + 0)
1563#define ACUTEST_CMDLINE_OPTID_MISSINGARG_ (-0x7fffffff + 1)
1564#define ACUTEST_CMDLINE_OPTID_BOGUSARG_ (-0x7fffffff + 2)
1575 const char* arggroup,
1576 int (*callback)(
int ,
const char* ))
1582 for(i = 0; arggroup[i] !=
'\0'; i++) {
1583 for(opt = options; opt->
id != 0; opt++) {
1589 ret = callback(opt->
id, NULL);
1593 badoptname[0] =
'-';
1594 badoptname[1] = arggroup[i];
1595 badoptname[2] =
'\0';
1607#define ACUTEST_CMDLINE_AUXBUF_SIZE_ 32
1611 int (*callback)(
int ,
const char* ))
1616 int after_doubledash = 0;
1623 if(after_doubledash || strcmp(argv[i],
"-") == 0) {
1626 }
else if(strcmp(argv[i],
"--") == 0) {
1628 after_doubledash = 1;
1629 }
else if(argv[i][0] !=
'-') {
1633 for(opt = options; opt->
id != 0; opt++) {
1634 if(opt->
longname != NULL && strncmp(argv[i],
"--", 2) == 0) {
1638 if(argv[i][2+
len] ==
'\0') {
1641 ret = callback(opt->
id, NULL);
1645 }
else if(argv[i][2+
len] ==
'=') {
1648 ret = callback(opt->
id, argv[i]+2+
len+1);
1658 }
else if(opt->
shortname !=
'\0' && argv[i][0] ==
'-') {
1662 if(argv[i][2] !=
'\0')
1663 ret = callback(opt->
id, argv[i]+2);
1665 ret = callback(opt->
id, argv[++i]);
1670 ret = callback(opt->
id, NULL);
1674 if(ret == 0 && argv[i][2] !=
'\0')
1683 if(argv[i][0] !=
'-') {
1688 char* badoptname = argv[i];
1690 if(strncmp(badoptname,
"--", 2) == 0) {
1692 char* assignment = strchr(badoptname,
'=');
1693 if(assignment != NULL) {
1694 size_t len = (
size_t)(assignment - badoptname);
1697 memcpy(auxbuf, badoptname,
len);
1699 badoptname = auxbuf;
1721 printf(
"Run the specified unit tests; or if the option '--exclude' is used, run all\n");
1722 printf(
"tests in the suite but those listed. By default, if no tests are specified\n");
1723 printf(
"on the command line, all unit tests in the suite are run.\n");
1725 printf(
"Options:\n");
1726 printf(
" -X, --exclude Execute all unit tests but the listed ones\n");
1727 printf(
" --exec[=WHEN] If supported, execute unit tests as child processes\n");
1728 printf(
" (WHEN is one of 'auto', 'always', 'never')\n");
1729 printf(
" -E, --no-exec Same as --exec=never\n");
1730#if defined ACUTEST_WIN_
1731 printf(
" -t, --time Measure test duration\n");
1732#elif defined ACUTEST_HAS_POSIX_TIMER_
1733 printf(
" -t, --time Measure test duration (real time)\n");
1734 printf(
" --time=TIMER Measure test duration, using given timer\n");
1735 printf(
" (TIMER is one of 'real', 'cpu')\n");
1737 printf(
" --no-summary Suppress printing of test results summary\n");
1738 printf(
" --tap Produce TAP-compliant output\n");
1739 printf(
" (See https://testanything.org/)\n");
1740 printf(
" -x, --xml-output=FILE Enable XUnit output to the given file\n");
1741 printf(
" -l, --list List unit tests in the suite and exit\n");
1742 printf(
" -v, --verbose Make output more verbose\n");
1743 printf(
" --verbose=LEVEL Set verbose level to LEVEL:\n");
1744 printf(
" 0 ... Be silent\n");
1745 printf(
" 1 ... Output one line per test (and summary)\n");
1746 printf(
" 2 ... As 1 and failed conditions (this is default)\n");
1747 printf(
" 3 ... As 1 and all conditions (and extended summary)\n");
1748 printf(
" -q, --quiet Same as --verbose=0\n");
1749 printf(
" --color[=WHEN] Enable colorized output\n");
1750 printf(
" (WHEN is one of 'auto', 'always', 'never')\n");
1751 printf(
" --no-color Same as --color=never\n");
1752 printf(
" -h, --help Display this help and exit\n");
1761 {
'X',
"exclude",
'X', 0 },
1762 {
's',
"skip",
'X', 0 },
1764 {
'E',
"no-exec",
'E', 0 },
1765#if defined ACUTEST_WIN_
1766 {
't',
"time",
't', 0 },
1767 { 0,
"timer",
't', 0 },
1769#elif defined ACUTEST_HAS_POSIX_TIMER_
1773 { 0,
"no-summary",
'S', 0 },
1774 { 0,
"tap",
'T', 0 },
1775 {
'l',
"list",
'l', 0 },
1777 {
'q',
"quiet",
'q', 0 },
1779 { 0,
"no-color",
'C', 0 },
1780 {
'h',
"help",
'h', 0 },
1795 if(arg == NULL || strcmp(arg,
"always") == 0) {
1797 }
else if(strcmp(arg,
"never") == 0) {
1799 }
else if(strcmp(arg,
"auto") == 0) {
1802 fprintf(stderr,
"%s: Unrecognized argument '%s' for option --exec.\n",
acutest_argv0_, arg);
1803 fprintf(stderr,
"Try '%s --help' for more information.\n",
acutest_argv0_);
1813#if defined ACUTEST_WIN_ || defined ACUTEST_HAS_POSIX_TIMER_
1814 if(arg == NULL || strcmp(arg,
"real") == 0) {
1816 #ifndef ACUTEST_WIN_
1817 }
else if(strcmp(arg,
"cpu") == 0) {
1821 fprintf(stderr,
"%s: Unrecognized argument '%s' for option --time.\n",
acutest_argv0_, arg);
1822 fprintf(stderr,
"Try '%s --help' for more information.\n",
acutest_argv0_);
1845#if defined ACUTEST_WIN_
1847 hChildWrite = (HANDLE)(ULONG_PTR)_atoi64(arg);
1855 if(arg == NULL || strcmp(arg,
"always") == 0) {
1857 }
else if(strcmp(arg,
"never") == 0) {
1859 }
else if(strcmp(arg,
"auto") == 0) {
1862 fprintf(stderr,
"%s: Unrecognized argument '%s' for option --color.\n",
acutest_argv0_, arg);
1863 fprintf(stderr,
"Try '%s --help' for more information.\n",
acutest_argv0_);
1884 fprintf(stderr,
"Unable to open '%s': %s\n", arg, strerror(errno));
1891 fprintf(stderr,
"%s: Unrecognized unit test '%s'\n",
acutest_argv0_, arg);
1892 fprintf(stderr,
"Try '%s --list' for list of unit tests.\n",
acutest_argv0_);
1898 fprintf(stderr,
"Unrecognized command line option '%s'.\n", arg);
1899 fprintf(stderr,
"Try '%s --help' for more information.\n",
acutest_argv0_);
1904 fprintf(stderr,
"The command line option '%s' requires an argument.\n", arg);
1905 fprintf(stderr,
"Try '%s --help' for more information.\n",
acutest_argv0_);
1910 fprintf(stderr,
"The command line option '%s' does not expect an argument.\n", arg);
1911 fprintf(stderr,
"Try '%s --help' for more information.\n",
acutest_argv0_);
1922#ifdef ACUTEST_LINUX_
1926 static const int OVERLAP = 32;
1930 pid_t tracer_pid = 0;
1937 fd = open(
"/proc/self/status", O_RDONLY);
1940 static const char pattern[] =
"\nTracerPid:";
1943 while(n_read <
sizeof(buf) - 1) {
1946 n = read(fd, buf + n_read,
sizeof(buf) - 1 - n_read);
1953 field = strstr(buf, pattern);
1954 if(field != NULL && field < buf +
sizeof(buf) - OVERLAP) {
1955 tracer_pid = (pid_t) atoi(field +
sizeof(pattern) - 1);
1959 if(n_read ==
sizeof(buf) - 1) {
1964 memmove(buf, buf +
sizeof(buf) - 1 - OVERLAP, OVERLAP);
1979#ifdef ACUTEST_MACOS_
1983 struct kinfo_proc info;
1988 mib[2] = KERN_PROC_PID;
1991 size =
sizeof(info);
1992 info.kp_proc.p_flag = 0;
1993 sysctl(
mib,
sizeof(
mib) /
sizeof(*
mib), &info, &size, NULL, 0);
1995 if(info.kp_proc.p_flag & P_TRACED)
2001 if(IsDebuggerPresent())
2005#ifdef RUNNING_ON_VALGRIND
2023#if defined ACUTEST_UNIX_
2025#elif defined ACUTEST_WIN_
2026 #if defined _BORLANDC_
2042 fprintf(stderr,
"Out of memory.\n");
2052#if defined(ACUTEST_WIN_)
2053 SetUnhandledExceptionFilter(acutest_seh_exception_filter_);
2055 _set_abort_behavior(0, _WRITE_ABORT_MSG);
2108#ifdef TEST_GLOBAL_INIT
2119#ifdef TEST_GLOBAL_FINI
2126 int n_run, n_success, n_failed ;
2135 printf(
" Count of run unit tests: %4d\n", n_run);
2136 printf(
" Count of successful unit tests: %4d\n", n_success);
2137 printf(
" Count of failed unit tests: %4d\n", n_failed);
2142 printf(
" No unit tests have failed.\n");
2145 printf(
" %d of %d unit tests %s failed.\n",
2146 n_failed, n_run, (n_failed == 1) ?
"has" :
"have");
2157 fprintf(
acutest_xml_output_,
"<testsuite name=\"%s\" tests=\"%d\" errors=\"0\" failures=\"%d\" skip=\"%d\">\n",
2164 const char* str_state;
2167 switch(details->
state) {
2172 default: str_state =
"<failure />";
break;
2175 if(str_state != NULL)
2212 #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 void acutest_finish_test_line_(enum acutest_state_ state)
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_colorize_
static char acutest_case_name_[TEST_CASE_MAXSIZE]
static void acutest_cleanup_(void)
int main(int argc, char **argv)
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 int acutest_list_size_
static void acutest_help_(void)
static int acutest_cond_failed_
static int acutest_timer_
#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 int acutest_verbose_level_
const struct acutest_test_ acutest_list_[]
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)
void const char char * line_beg
static int acutest_test_skip_count_
enum acutest_state_ state
int const char int const char int result_color
static int acutest_under_debugger_(void)
static double acutest_timer_diff_(int start, int end)
void acutest_abort_(void) ACUTEST_ATTRIBUTE_(noreturn)
static int acutest_count_(enum acutest_state_ state)
static enum acutest_state_ acutest_do_run_(const struct acutest_test_ *test, int index)
#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)
#define ACUTEST_COLOR_YELLOW_
void acutest_log_(const char *fmt,...)
static jmp_buf acutest_abort_jmp_buf_
#define ACUTEST_COLOR_RED_INTENSIVE_
static int acutest_test_check_count_
void int const char size_t reason_len
static int acutest_select_(const char *pattern)
@ ACUTEST_STATE_NEEDTORUN
void acutest_skip_(const char *file, int line, const char *fmt,...)
#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_
static char acutest_test_skip_reason_[256]
void acutest_case_(const char *fmt,...)
static const char * acutest_basename_(const char *path)
#define ACUTEST_COLOR_YELLOW_INTENSIVE_
void acutest_data_log_ * log_entry
static int acutest_exclude_mode_
#define RUNNING_ON_VALGRIND
static const char * spaces
#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)
static fr_sbuff_err_t char size_t * len