X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libtest%2Fformatter.cc;h=443256b617ecf66ddeb8c98144f8710f8e629c2e;hb=2eb14a59f3626073017de925929dcc7e3e9eb43d;hp=7cb3ea0ab8fb55ca8b7e0083b66638527128017a;hpb=73e1288b648b5394239e0cefd2251fedfa9727af;p=awesomized%2Flibmemcached diff --git a/libtest/formatter.cc b/libtest/formatter.cc index 7cb3ea0a..443256b6 100644 --- a/libtest/formatter.cc +++ b/libtest/formatter.cc @@ -41,7 +41,8 @@ #include #include #include - +#include + namespace libtest { std::string& escape4XML(std::string const& arg, std::string& escaped_string) @@ -159,11 +160,14 @@ TestCase* Formatter::current() void Formatter::skipped() { + assert(current()); current()->result(TEST_SKIPPED); - Out << name() << "." - << current()->name() - << "\t\t\t\t\t" - << "[ " << test_strerror(current()->result()) << " ]"; + + Out + << "[ " << test_strerror(current()->result()) << " ]" + << "\t\t" + << name() << "." << current()->name() + ; reset(); } @@ -173,9 +177,11 @@ void Formatter::failed() assert(current()); current()->result(TEST_FAILURE); - Out << name() - << "." << current()->name() << "\t\t\t\t\t" - << "[ " << test_strerror(current()->result()) << " ]"; + Out + << "[ " << test_strerror(current()->result()) << " ]" + << "\t\t" + << name() << "." << current()->name() + ; reset(); } @@ -184,13 +190,14 @@ void Formatter::success(const libtest::Timer& timer_) { assert(current()); current()->result(TEST_SUCCESS, timer_); - std::string escaped_string; - Out << name() << "." - << current()->name() - << "\t\t\t\t\t" - << current()->timer() - << " [ " << test_strerror(current()->result()) << " ]"; + Out + << "[ " << test_strerror(current()->result()) << " ]" + << "\t" + << current()->timer() + << "\t" + << name() << "." << current()->name() + ; reset(); } @@ -252,6 +259,14 @@ void Formatter::push_testcase(const std::string& arg) assert(_suite_name.empty() == false); TestCase* _current_testcase= new TestCase(arg); _testcases.push_back(_current_testcase); + + assert(current()); + + Echo + << "\t\t\t" + << name() << "." << current()->name() + << "... \r" + ; } void Formatter::reset()