summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2015-04-02 12:20:12 +0200
committerAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2016-04-25 22:19:30 +0200
commit3a6933eb45e6163e6c1a102eb4c263ecb9d34f7a (patch)
treebd45901a2024f37d6c5f5db1b77dde9f6f13e481
parentbe9287589a81e60d76f255ddcc1d0237d55053a5 (diff)
Cosmetic change: Do not print a newline for the first headline
-rw-r--r--test/integration/TestLogger.cpp15
-rw-r--r--test/integration/TestLogger.hpp1
2 files changed, 14 insertions, 2 deletions
diff --git a/test/integration/TestLogger.cpp b/test/integration/TestLogger.cpp
index d745c0f..b020407 100644
--- a/test/integration/TestLogger.cpp
+++ b/test/integration/TestLogger.cpp
@@ -23,24 +23,30 @@
namespace ousia {
namespace test {
-Logger::Logger(std::ostream &os, bool useColor) : os(os), terminal(useColor) {}
+Logger::Logger(std::ostream &os, bool useColor)
+ : os(os), terminal(useColor), first(true)
+{
+}
void Logger::fail(const std::string &msg)
{
os << terminal.color(Terminal::RED, true) << "[Fail]" << terminal.reset()
<< " " << msg << std::endl;
+ first = false;
}
void Logger::success(const std::string &msg)
{
os << terminal.color(Terminal::GREEN, true) << "[Success]"
<< terminal.reset() << " " << msg << std::endl;
+ first = false;
}
void Logger::note(const std::string &msg)
{
os << terminal.color(Terminal::BLUE, true) << "[Note]" << terminal.reset()
<< " " << msg << std::endl;
+ first = false;
}
void Logger::result(std::istream &is, const std::set<int> &errLines)
@@ -59,12 +65,17 @@ void Logger::result(std::istream &is, const std::set<int> &errLines)
<< std::setw(3) << lineNumber << ":" << terminal.reset() << " "
<< line << std::endl;
}
+ first = false;
}
void Logger::headline(const std::string &msg)
{
- os << std::endl << "== " << terminal.bright() << msg << terminal.reset()
+ if (!first) {
+ os << std::endl;
+ }
+ os << "== " << terminal.bright() << msg << terminal.reset()
<< " ==" << std::endl;
+ first = false;
}
}
}
diff --git a/test/integration/TestLogger.hpp b/test/integration/TestLogger.hpp
index 1c18191..d861a71 100644
--- a/test/integration/TestLogger.hpp
+++ b/test/integration/TestLogger.hpp
@@ -44,6 +44,7 @@ class Logger {
private:
std::ostream &os;
Terminal terminal;
+ bool first;
public:
Logger(std::ostream &os, bool useColor);