Commit 625e1136 authored by Hannah von Reth's avatar Hannah von Reth Committed by Hannah von Reth
Browse files

Allow to execute unittests on Windows

parent e7a37425
......@@ -40,6 +40,8 @@
#include "logging.h"
Q_LOGGING_CATEGORY(KSYSTEMLOG, "ksystemlog", QtWarningMsg)
Globals &Globals::instance()
{
static Globals self;
......
......@@ -29,8 +29,6 @@
#include "mainWindow.h"
#include "logging.h"
Q_LOGGING_CATEGORY(KSYSTEMLOG, "ksystemlog", QtWarningMsg)
int main(int argc, char **argv)
{
// Enable debug output:
......
......@@ -12,35 +12,19 @@ include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/../src/modes/kernel
)
add_library(testCore STATIC testUtil.cpp testResources.qrc )
target_link_libraries(testCore PUBLIC
Qt5::Test
ksystemlog_lib
ksystemlog_base_mode
ksystemlog_config
ksystemlog_system
ksystemlog_kernel)
macro(ksystemlog_unit_tests)
foreach(unitTest ${ARGN})
set(unitTest_sources
${unitTest}.cpp
testUtil.cpp
)
qt5_add_resources( unitTest_sources testResources.qrc )
add_executable(${unitTest}
${unitTest_sources})
add_test(ksystemlog-${unitTest}
${unitTest})
ecm_mark_as_test(${unitTest})
target_link_libraries(
${unitTest}
Qt5::Test
ksystemlog_lib
ksystemlog_base_mode
ksystemlog_config
ksystemlog_system
ksystemlog_kernel
)
ecm_add_test(${unitTest}.cpp TEST_NAME ksystemlog-${unitTest} LINK_LIBRARIES testCore)
endforeach(unitTest)
endmacro(ksystemlog_unit_tests)
......
......@@ -43,8 +43,6 @@
#include "kernelAnalyzer.h"
#include "localLogFileReader.h"
Q_LOGGING_CATEGORY(KSYSTEMLOG, "ksystemlog")
/**
* Reimplements the Kernel Analyzer using a Local File Reader
*/
......
......@@ -33,8 +33,6 @@
#include "logging.h"
Q_LOGGING_CATEGORY(KSYSTEMLOG, "ksystemlog")
class KioLogFileReaderTest : public QObject
{
Q_OBJECT
......
......@@ -34,8 +34,6 @@
#include "logging.h"
Q_LOGGING_CATEGORY(KSYSTEMLOG, "ksystemlog")
class LogModeFactoryTest : public QObject
{
Q_OBJECT
......
......@@ -41,8 +41,6 @@
#include "logging.h"
Q_LOGGING_CATEGORY(KSYSTEMLOG, "ksystemlog")
class SystemAnalyzerTest : public QObject
{
Q_OBJECT
......
......@@ -35,6 +35,13 @@
#include "logViewWidget.h"
#include "analyzer.h"
static void enableLoggign()
{
KSYSTEMLOG().setFilterRules(QStringLiteral("ksystemlog=true"));
Q_INIT_RESOURCE(testResources);
}
Q_COREAPP_STARTUP_FUNCTION(enableLoggign)
TestUtil::TestUtil()
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment