projects
/
awesomized
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
Update m4
[awesomized/libmemcached]
/
libtest
/
collection.cc
diff --git
a/libtest/collection.cc
b/libtest/collection.cc
index 3f85d0fe9ea0394e2d1bd9ba1b86bfeec17b2311..26e8bb44e33d455ef725546dc98fe338da3427b3 100644
(file)
--- a/
libtest/collection.cc
+++ b/
libtest/collection.cc
@@
-38,7
+38,7
@@
#include <libtest/common.h>
#include <libtest/common.h>
-static test_return_t runner_code(Framework* frame,
+static test_return_t runner_code(
libtest::
Framework* frame,
test_st* run,
libtest::Timer& _timer)
{ // Runner Code
test_st* run,
libtest::Timer& _timer)
{ // Runner Code
@@
-84,21
+84,22
@@
Collection::Collection(Framework* frame_arg,
_success(0),
_skipped(0),
_failed(0),
_success(0),
_skipped(0),
_failed(0),
- _total(0)
+ _total(0),
+ _formatter(_name)
{
fatal_assert(arg);
}
test_return_t Collection::exec()
{
{
fatal_assert(arg);
}
test_return_t Collection::exec()
{
- Out << "Collection: " << _name;
-
if (test_success(_frame->runner()->pre(_pre, _frame->creators_ptr())))
{
for (test_st *run= _tests; run->name; run++)
{
if (test_success(_frame->runner()->pre(_pre, _frame->creators_ptr())))
{
for (test_st *run= _tests; run->name; run++)
{
+ formatter()->push_testcase(run->name);
if (_frame->match(run->name))
{
if (_frame->match(run->name))
{
+ formatter()->skipped();
continue;
}
_total++;
continue;
}
_total++;
@@
-112,38
+113,46
@@
test_return_t Collection::exec()
{
Error << "frame->runner()->flush(creators_ptr)";
_skipped++;
{
Error << "frame->runner()->flush(creators_ptr)";
_skipped++;
+ formatter()->skipped();
continue;
}
}
continue;
}
}
- return_code= runner_code(_frame, run, _timer);
+ alarm(600);
+ try
+ {
+ return_code= runner_code(_frame, run, _timer);
+ }
+ catch (...)
+ {
+ alarm(0);
+ throw;
+ }
+ alarm(0);
}
}
- catch (libtest::
fatal
&e)
+ catch (libtest::
exception
&e)
{
stream::cerr(e.file(), e.line(), e.func()) << e.what();
_failed++;
{
stream::cerr(e.file(), e.line(), e.func()) << e.what();
_failed++;
+ formatter()->failed();
throw;
}
switch (return_code)
{
case TEST_SUCCESS:
throw;
}
switch (return_code)
{
case TEST_SUCCESS:
- Out << "\tTesting "
- << run->name
- << "\t\t\t\t\t"
- << _timer
- << " [ " << test_strerror(return_code) << " ]";
_success++;
_success++;
+ formatter()->success(_timer);
break;
case TEST_FAILURE:
_failed++;
break;
case TEST_FAILURE:
_failed++;
-
Out << "\tTesting " << run->name << "\t\t\t\t\t" << "[ " << test_strerror(return_code) << " ]"
;
+
formatter()->failed()
;
break;
case TEST_SKIPPED:
_skipped++;
break;
case TEST_SKIPPED:
_skipped++;
-
Out << "\tTesting " << run->name << "\t\t\t\t\t" << "[ " << test_strerror(return_code) << " ]"
;
+
formatter()->skipped()
;
break;
default:
break;
default: