SimGrid  3.14.159
Versatile Simulation of Distributed Systems
cunit.cpp File Reference
#include "src/internal_config.h"
#include <stdio.h>
#include <xbt/ex.hpp>
#include "xbt/sysdep.h"
#include "xbt/cunit.h"
#include "xbt/dynar.h"

Classes

struct  s_xbt_test_log
 
struct  s_xbt_test_test
 
struct  s_xbt_test_unit
 
struct  s_xbt_test_suite
 

Typedefs

typedef struct s_xbt_test_logxbt_test_log_t
 
typedef struct s_xbt_test_testxbt_test_test_t
 

Functions

static void xbt_test_log_dump (xbt_test_log_t log)
 
static void xbt_test_test_dump (xbt_test_test_t test)
 
static void xbt_test_unit_dump (xbt_test_unit_t unit)
 
static void xbt_test_suite_free (void *s)
 
static void xbt_test_unit_free (void *unit)
 
static void xbt_test_test_free (void *test)
 
static void xbt_test_log_free (void *log)
 
xbt_test_suite_t xbt_test_suite_new (const char *name, const char *fmt,...)
 create test suite More...
 
xbt_test_suite_t xbt_test_suite_by_name (const char *name, const char *fmt,...)
 retrieve a testsuite from name, or create a new one More...
 
void xbt_test_suite_dump (xbt_test_suite_t suite)
 
void xbt_test_suite_push (xbt_test_suite_t suite, const char *name, ts_test_cb_t func, const char *fmt,...)
 
static int xbt_test_suite_run (xbt_test_suite_t suite, int verbosity)
 
static void apply_selection (char *selection)
 
void xbt_test_dump (char *selection)
 
int xbt_test_run (char *selection, int verbosity)
 
void xbt_test_exit ()
 
void _xbt_test_add (const char *file, int line, const char *fmt,...)
 
void _xbt_test_fail (const char *file, int line, const char *fmt,...)
 
void xbt_test_exception (xbt_ex_t e)
 Declare that the lastly started test failed because of the provided exception. More...
 
void xbt_test_expect_failure ()
 Declare that the lastly started test was expected to fail (and actually failed) More...
 
void xbt_test_skip ()
 Declare that the lastly started test should be skipped today. More...
 
void _xbt_test_log (const char *file, int line, const char *fmt,...)
 

Variables

static xbt_dynar_t _xbt_test_suites = nullptr
 
static int _xbt_test_nb_tests = 0
 
static int _xbt_test_test_failed = 0
 
static int _xbt_test_test_ignore = 0
 
static int _xbt_test_test_expect = 0
 
static int _xbt_test_nb_units = 0
 
static int _xbt_test_unit_failed = 0
 
static int _xbt_test_unit_ignore = 0
 
static int _xbt_test_unit_disabled = 0
 
static int _xbt_test_nb_suites = 0
 
static int _xbt_test_suite_failed = 0
 
static int _xbt_test_suite_ignore = 0
 
static int _xbt_test_suite_disabled = 0
 
xbt_test_unit_t _xbt_test_current_unit = nullptr
 

Typedef Documentation

§ xbt_test_log_t

typedef struct s_xbt_test_log * xbt_test_log_t

§ xbt_test_test_t

typedef struct s_xbt_test_test * xbt_test_test_t

Function Documentation

§ xbt_test_log_dump()

static void xbt_test_log_dump ( xbt_test_log_t  log)
static

§ xbt_test_test_dump()

static void xbt_test_test_dump ( xbt_test_test_t  test)
static

§ xbt_test_unit_dump()

static void xbt_test_unit_dump ( xbt_test_unit_t  unit)
static

§ xbt_test_suite_free()

static void xbt_test_suite_free ( void s)
static

§ xbt_test_unit_free()

static void xbt_test_unit_free ( void unit)
static

§ xbt_test_test_free()

static void xbt_test_test_free ( void test)
static

§ xbt_test_log_free()

static void xbt_test_log_free ( void log)
static

§ xbt_test_suite_new()

xbt_test_suite_t xbt_test_suite_new ( const char *  name,
const char *  fmt,
  ... 
)

create test suite

§ xbt_test_suite_by_name()

xbt_test_suite_t xbt_test_suite_by_name ( const char *  name,
const char *  fmt,
  ... 
)

retrieve a testsuite from name, or create a new one

§ xbt_test_suite_dump()

void xbt_test_suite_dump ( xbt_test_suite_t  suite)

§ xbt_test_suite_push()

void xbt_test_suite_push ( xbt_test_suite_t  suite,
const char *  name,
ts_test_cb_t  func,
const char *  fmt,
  ... 
)

§ xbt_test_suite_run()

static int xbt_test_suite_run ( xbt_test_suite_t  suite,
int  verbosity 
)
static

§ apply_selection()

static void apply_selection ( char *  selection)
static

§ xbt_test_dump()

void xbt_test_dump ( char *  selection)

§ xbt_test_run()

int xbt_test_run ( char *  selection,
int  verbosity 
)

§ xbt_test_exit()

void xbt_test_exit ( )

§ _xbt_test_add()

void _xbt_test_add ( const char *  file,
int  line,
const char *  fmt,
  ... 
)

§ _xbt_test_fail()

void _xbt_test_fail ( const char *  file,
int  line,
const char *  fmt,
  ... 
)

§ _xbt_test_log()

void _xbt_test_log ( const char *  file,
int  line,
const char *  fmt,
  ... 
)

Variable Documentation

§ _xbt_test_suites

xbt_dynar_t _xbt_test_suites = nullptr
static

§ _xbt_test_nb_tests

int _xbt_test_nb_tests = 0
static

§ _xbt_test_test_failed

int _xbt_test_test_failed = 0
static

§ _xbt_test_test_ignore

int _xbt_test_test_ignore = 0
static

§ _xbt_test_test_expect

int _xbt_test_test_expect = 0
static

§ _xbt_test_nb_units

int _xbt_test_nb_units = 0
static

§ _xbt_test_unit_failed

int _xbt_test_unit_failed = 0
static

§ _xbt_test_unit_ignore

int _xbt_test_unit_ignore = 0
static

§ _xbt_test_unit_disabled

int _xbt_test_unit_disabled = 0
static

§ _xbt_test_nb_suites

int _xbt_test_nb_suites = 0
static

§ _xbt_test_suite_failed

int _xbt_test_suite_failed = 0
static

§ _xbt_test_suite_ignore

int _xbt_test_suite_ignore = 0
static

§ _xbt_test_suite_disabled

int _xbt_test_suite_disabled = 0
static

§ _xbt_test_current_unit

xbt_test_unit_t _xbt_test_current_unit = nullptr