diff --git a/doomsday/tests/log/log.pro b/doomsday/tests/log/log.pro new file mode 100644 index 0000000000..b9a07cc9a7 --- /dev/null +++ b/doomsday/tests/log/log.pro @@ -0,0 +1,8 @@ +include(../config_test.pri) + +TEMPLATE = app +TARGET = test_log + +SOURCES += main.cpp + +deployTest($$TARGET) diff --git a/doomsday/tests/log/main.cpp b/doomsday/tests/log/main.cpp new file mode 100644 index 0000000000..4862835d65 --- /dev/null +++ b/doomsday/tests/log/main.cpp @@ -0,0 +1,57 @@ +/* + * The Doomsday Engine Project + * + * Copyright (c) 2012 Jaakko Keränen + * + * 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 2 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 . + */ + +#include +#include + +#include + +using namespace de; + +int main(int argc, char** argv) +{ + try + { + App app(argc, argv, App::GUIDisabled); + app.initSubsystems(App::DisablePlugins); + + for(int i = 0; i < Log::MAX_LOG_LEVELS; ++i) + { + Log::LogLevel level = Log::LogLevel(i); + LogBuffer::appBuffer().enable(level); + LOG().enter(level, "Enabled level ") << Log::levelToText(level); + + for(int k = 0; k < Log::MAX_LOG_LEVELS; ++k) + { + Log::LogLevel other = Log::LogLevel(k); + LOG().enter(other, "- entry at level %s (currently enabled %s): visible: %b") + << Log::levelToText(other) + << Log::levelToText(level) + << LogBuffer::appBuffer().isEnabled(other); + } + } + } + catch(const Error& err) + { + qWarning() << err.asText(); + } + + qDebug() << "Exiting main()..."; + return 0; +} diff --git a/doomsday/tests/tests.pro b/doomsday/tests/tests.pro index 005d922d72..7bb2335109 100644 --- a/doomsday/tests/tests.pro +++ b/doomsday/tests/tests.pro @@ -7,6 +7,7 @@ TEMPLATE = subdirs deng_tests: SUBDIRS += \ archive \ + log \ record \ script \ stringpool \