kwin/autotests/drm/CMakeLists.txt
Martin Flöser 1c61e61119 [autotests] Support new way to run the tests without need to install
Summary:
KWin was quite good in ensuring that you don't need to install by
passing paths to the tests. The new way is much nicer, so code is
adjusted for the new way. Also if we require a newer ECM in future we
need to support the new way.

No guarantee that the tests don't pick something up from the system env,
that needs more testing.

References: https://community.kde.org/Guidelines_and_HOWTOs/Making_apps_run_uninstalled

Test Plan: The tests which loaded helpers pass

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7543
2017-11-21 20:34:52 +01:00

26 lines
858 B
CMake

include_directories(${Libdrm_INCLUDE_DIRS})
set(mockDRM_SRCS
mock_drm.cpp
../../plugins/platforms/drm/drm_buffer.cpp
../../plugins/platforms/drm/drm_object.cpp
../../plugins/platforms/drm/drm_object_connector.cpp
../../plugins/platforms/drm/drm_object_plane.cpp
../../plugins/platforms/drm/logging.cpp
)
add_library(mockDrm STATIC ${mockDRM_SRCS})
target_link_libraries(mockDrm Qt5::Gui)
ecm_mark_as_test(mockDrm)
function(drmTest)
set(oneValueArgs NAME)
set(multiValueArgs SRCS )
cmake_parse_arguments(ARGS "" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
add_executable(${ARGS_NAME} ${ARGS_SRCS})
target_link_libraries(${ARGS_NAME} mockDrm Qt5::Test)
add_test(NAME kwin-drm-${ARGS_NAME} COMMAND ${ARGS_NAME})
ecm_mark_as_test(${ARGS_NAME})
endfunction()
drmTest(NAME objecttest SRCS objecttest.cpp)