Bridge++  Ver. 1.1.x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
TestManager Class Reference

TestManager class for managing and performing tests. More...

#include <testManager.h>

Classes

struct  Node
 
struct  Stat
 

Public Member Functions

void interactive ()
 
void batch (const std::string &arg)
 
bool registerTest (const std::string &key, const Test_function func)
 
int getCheckPrecision () const
 

Static Public Member Functions

static TestManagerInstance ()
 
static bool RegisterTest (const std::string &key, const Test_function func)
 

Private Member Functions

 TestManager ()
 
 TestManager (const TestManager &)
 
TestManageroperator= (const TestManager &)
 
 ~TestManager ()
 
Nodefind_node (Node *p, const std::vector< std::string > &v)
 
Nodeappend_key (Node *p, const std::vector< std::string > &v)
 
Nodeappend_key (Node *p, int argc, char **argv)
 
void stat_report () const
 
std::string find_fullpath (const Node *p, const std::string &path="")
 
void interactive_master ()
 
void interactive_slave ()
 
void run (const Node *p)
 
void run_traversal (const Node *p)
 
bool menu (const Node *p, const bool is_top=false)
 
void banner ()
 
void set_precision ()
 
void traverse (const Node *p, const std::string &indent="")
 

Static Private Member Functions

static void CreateInstance ()
 

Private Attributes

Bridge::VerboseLevel m_vl
 
Node m_root_node
 
int m_precision
 
Stat m_stat
 

Static Private Attributes

static TestManagers_instance = 0
 

Detailed Description

TestManager class for managing and performing tests.

TestManager class provides framework for managing and performing various tests. Tests are registered to TestManager, and performed interactively through hierarchical menu, or in a batch mode by specifying test names.

Each test is in a form of a function which takes no argument, and returns status whether the test is successful or not. It is expected that each test is independent with each other, leaving no side effects.

TestManager collects and reports statistics of sucess/failure of tests when 'all' of the subtree of tests are selected in interactive mode.

N.B. TestManager is a singleton class.

Definition at line 63 of file testManager.h.

Constructor & Destructor Documentation

TestManager::TestManager ( )
private

Definition at line 67 of file testManager.cpp.

TestManager::TestManager ( const TestManager )
private
TestManager::~TestManager ( )
private

Definition at line 76 of file testManager.cpp.

Member Function Documentation

TestManager::Node * TestManager::append_key ( TestManager::Node p,
const std::vector< std::string > &  v 
)
private

Definition at line 325 of file testManager.cpp.

TestManager::Node * TestManager::append_key ( TestManager::Node p,
int  argc,
char **  argv 
)
private

Definition at line 355 of file testManager.cpp.

void TestManager::banner ( )
private

Definition at line 28 of file testManager.cpp.

void TestManager::batch ( const std::string &  arg)

Definition at line 124 of file testManager.cpp.

void TestManager::CreateInstance ( )
staticprivate

Definition at line 58 of file testManager.cpp.

std::string TestManager::find_fullpath ( const Node p,
const std::string &  path = "" 
)
private

Definition at line 381 of file testManager.cpp.

TestManager::Node * TestManager::find_node ( TestManager::Node p,
const std::vector< std::string > &  v 
)
private

Definition at line 299 of file testManager.cpp.

int TestManager::getCheckPrecision ( ) const
inline

Definition at line 77 of file testManager.h.

TestManager & TestManager::Instance ( )
static

Definition at line 39 of file testManager.cpp.

void TestManager::interactive ( )

Definition at line 83 of file testManager.cpp.

void TestManager::interactive_master ( )
private

Definition at line 94 of file testManager.cpp.

void TestManager::interactive_slave ( )
private

Definition at line 106 of file testManager.cpp.

bool TestManager::menu ( const Node p,
const bool  is_top = false 
)
private

Definition at line 188 of file testManager.cpp.

TestManager& TestManager::operator= ( const TestManager )
private
bool TestManager::registerTest ( const std::string &  key,
const Test_function  func 
)

Definition at line 137 of file testManager.cpp.

static bool TestManager::RegisterTest ( const std::string &  key,
const Test_function  func 
)
inlinestatic

Definition at line 73 of file testManager.h.

void TestManager::run ( const Node p)
private

Definition at line 145 of file testManager.cpp.

void TestManager::run_traversal ( const Node p)
private

Definition at line 173 of file testManager.cpp.

void TestManager::set_precision ( )
private

Definition at line 275 of file testManager.cpp.

void TestManager::stat_report ( ) const
private

Definition at line 421 of file testManager.cpp.

void TestManager::traverse ( const Node p,
const std::string &  indent = "" 
)
private

Definition at line 444 of file testManager.cpp.

Member Data Documentation

int TestManager::m_precision
private

Definition at line 149 of file testManager.h.

Node TestManager::m_root_node
private

Definition at line 146 of file testManager.h.

Stat TestManager::m_stat
private

Definition at line 152 of file testManager.h.

Bridge::VerboseLevel TestManager::m_vl
private

Definition at line 144 of file testManager.h.

TestManager * TestManager::s_instance = 0
staticprivate

Definition at line 91 of file testManager.h.


The documentation for this class was generated from the following files: