ARB
Classes | Macros | Typedefs | Enumerations | Functions | Variables
TestEnvironment.cxx File Reference
#include <arb_simple_assert.h>
#include <arb_defs.h>
#include <arb_str.h>
#include <arb_file.h>
#include <arb_diff.h>
#include <arbdb.h>
#include <PT_com.h>
#include <client.h>
#include <servercntrl.h>
#include "test_unit.h"
#include "UnitTester.hxx"
#include <string>
#include <set>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/time.h>
#include "../SOURCE_TOOLS/arb_main.h"
Include dependency graph for TestEnvironment.cxx:

Go to the source code of this file.

Classes

class  Mutex
 
class  PersistantFlag
 
class  LazyPersistantFlag
 
class  FunInfo
 

Macros

#define env_assert(cond)   arb_assert(cond)
 
#define WARN_NOT_IMPLEMENTED(fun, mode)   TEST_WARNING2("%s(%s) does nothing", #fun, upcase(mode_command[mode]));
 
#define FUNINFO(fun)   FunInfo(fun,#fun)
 

Typedefs

typedef SmartCharPtr Error
 
typedef Error(* Environment_cb )(Mode mode)
 

Enumerations

enum  Mode { UNKNOWN, SETUP, CLEAN }
 

Functions

static const charupcase (const char *str)
 
static const charunitTesterDir ()
 
static const charflagDir ()
 
static const charrunDir ()
 
static const charmutexDir (const char *name)
 
static void test_ptserver_activate (bool start, int serverid)
 
static Error ptserver (Mode mode)
 
static Error ptserver_gene (Mode mode)
 
static void wrapped ()
 
static FunInfofind_module (const char *moduleName)
 
static Error set_all_modules_to (Mode mode)
 
static const charknown_modules (char separator)
 
static const charknown_modes (char separator)
 
int main (int argc, char *argv[])
 

Variables

static const charmode_command [] = { NULp, "setup", "clean" }
 
static Mode other_mode [] = { UNKNOWN, CLEAN, SETUP }
 
static const charFLAG_MUTEX = "flag_access"
 
static Environment_cb wrapped_cb = NULp
 
static Mode wrapped_mode = UNKNOWN
 
static SmartCharPtr wrapped_error
 
static FunInfo modules []
 
const size_t MODULES = ARRAY_ELEMS(modules)
 

Macro Definition Documentation

#define env_assert (   cond)    arb_assert(cond)
#define WARN_NOT_IMPLEMENTED (   fun,
  mode 
)    TEST_WARNING2("%s(%s) does nothing", #fun, upcase(mode_command[mode]));

Definition at line 56 of file TestEnvironment.cxx.

#define FUNINFO (   fun)    FunInfo(fun,#fun)

Definition at line 602 of file TestEnvironment.cxx.

Typedef Documentation

typedef SmartCharPtr Error

Definition at line 48 of file TestEnvironment.cxx.

typedef Error(* Environment_cb)(Mode mode)

Definition at line 424 of file TestEnvironment.cxx.

Enumeration Type Documentation

enum Mode
Enumerator
UNKNOWN 
SETUP 
CLEAN 

Definition at line 44 of file TestEnvironment.cxx.

Function Documentation

static const char* upcase ( const char str)
static

Definition at line 50 of file TestEnvironment.cxx.

References ARB_strupper(), and RETURN_LOCAL_ALLOC.

static const char* unitTesterDir ( )
static

Definition at line 58 of file TestEnvironment.cxx.

References GB_concat_full_path(), GB_getenvARBHOME(), and RETURN_ONETIME_ALLOC.

Referenced by flagDir(), and runDir().

static const char* flagDir ( )
static

Definition at line 61 of file TestEnvironment.cxx.

References FLAGS_DIR, GB_concat_full_path(), RETURN_ONETIME_ALLOC, and unitTesterDir().

Referenced by mutexDir().

static const char* runDir ( )
static

Definition at line 64 of file TestEnvironment.cxx.

References GB_concat_full_path(), RETURN_ONETIME_ALLOC, and unitTesterDir().

static const char* mutexDir ( const char name)
static

Definition at line 67 of file TestEnvironment.cxx.

References flagDir(), GB_concat_full_path(), and GBS_global_string().

Referenced by Mutex::Mutex().

static void test_ptserver_activate ( bool  start,
int  serverid 
)
static
static Error ptserver ( Mode  mode)
static
static Error ptserver_gene ( Mode  mode)
static
static void wrapped ( )
static

Definition at line 430 of file TestEnvironment.cxx.

References wrapped_cb, wrapped_error, and wrapped_mode.

static FunInfo* find_module ( const char moduleName)
static

Definition at line 611 of file TestEnvironment.cxx.

References MODULES, and NULp.

Referenced by main().

static Error set_all_modules_to ( Mode  mode)
static

Definition at line 620 of file TestEnvironment.cxx.

References error(), MODULES, and FunInfo::switch_to().

Referenced by main().

static const char* known_modules ( char  separator)
static

Definition at line 628 of file TestEnvironment.cxx.

References GBS_global_string(), FunInfo::get_name(), MODULES, and NULp.

Referenced by main().

static const char* known_modes ( char  separator)
static

Definition at line 637 of file TestEnvironment.cxx.

References ARRAY_ELEMS, GBS_global_string(), and NULp.

Referenced by main().

int main ( int  argc,
char argv[] 
)

Variable Documentation

const char* mode_command[] = { NULp, "setup", "clean" }
static

Definition at line 45 of file TestEnvironment.cxx.

Mode other_mode[] = { UNKNOWN, CLEAN, SETUP }
static

Definition at line 46 of file TestEnvironment.cxx.

Referenced by FunInfo::switch_to().

const char* FLAG_MUTEX = "flag_access"
static

Definition at line 164 of file TestEnvironment.cxx.

Environment_cb wrapped_cb = NULp
static

Definition at line 426 of file TestEnvironment.cxx.

Referenced by wrapped().

Mode wrapped_mode = UNKNOWN
static

Definition at line 427 of file TestEnvironment.cxx.

Referenced by wrapped().

SmartCharPtr wrapped_error
static

Definition at line 428 of file TestEnvironment.cxx.

Referenced by wrapped().

FunInfo modules[]
static
Initial value:
= {
}
static Error ptserver_gene(Mode mode)
static Error ptserver(Mode mode)
#define FUNINFO(fun)

Definition at line 604 of file TestEnvironment.cxx.

const size_t MODULES = ARRAY_ELEMS(modules)

Definition at line 609 of file TestEnvironment.cxx.

Referenced by find_module(), known_modules(), and set_all_modules_to().