|
Serene Runtime 1.0.0
C runtime for the Serene programming language
|
#include <stdlib.h>#include <stdarg.h>#include <stdio.h>#include <ctype.h>#include <setjmp.h>#include <string.h>Go to the source code of this file.
Data Structures | |
| struct | acutest_test_ |
| struct | acutest_test_data_ |
| struct | acutest_test_CMDLINE_OPTION_ |
Typedefs | |
| typedef int | acutest_timer_type_ |
| typedef struct acutest_test_CMDLINE_OPTION_ | ACUTEST_CMDLINE_OPTION_ |
Enumerations | |
| enum | acutest_state_ { ACUTEST_STATE_INITIAL = -4 , ACUTEST_STATE_SELECTED = -3 , ACUTEST_STATE_NEEDTORUN = -2 , ACUTEST_STATE_EXCLUDED = -1 , ACUTEST_STATE_SUCCESS = 0 , ACUTEST_STATE_FAILED = 1 , ACUTEST_STATE_SKIPPED = 2 } |
Functions | |
| int | acutest_check_ (int cond, const char *file, int line, const char *fmt,...) |
| void | acutest_case_ (const char *fmt,...) |
| void | acutest_message_ (const char *fmt,...) |
| void | acutest_dump_ (const char *title, const void *addr, size_t size) |
| void | acutest_abort_ (void) ACUTEST_ATTRIBUTE_(noreturn) |
| static int | acutest_count_ (enum acutest_state_ state) |
| static void | acutest_cleanup_ (void) |
| static void | ACUTEST_ATTRIBUTE_ (noreturn) acutest_exit_(int exit_code) |
| void | acutest_timer_init_ (void) |
| static void | acutest_timer_get_time_ (int *ts) |
| static double | acutest_timer_diff_ (int start, int end) |
| static void | acutest_timer_print_diff_ (void) |
| static int | ACUTEST_ATTRIBUTE_ (format(printf, 2, 3)) acutest_colored_printf_(int color |
| va_start (args, fmt) | |
| vsnprintf (buffer, sizeof(buffer), fmt, args) | |
| va_end (args) | |
| if (!acutest_colorize_) | |
| static const char * | acutest_basename_ (const char *path) |
| static void | acutest_begin_test_line_ (const struct acutest_test_ *test) |
| static void | acutest_finish_test_line_ (enum acutest_state_ state) |
| static void | acutest_line_indent_ (int level) |
| void | ACUTEST_ATTRIBUTE_ (format(printf, 3, 4)) acutest_skip_(const char *file |
| vsnprintf (acutest_test_skip_reason_, sizeof(acutest_test_skip_reason_), fmt, args) | |
| if (acutest_test_skip_reason_[reason_len - 1]=='.') acutest_test_skip_reason_[reason_len - 1] | |
| if (acutest_test_check_count_ > 0) | |
| if (acutest_verbose_level_ >=2) | |
| int | ACUTEST_ATTRIBUTE_ (format(printf, 4, 5)) acutest_check_(int cond |
| if (acutest_test_skip_count_) | |
| if (cond) | |
| void | ACUTEST_ATTRIBUTE_ (format(printf, 1, 2)) acutest_case_(const char *fmt |
| void | if (acutest_verbose_level_< 2) return |
| if (acutest_case_name_[0]) | |
| if (fmt==NULL) return | |
| vsnprintf (acutest_case_name_, sizeof(acutest_case_name_) - 1, fmt, args) | |
| if (acutest_current_test_==NULL||!acutest_cond_failed_) return | |
| vsnprintf (buffer, TEST_MSG_MAXSIZE, fmt, args) | |
| while (1) | |
| if (line_beg[0] !='\0') | |
| static void | acutest_init_ (const char *test_name) |
| static void | acutest_fini_ (const char *test_name) |
| static void | acutest_list_names_ (void) |
| static int | acutest_name_contains_word_ (const char *name, const char *pattern) |
| static int | acutest_select_ (const char *pattern) |
| static enum acutest_state_ | acutest_do_run_ (const struct acutest_test_ *test, int index) |
| static void | acutest_run_ (const struct acutest_test_ *test, int index, int master_index) |
| static int | acutest_cmdline_handle_short_opt_group_ (const ACUTEST_CMDLINE_OPTION_ *options, const char *arggroup, int(*callback)(int, const char *)) |
| static int | acutest_cmdline_read_ (const ACUTEST_CMDLINE_OPTION_ *options, int argc, char **argv, int(*callback)(int, const char *)) |
| static void | acutest_help_ (void) |
| static int | acutest_cmdline_callback_ (int id, const char *arg) |
| static int | acutest_under_debugger_ (void) |
| int | main (int argc, char **argv) |
| #define ACUTEST_CMDLINE_OPTID_BOGUSARG_ (-0x7fffffff + 2) |
| #define ACUTEST_CMDLINE_OPTID_MISSINGARG_ (-0x7fffffff + 1) |
| #define TEST_ASSERT | ( | cond | ) |
Definition at line 119 of file acutest.h.
| #define TEST_ASSERT_ | ( | cond, | |
| ... ) |
Definition at line 114 of file acutest.h.
| #define TEST_CASE | ( | name | ) |
| #define TEST_CASE_ | ( | ... | ) |
| #define TEST_CHECK | ( | cond | ) |
Definition at line 96 of file acutest.h.
| #define TEST_CHECK_ | ( | cond, | |
| ... ) |
Definition at line 94 of file acutest.h.
| #define TEST_DUMP | ( | title, | |
| addr, | |||
| size ) |
| #define TEST_LIST const struct acutest_test_ acutest_list_[] |
| #define TEST_MSG | ( | ... | ) |
| #define TEST_SKIP | ( | ... | ) |
| typedef struct acutest_test_CMDLINE_OPTION_ ACUTEST_CMDLINE_OPTION_ |
| typedef int acutest_timer_type_ |
| enum acutest_state_ |
| Enumerator | |
|---|---|
| ACUTEST_STATE_INITIAL | |
| ACUTEST_STATE_SELECTED | |
| ACUTEST_STATE_NEEDTORUN | |
| ACUTEST_STATE_EXCLUDED | |
| ACUTEST_STATE_SUCCESS | |
| ACUTEST_STATE_FAILED | |
| ACUTEST_STATE_SKIPPED | |
Definition at line 304 of file acutest.h.
| void acutest_abort_ | ( | void | ) |
Definition at line 987 of file acutest.h.
| static void ACUTEST_ATTRIBUTE_ | ( | format(printf, 1, 2) | ) | const |
|
static |
| void ACUTEST_ATTRIBUTE_ | ( | format(printf, 3, 4) | ) | const |
| int ACUTEST_ATTRIBUTE_ | ( | format(printf, 4, 5) | ) |
|
static |
Definition at line 452 of file acutest.h.
|
static |
Definition at line 631 of file acutest.h.
|
static |
Definition at line 658 of file acutest.h.
| void acutest_case_ | ( | const char * | fmt, |
| ... ) |
| int acutest_check_ | ( | int | cond, |
| const char * | file, | ||
| int | line, | ||
| const char * | fmt, | ||
| ... ) |
|
static |
Definition at line 450 of file acutest.h.
|
static |
Definition at line 1595 of file acutest.h.
|
static |
Definition at line 1375 of file acutest.h.
|
static |
Definition at line 1410 of file acutest.h.
|
static |
|
static |
Definition at line 1093 of file acutest.h.
| void acutest_dump_ | ( | const char * | title, |
| const void * | addr, | ||
| size_t | size ) |
Definition at line 915 of file acutest.h.
|
static |
|
static |
Definition at line 679 of file acutest.h.
|
static |
Definition at line 1519 of file acutest.h.
|
static |
|
static |
|
static |
Definition at line 999 of file acutest.h.
| void acutest_message_ | ( | const char * | fmt, |
| ... ) |
|
static |
Definition at line 1007 of file acutest.h.
|
static |
Definition at line 1205 of file acutest.h.
|
static |
Definition at line 1031 of file acutest.h.
|
static |
|
static |
| void acutest_timer_init_ | ( | void | ) |
|
static |
|
static |
Definition at line 1731 of file acutest.h.
| if | ( | ! | acutest_colorize_ | ) |
| if | ( | acutest_case_name_ | [0] | ) |
| if | ( | acutest_current_test_ | = =NULL||!acutest_cond_failed_ | ) |
| if | ( | acutest_test_check_count_ | , |
| 0 | ) |
| if | ( | acutest_test_skip_count_ | ) |
| if | ( | acutest_test_skip_reason_ | [reason_len - 1] = ='.' | ) |
| if | ( | acutest_verbose_level_ >= | 2 | ) |
Definition at line 763 of file acutest.h.
| if | ( | ) |
| if | ( | cond | ) |
| if | ( | fmt | = =NULL | ) |
| if | ( | line_beg ! | [0] = '\0' | ) |
| int main | ( | int | argc, |
| char ** | argv ) |
Definition at line 1825 of file acutest.h.
| va_end | ( | args | ) |
| vsnprintf | ( | acutest_case_name_ | , |
| sizeof(acutest_case_name_) - | 1, | ||
| fmt | , | ||
| args | ) |
| vsnprintf | ( | acutest_test_skip_reason_ | , |
| sizeof(acutest_test_skip_reason_) | , | ||
| fmt | , | ||
| args | ) |
| vsnprintf | ( | buffer | , |
| TEST_MSG_MAXSIZE | , | ||
| fmt | , | ||
| args | ) |
| while | ( | 1 | ) |
| return !acutest_cond_failed_ |
|
static |
|
static |
Definition at line 1570 of file acutest.h.
|
static |
|
extern |
|
static |
|
static |
|
static |
|
static |
| buffer[TEST_MSG_MAXSIZE - 1] |
| else |
| line_beg |
| result_color |