From: Manuel Nickschas Date: Sun, 30 Sep 2018 20:11:56 +0000 (+0200) Subject: test: Introduce Quassel::Test::Global library X-Git-Tag: test-travis-01~113 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=cf64023910d5b42477f6158f4cee853cc7f7f3f8;ds=sidebyside test: Introduce Quassel::Test::Global library Move things that are needed in every test case into a new library, rather than requiring the Test::Main one (which is not going to be linked to other test tooling which we'll introduce). --- diff --git a/cmake/QuasselMacros.cmake b/cmake/QuasselMacros.cmake index 62ad20c7..9f576cd7 100644 --- a/cmake/QuasselMacros.cmake +++ b/cmake/QuasselMacros.cmake @@ -200,6 +200,7 @@ function(quassel_add_test _target) list(APPEND ARG_LIBRARIES Qt5::Test Quassel::Common + Quassel::Test::Global Quassel::Test::Main ) diff --git a/src/test/CMakeLists.txt b/src/test/CMakeLists.txt index 9a263aae..ea61c432 100644 --- a/src/test/CMakeLists.txt +++ b/src/test/CMakeLists.txt @@ -1 +1,2 @@ +add_subdirectory(global) add_subdirectory(main) diff --git a/src/test/global/CMakeLists.txt b/src/test/global/CMakeLists.txt new file mode 100644 index 00000000..f3f4ed2f --- /dev/null +++ b/src/test/global/CMakeLists.txt @@ -0,0 +1,13 @@ +quassel_add_module(Test::Global EXPORT NOINSTALL) + +target_sources(${TARGET} PRIVATE + testglobal.h +) + +target_link_libraries(${TARGET} + PUBLIC + GTest::GTest + Qt5::Core + Qt5::Test + Quassel::Common +) diff --git a/src/test/main/testglobal.h b/src/test/global/testglobal.h similarity index 97% rename from src/test/main/testglobal.h rename to src/test/global/testglobal.h index 33f1fb8e..cc7ce978 100644 --- a/src/test/main/testglobal.h +++ b/src/test/global/testglobal.h @@ -20,6 +20,6 @@ #pragma once -#include "test-main-export.h" +#include "test-global-export.h" #include diff --git a/src/test/main/CMakeLists.txt b/src/test/main/CMakeLists.txt index 6d6993f8..5d590634 100644 --- a/src/test/main/CMakeLists.txt +++ b/src/test/main/CMakeLists.txt @@ -2,12 +2,10 @@ quassel_add_module(Test::Main EXPORT NOINSTALL) target_sources(${TARGET} PRIVATE main.cpp - testglobal.h ) target_link_libraries(${TARGET} PUBLIC - GTest::GTest Qt5::Core - Quassel::Common + Quassel::Test::Global )