summaryrefslogtreecommitdiff
path: root/test/integration/TestLogger.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/integration/TestLogger.hpp')
-rw-r--r--test/integration/TestLogger.hpp63
1 files changed, 63 insertions, 0 deletions
diff --git a/test/integration/TestLogger.hpp b/test/integration/TestLogger.hpp
new file mode 100644
index 0000000..1c18191
--- /dev/null
+++ b/test/integration/TestLogger.hpp
@@ -0,0 +1,63 @@
+/*
+ Ousía
+ Copyright (C) 2015 Benjamin Paaßen, Andreas Stöckel
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+/**
+ * @file TestLogger.hpp
+ *
+ * Class used to print messages and streams in the integration test utility.
+ *
+ * @author Andreas Stöckel (astoecke@techfak.uni-bielefeld.de)
+ */
+
+#ifndef _OUSIA_TEST_LOGGER_HPP_
+#define _OUSIA_TEST_LOGGER_HPP_
+
+#include <ostream>
+#include <istream>
+#include <set>
+#include <string>
+
+#include <core/frontend/Terminal.hpp>
+
+namespace ousia {
+namespace test {
+
+/**
+ * Class used for printing messages to the screen.
+ */
+class Logger {
+private:
+ std::ostream &os;
+ Terminal terminal;
+
+public:
+ Logger(std::ostream &os, bool useColor);
+
+ void fail(const std::string &msg);
+ void success(const std::string &msg);
+ void note(const std::string &msg);
+ void result(std::istream &is,
+ const std::set<int> &errLines = std::set<int>{});
+ void headline(const std::string &msg);
+};
+
+}
+}
+
+#endif /* _OUSIA_TEST_LOGGER_HPP_ */
+