![]() |
The ROme OpTimistic Simulator
3.0.0
A General-Purpose Multithreaded Parallel/Distributed Simulation Platform
|
Test framework source. More...
#include <test.h>#include <arch/thread.h>#include <limits.h>#include <memory.h>#include <stdarg.h>#include <stdatomic.h>#include <stdbool.h>#include <stdlib.h>
Include dependency graph for test.c:Go to the source code of this file.
Macros | |
| #define | ROOTSIM_TEST_NAME "rs_test" |
Functions | |
| void | _log_log (int level, const char *file, unsigned line, const char *fmt,...) |
| Logs a message. For internal use: log_log() should be used instead. More... | |
| int | main (int argc, char **argv) |
| The main entry point of the custom compiler. More... | |
| static int | init_arguments (int *argc_p, char ***argv_p) |
| Initializes ISO C compliant argc and argv from the test configuration. More... | |
| static void | test_atexit (void) |
| The exit handler, to exit cleanly even in case of errors. | |
| void | main_wrapper (void) |
| The test wrapper which allows to intervene before the actual main() | |
| static int | test_printf_internal (const char *restrict fmt, va_list args) |
| int | test_printf (const char *restrict fmt,...) |
| Registers a formatted string to compare against the expected output. More... | |
| int | test_printf_pr (const char *restrict fmt,...) |
| Registers a formatted string to compare against the expected output. More... | |
| bool | test_thread_barrier (void) |
| Synchronizes threads on a barrier. More... | |
Variables | |
| static char * | t_out_buf |
| static size_t | t_out_buf_size |
| static size_t | t_out_wrote |
| static char ** | test_argv |
| lp_id_t | n_lps |
| The total number of LPs in the simulation. | |
| nid_t | nid |
| The node identifier of the node. | |
| nid_t | n_nodes = 1 |
| rid_t | n_threads |
| The total number of MPI nodes in the simulation. | |
| __thread rid_t | rid |
| The identifier of the thread. | |
| int | log_level |
| The minimum log level of the messages to display. | |
Test framework source.
The source of the minimal test framework used in the code base tests
Definition in file test.c.
| void _log_log | ( | int | level, |
| const char * | file, | ||
| unsigned | line, | ||
| const char * | fmt, | ||
| ... | |||
| ) |
Logs a message. For internal use: log_log() should be used instead.
| level | the importance level of the message to log |
| file | the file name where this function is being called |
| line | the line number where this function is being called |
| fmt | a printf-style format string for the message to log |
| ... | the list of arguments to fill in the format string fmt |
|
static |
Initializes ISO C compliant argc and argv from the test configuration.
| argc_p | a pointer to a variable which will hold the computed argc value |
| argv_p | a pointer to a variable which will hold the computer argv value |
| int main | ( | int | argc, |
| char ** | argv | ||
| ) |
The main entry point of the custom compiler.
| argc | The count of command line arguments, as per ISO C standard |
| argv | The list of command line arguments, as per ISO C standard |
Definition at line 62 of file compiler.c.
Here is the call graph for this function:| int test_printf | ( | const char *restrict | fmt, |
| ... | |||
| ) |
| int test_printf_pr | ( | const char *restrict | fmt, |
| ... | |||
| ) |
| bool test_thread_barrier | ( | void | ) |
Synchronizes threads on a barrier.
This is a more battle tested although less performing version of the thread barrier. We can't rely on the pthread barrier because it's not portable.
Definition at line 200 of file test.c.
Here is the caller graph for this function: