The ROme OpTimistic Simulator  3.0.0
A General-Purpose Multithreaded Parallel/Distributed Simulation Platform
init_test.c File Reference

Test: general initialization and argument handling. More...

#include <test.h>
#include <core/arg_parse.h>
#include <core/init.h>
+ Include dependency graph for init_test.c:

Go to the source code of this file.

Macros

#define TEST_INIT(args_arr, cond)
 

Functions

void log_logo_print (void)
 Prints a fancy ROOT-Sim logo on the terminal.
 
bool io_terminal_can_colorize (void)
 Determines if stdout supports colored text. More...
 
unsigned thread_cores_count (void)
 Computes the count of available cores on the machine. More...
 
int main (int argc, char **argv)
 The main entry point of the custom compiler. More...
 

Variables

static unsigned mocked_threads
 
bool log_colored
 If set, uses color codes to color the log outputs.
 
char * args_lp []
 
char * args_wt []
 
char * args_serial []
 
char * args_no_bind []
 
char * args_gvt []
 
char * args_termination []
 
char * args_seed []
 
const struct test_config test_config
 The test configuration object, must be defined by the test sources. More...
 

Detailed Description

Test: general initialization and argument handling.

Definition in file init_test.c.

Macro Definition Documentation

◆ TEST_INIT

#define TEST_INIT (   args_arr,
  cond 
)
Value:
__extension__({ \
init_args_parse(sizeof(args_arr) / sizeof(*(args_arr)) - 1, \
(args_arr)); \
if (!(cond)) return -1; \
})

Definition at line 88 of file init_test.c.

Function Documentation

◆ io_terminal_can_colorize()

bool io_terminal_can_colorize ( void  )

Determines if stdout supports colored text.

Returns
true if colors escape sequences can be used, false otherwise

Definition at line 16 of file init_test.c.

◆ main()

int main ( int  argc,
char **  argv 
)

The main entry point of the custom compiler.

Parameters
argcThe count of command line arguments, as per ISO C standard
argvThe list of command line arguments, as per ISO C standard

Definition at line 95 of file init_test.c.

◆ thread_cores_count()

unsigned thread_cores_count ( void  )

Computes the count of available cores on the machine.

Returns
the count of the processing cores available on the machine

Definition at line 23 of file init_test.c.

Variable Documentation

◆ args_gvt

char* args_gvt[]
Initial value:
= {
"init_test",
"--lp",
"25",
"--gvt-period",
"500",
NULL
}

Definition at line 61 of file init_test.c.

◆ args_lp

char* args_lp[]
Initial value:
= {
"init_test",
"--lp",
"64",
NULL
}

Definition at line 29 of file init_test.c.

◆ args_no_bind

char* args_no_bind[]
Initial value:
= {
"init_test",
"--lp",
"256",
"--no-bind",
NULL
}

Definition at line 53 of file init_test.c.

◆ args_seed

char* args_seed[]
Initial value:
= {
"init_test",
"--lp",
"16",
"--seed",
"23491",
NULL
}

Definition at line 79 of file init_test.c.

◆ args_serial

char* args_serial[]
Initial value:
= {
"init_test",
"--serial",
"--lp",
"128",
NULL
}

Definition at line 45 of file init_test.c.

◆ args_termination

char* args_termination[]
Initial value:
= {
"init_test",
"--lp",
"16",
"--time",
"1437.23",
NULL
}

Definition at line 70 of file init_test.c.

◆ args_wt

char* args_wt[]
Initial value:
= {
"init_test",
"--wt",
"400",
"--lp",
"800",
NULL
}

Definition at line 36 of file init_test.c.

◆ test_config

const struct test_config test_config
Initial value:
= {
.expected_output = "test done",
.expected_output_size = sizeof("test done") - 1
}

The test configuration object, must be defined by the test sources.

Definition at line 180 of file init_test.c.