projects
/
m6w6
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
Import/Merge of libtest latest.
[m6w6/libmemcached]
/
libtest
/
framework.cc
diff --git
a/libtest/framework.cc
b/libtest/framework.cc
index 55881b189b7d99bbe665d01a8e2fb355a68b11f3..daea4f4ebfa339edd0d88f3847fe30e5dfbcc999 100644
(file)
--- a/
libtest/framework.cc
+++ b/
libtest/framework.cc
@@
-48,13
+48,14
@@
using namespace libtest;
Framework::Framework(libtest::SignalThread& signal,
const std::string& only_run_arg,
const std::string& wildcard_arg) :
Framework::Framework(libtest::SignalThread& signal,
const std::string& only_run_arg,
const std::string& wildcard_arg) :
- collections(NULL),
+
_
collections(NULL),
_total(0),
_success(0),
_skipped(0),
_failed(0),
_create(NULL),
_destroy(NULL),
_total(0),
_success(0),
_skipped(0),
_failed(0),
_create(NULL),
_destroy(NULL),
+ _on_error(NULL),
_runner(NULL),
_socket(false),
_creators_ptr(NULL),
_runner(NULL),
_socket(false),
_creators_ptr(NULL),
@@
-64,7
+65,7
@@
Framework::Framework(libtest::SignalThread& signal,
{
get_world(this);
{
get_world(this);
- for (collection_st *next= collections; next and next->name; next++)
+ for (collection_st *next=
_
collections; next and next->name; next++)
{
_collection.push_back(new Collection(this, next));
}
{
_collection.push_back(new Collection(this, next));
}
@@
-83,7
+84,7
@@
Framework::~Framework()
for (std::vector<Collection*>::iterator iter= _collection.begin();
iter != _collection.end();
for (std::vector<Collection*>::iterator iter= _collection.begin();
iter != _collection.end();
-
iter++
)
+
++iter
)
{
delete *iter;
}
{
delete *iter;
}
@@
-103,7
+104,7
@@
void Framework::exec()
{
for (std::vector<Collection*>::iterator iter= _collection.begin();
iter != _collection.end() and (_signal.is_shutdown() == false);
{
for (std::vector<Collection*>::iterator iter= _collection.begin();
iter != _collection.end() and (_signal.is_shutdown() == false);
-
iter++
)
+
++iter
)
{
if (_only_run.empty() == false and
fnmatch(_only_run.c_str(), (*iter)->name(), 0))
{
if (_only_run.empty() == false and
fnmatch(_only_run.c_str(), (*iter)->name(), 0))
@@
-133,13
+134,20
@@
void Framework::exec()
}
catch (libtest::fatal& e)
{
}
catch (libtest::fatal& e)
{
+ _failed++;
stream::cerr(e.file(), e.line(), e.func()) << e.mesg();
}
catch (libtest::disconnected& e)
{
stream::cerr(e.file(), e.line(), e.func()) << e.mesg();
}
catch (libtest::disconnected& e)
{
+ _failed++;
Error << "Unhandled disconnection occurred:" << e.what();
throw;
}
Error << "Unhandled disconnection occurred:" << e.what();
throw;
}
+ catch (...)
+ {
+ _failed++;
+ throw;
+ }
Outn();
}
Outn();
}
@@
-150,7
+158,7
@@
uint32_t Framework::sum_total()
uint32_t count= 0;
for (std::vector<Collection*>::iterator iter= _collection.begin();
iter != _collection.end();
uint32_t count= 0;
for (std::vector<Collection*>::iterator iter= _collection.begin();
iter != _collection.end();
-
iter++
)
+
++iter
)
{
count+= (*iter)->total();
}
{
count+= (*iter)->total();
}
@@
-163,7
+171,7
@@
uint32_t Framework::sum_success()
uint32_t count= 0;
for (std::vector<Collection*>::iterator iter= _collection.begin();
iter != _collection.end();
uint32_t count= 0;
for (std::vector<Collection*>::iterator iter= _collection.begin();
iter != _collection.end();
-
iter++
)
+
++iter
)
{
count+= (*iter)->success();
}
{
count+= (*iter)->success();
}
@@
-176,7
+184,7
@@
uint32_t Framework::sum_skipped()
uint32_t count= 0;
for (std::vector<Collection*>::iterator iter= _collection.begin();
iter != _collection.end();
uint32_t count= 0;
for (std::vector<Collection*>::iterator iter= _collection.begin();
iter != _collection.end();
-
iter++
)
+
++iter
)
{
count+= (*iter)->skipped();
}
{
count+= (*iter)->skipped();
}
@@
-189,7
+197,7
@@
uint32_t Framework::sum_failed()
uint32_t count= 0;
for (std::vector<Collection*>::iterator iter= _collection.begin();
iter != _collection.end();
uint32_t count= 0;
for (std::vector<Collection*>::iterator iter= _collection.begin();
iter != _collection.end();
-
iter++
)
+
++iter
)
{
count+= (*iter)->failed();
}
{
count+= (*iter)->failed();
}