From 0e3cf1963a4c5fa28f12a70b7d2f25c33580c182 Mon Sep 17 00:00:00 2001 From: Andreas Stöckel Date: Wed, 1 Apr 2015 22:05:58 +0200 Subject: Implement integration test framework --- test/integration/TestLogger.hpp | 63 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 test/integration/TestLogger.hpp (limited to 'test/integration/TestLogger.hpp') 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 . +*/ + +/** + * @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 +#include +#include +#include + +#include + +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 &errLines = std::set{}); + void headline(const std::string &msg); +}; + +} +} + +#endif /* _OUSIA_TEST_LOGGER_HPP_ */ + -- cgit v1.2.3