Bridge++  Ver. 2.0.2
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)
 
void batch_recursive (const std::string &arg="")
 
void batch_recursive (const int argc, char **argv)
 
bool registerTest (const std::string &key, const Test_function func)
 
void list ()
 
int getCheckPrecision () const
 

Static Public Member Functions

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

Static Public Attributes

static const std::string class_name = "TestManager"
 

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 list_traverse (const Node *p, const std::string &prefix)
 
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 success/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 52 of file testManager.h.

Constructor & Destructor Documentation

◆ TestManager() [1/2]

TestManager::TestManager ( )
private

Definition at line 68 of file testManager.cpp.

◆ TestManager() [2/2]

TestManager::TestManager ( const TestManager )
private

◆ ~TestManager()

TestManager::~TestManager ( )
private

Definition at line 77 of file testManager.cpp.

Member Function Documentation

◆ append_key() [1/2]

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

Definition at line 396 of file testManager.cpp.

◆ append_key() [2/2]

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

Definition at line 438 of file testManager.cpp.

◆ banner()

void TestManager::banner ( )
private

Definition at line 29 of file testManager.cpp.

◆ batch()

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

Definition at line 126 of file testManager.cpp.

◆ batch_recursive() [1/2]

void TestManager::batch_recursive ( const int  argc,
char **  argv 
)

Definition at line 169 of file testManager.cpp.

◆ batch_recursive() [2/2]

void TestManager::batch_recursive ( const std::string &  arg = "")

Definition at line 139 of file testManager.cpp.

◆ CreateInstance()

void TestManager::CreateInstance ( )
staticprivate

Definition at line 59 of file testManager.cpp.

◆ find_fullpath()

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

Definition at line 464 of file testManager.cpp.

◆ find_node()

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

Definition at line 370 of file testManager.cpp.

◆ getCheckPrecision()

int TestManager::getCheckPrecision ( ) const
inline

Definition at line 73 of file testManager.h.

◆ Instance()

TestManager & TestManager::Instance ( )
static

Definition at line 40 of file testManager.cpp.

◆ interactive()

void TestManager::interactive ( )

Definition at line 84 of file testManager.cpp.

◆ interactive_master()

void TestManager::interactive_master ( )
private

Definition at line 95 of file testManager.cpp.

◆ interactive_slave()

void TestManager::interactive_slave ( )
private

Definition at line 108 of file testManager.cpp.

◆ list()

void TestManager::list ( )

Definition at line 581 of file testManager.cpp.

◆ list_traverse()

void TestManager::list_traverse ( const Node p,
const std::string &  prefix 
)
private

Definition at line 552 of file testManager.cpp.

◆ menu()

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

Definition at line 259 of file testManager.cpp.

◆ operator=()

TestManager& TestManager::operator= ( const TestManager )
private

◆ registerTest()

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

Definition at line 205 of file testManager.cpp.

◆ RegisterTest()

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

Definition at line 69 of file testManager.h.

◆ run()

void TestManager::run ( const Node p)
private

Definition at line 213 of file testManager.cpp.

◆ run_traversal()

void TestManager::run_traversal ( const Node p)
private

Definition at line 244 of file testManager.cpp.

◆ set_precision()

void TestManager::set_precision ( )
private

Definition at line 346 of file testManager.cpp.

◆ stat_report()

void TestManager::stat_report ( ) const
private

Definition at line 517 of file testManager.cpp.

◆ traverse()

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

Definition at line 588 of file testManager.cpp.

Member Data Documentation

◆ class_name

const std::string TestManager::class_name = "TestManager"
static

Definition at line 55 of file testManager.h.

◆ m_precision

int TestManager::m_precision
private

Definition at line 151 of file testManager.h.

◆ m_root_node

Node TestManager::m_root_node
private

Definition at line 148 of file testManager.h.

◆ m_stat

Stat TestManager::m_stat
private

Definition at line 154 of file testManager.h.

◆ m_vl

Bridge::VerboseLevel TestManager::m_vl
private

Definition at line 146 of file testManager.h.

◆ s_instance

TestManager * TestManager::s_instance = 0
staticprivate

Definition at line 87 of file testManager.h.


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