20 std::vector<std::string>
string_tokenize(
const std::string& src,
const char delim =
'.');
33 vout.
general(
m_vl,
"-------------------------------------------------\n");
35 vout.
general(
m_vl,
"-------------------------------------------------\n");
71 m_root_node(
"<top_level>"),
100 std::string jobname =
"<terminate>";
116 if (jobname ==
"<terminate>")
break;
141 vout.
detailed(
m_vl,
"TestManager::batch_recursive: arg=\"%s\"\n", arg.c_str());
157 std::string jobname =
"<terminate>";
175 for (
int i = 0; i < argc; ++i) {
176 vout.
detailed(
m_vl,
"TestManager::batch_recursive: argv[%d]=%s\n", i, argv[i]);
178 std::string arg = std::string(argv[i]);
192 std::string jobname =
"<terminate>";
229 }
else if (result == 0) {
245 if (p->
m_next.size() == 0) {
248 for (
size_t i = 0; i < p->
m_next.size(); ++i) {
258 if (!p)
return false;
263 if (p->
m_next.size() == 0) {
269 bool do_continue =
true;
274 for (
unsigned int i = 0; i < p->
m_next.size(); ++i) {
290 bool do_alltest =
false;
291 bool do_setprecision =
false;
299 if (buf[0] == 0)
return false;
307 do_setprecision =
true;
312 if (buf[0] ==
'u')
return true;
314 if (buf[0] ==
'q')
return false;
320 if ((choice >= 1) && (choice <=
int(p->
m_next.size())))
break;
329 }
else if (do_setprecision) {
335 if (!do_continue)
break;
355 int prec = atoi(buf);
356 if ((prec >= 1) && (prec <= 14)) {
371 if (v.size() == 0)
return p;
373 for (std::vector<std::string>::const_iterator r = v.begin(); r != v.end(); ++r) {
374 bool is_found =
false;
376 for (i = 0; i < p->
m_next.size(); ++i) {
377 if (p->
m_next[i]->m_name == (*r)) {
383 if (!is_found)
return 0;
397 if (v.size() == 0)
return p;
399 for (std::vector<std::string>::const_iterator r = v.begin(); r != v.end(); ++r) {
400 bool is_found =
false;
402 for (i = 0; i < p->
m_next.size(); ++i) {
403 if (p->
m_next[i]->m_name == (*r)) {
418 std::vector<Node *>::iterator iter = p->
m_next.begin();
419 for ( ; iter != p->
m_next.end(); ++iter) {
420 if (*r < (*iter)->m_name) {
424 p->
m_next.insert(iter, q);
439 if (argc == 0)
return p;
442 for (
int i = 0; i < argc; ++i) {
447 for (
size_t i = 0; i < p->
m_next.size(); ++i) {
448 if (p->
m_next[i]->m_name == argv[0]) {
465 if (!p->
m_prev)
return path;
467 if (path.length() > 0) {
500 m_list_failure.push_back(test_name);
509 m_list_skip.push_back(test_name);
553 if (p->
m_next.size() == 0) {
562 string prefix_next =
"";
565 }
else if (prefix ==
"") {
568 prefix_next = prefix +
"." + p->
m_name;
571 for (
size_t i = 0; i < p->
m_next.size(); ++i) {
589 if (p->
m_next.size() == 0) {
596 for (
size_t i = 0; i < p->
m_next.size(); ++i) {
605 std::vector<std::string> retv;
607 size_t npos = src.length();
612 size_t q = src.find(delim, p);
615 retv.push_back(src.substr(p));
619 retv.push_back(src.substr(p, q - p));
TestManager class for managing and performing tests.
void detailed(const char *format,...)
static int self()
rank within small world.
bool menu(const Node *p, const bool is_top=false)
void success(const std::string &test_name)
void general(const char *format,...)
const std::string test_name
static void CreateInstance()
void run_traversal(const Node *p)
void failure(const std::string &test_name)
void batch_recursive(const std::string &arg="")
std::string find_fullpath(const Node *p, const std::string &path="")
void list_traverse(const Node *p, const std::string &prefix)
void skip(const std::string &test_name)
int(* Test_function)(void)
void interactive_master()
void traverse(const Node *p, const std::string &indent="")
std::vector< std::string > m_list_skip
Bridge::VerboseLevel m_vl
std::vector< std::string > m_list_failure
Common parameter class: provides parameters as singleton.
static const int default_precision
static TestManager & Instance()
static TestManager * s_instance
Node * find_node(Node *p, const std::vector< std::string > &v)
static int broadcast(int count, double *data, int sender)
broadcast array of double from sender.
bool registerTest(const std::string &key, const Test_function func)
static bool is_primary()
check if the present node is primary in small communicator.
std::vector< Node * > m_next
std::vector< std::string > string_tokenize(const std::string &src, const char delim= '.')
static const std::string class_name
Node * append_key(Node *p, const std::vector< std::string > &v)
void batch(const std::string &arg)