Commit 27d0b63e authored by Frederik Gladhorn's avatar Frederik Gladhorn

cmake: use cmake-extra-modules for Unit Tests

Summary:
This actually makes it less boiler plate heavy.
It also fixes a few small issues with the tests, three tests were
previously forgotten and have been re-added.

With the custom krita_add_broken_unit_test the same functionallty is
preserved that was there before in the fork of the kde4 macro.
This is a step towards reducing the amount of custom cmake code that
Krita drags around and will make the build system easier.

Thanks to the new macros, the total amount of redundant macro code is
reduced and we lose a bit over 1000 lines of useless boilerplate.

The total test count goes up by three.

The flake tests had their data in the source path, which is unlike any
other tests and were relying on some old defines. They have been adapted
to behave like any other test.

Reviewers: #krita

Subscribers: rempt

Differential Revision: https://phabricator.kde.org/D3167
parent 2b3b7dab
......@@ -61,20 +61,6 @@ if (APPLE)
add_definitions(-mmacosx-version-min=10.9 -Wno-deprecated-register)
endif()
# QT5TODO: remove KDE4_BUILD_TESTS once all kde4_add_unit_test have been converted
# transitional forward compatibility:
# BUILD_TESTING is cmake standard, KDE4_BUILD_TESTS not used by ECM/KF5, but only
# macros in cmake/transitional. Just, Macros from cmake/transitional,
# incl. kde4_add_unit_test, are only picked up if no macros from kdelibs4 are installed,
# because that transitional path is appended. Prepending instead might possibly unwantedly
# mask ECM/KF5 macros. Not tested.
# So have BUILD_TESTING define KDE4_BUILD_TESTS.
if (BUILD_TESTING)
set(KDE4_BUILD_TESTS TRUE)
else()
set(KDE4_BUILD_TESTS FALSE)
endif()
######################
#######################
## Constants defines ##
......@@ -228,7 +214,6 @@ include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDECompilerSettings)
include(FeatureSummary)
include(KDE4Macros)
# do not reorder to be alphabetical: this is the order in which the frameworks
# depend on each other.
......@@ -605,7 +590,7 @@ else()
set(REQUIRED_Xinput_FOUND TRUE)
endif()
add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS} ${QT_QTDBUS_DEFINITIONS})
add_definitions(${QT_DEFINITIONS} ${QT_QTDBUS_DEFINITIONS})
if(WIN32)
set(LIB_INSTALL_DIR ${LIB_INSTALL_DIR}
......
This diff is collapsed.
include(CMakeParseArguments)
include(ECMMarkAsTest)
include(ECMMarkNonGuiExecutable)
# modified version of ECMAddTests.cmake in cmake-extra-modules
function(KRITA_ADD_BROKEN_UNIT_TEST)
set(options GUI)
# TARGET_NAME_VAR and TEST_NAME_VAR are undocumented args used by
# ecm_add_tests
set(oneValueArgs TEST_NAME NAME_PREFIX TARGET_NAME_VAR TEST_NAME_VAR)
set(multiValueArgs LINK_LIBRARIES)
cmake_parse_arguments(ARG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
set(_sources ${ARG_UNPARSED_ARGUMENTS})
list(LENGTH _sources _sourceCount)
if(ARG_TEST_NAME)
set(_targetname ${ARG_TEST_NAME})
elseif(${_sourceCount} EQUAL "1")
#use the source file name without extension as the testname
get_filename_component(_targetname ${_sources} NAME_WE)
else()
#more than one source file passed, but no test name given -> error
message(FATAL_ERROR "ecm_add_test() called with multiple source files but without setting \"TEST_NAME\"")
endif()
set(_testname ${ARG_NAME_PREFIX}${_targetname})
MESSAGE(" * Unittest " ${_testname} " is broken!")
set(gui_args)
if(ARG_GUI)
set(gui_args WIN32 MACOSX_BUNDLE)
endif()
add_executable(${_targetname} ${gui_args} ${_sources})
if(NOT ARG_GUI)
ecm_mark_nongui_executable(${_targetname})
endif()
# do not add it as test, so make test skips it!
# add_test(NAME ${_testname} COMMAND ${_targetname})
target_link_libraries(${_targetname} ${ARG_LINK_LIBRARIES})
ecm_mark_as_test(${_targetname})
if (ARG_TARGET_NAME_VAR)
set(${ARG_TARGET_NAME_VAR} "${_targetname}" PARENT_SCOPE)
endif()
if (ARG_TEST_NAME_VAR)
set(${ARG_TEST_NAME_VAR} "${_testname}" PARENT_SCOPE)
endif()
endfunction()
......@@ -23,7 +23,8 @@ macro (KRITA_ADD_BENCHMARK _test_NAME)
set(_nogui "NOGUI")
endif()
kde4_add_executable( ${_test_NAME} TEST ${_srcList} )
add_executable( ${_test_NAME} ${_srcList} )
ecm_mark_as_test(${_test_NAME})
if(NOT KDE4_TEST_OUTPUT)
set(KDE4_TEST_OUTPUT plaintext)
......
......@@ -15,30 +15,16 @@ if(HAVE_VC)
)
endif()
macro_add_unittest_definitions()
########### next target ###############
set(kis_auto_brush_test_SRCS kis_auto_brush_test.cpp )
kde4_add_unit_test(KisAutoBrushTest TESTNAME krita-libbrush-KisAutoBrushTest ${kis_auto_brush_test_SRCS})
target_link_libraries(KisAutoBrushTest kritaimage kritalibbrush Qt5::Test)
########### next target ###############
set(kis_gbr_brush_test_SRCS kis_gbr_brush_test.cpp )
kde4_add_unit_test(KisGbrBrushTest TESTNAME krita-libbrush-KisGbrBrushTest ${kis_gbr_brush_test_SRCS})
target_link_libraries(KisGbrBrushTest kritaimage kritalibbrush Qt5::Test)
########### next target ###############
set(kis_boundary_test_SRCS kis_boundary_test.cpp )
kde4_add_unit_test(KisBoundaryTest TESTNAME krita-libbrush-KisBoundaryTest ${kis_boundary_test_SRCS})
target_link_libraries(KisBoundaryTest kritaimage kritalibbrush Qt5::Test)
include(ECMAddTests)
########### next target ###############
ecm_add_tests(
kis_auto_brush_test.cpp
kis_gbr_brush_test.cpp
kis_boundary_test.cpp
kis_imagepipe_brush_test.cpp
NAME_PREFIX "krita-libbrush-"
LINK_LIBRARIES kritaimage kritalibbrush Qt5::Test
)
set(kis_imagepipe_brush_test_SRCS kis_imagepipe_brush_test.cpp )
kde4_add_unit_test(KisImagePipeBrushTest TESTNAME krita-libbrush-KisImagePipeBrushTest ${kis_imagepipe_brush_test_SRCS})
target_link_libraries(KisImagePipeBrushTest kritaimage kritalibbrush Qt5::Test)
set( EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR} )
########### next target ###############
set(TestPosition_test_SRCS TestPosition.cpp )
kde4_add_unit_test(TestPosition TESTNAME libs-kritaflake-TestPosition ${TestPosition_test_SRCS})
target_link_libraries(TestPosition kritaflake Qt5::Test)
########### next target ###############
set(TestSelection_test_SRCS TestSelection.cpp )
kde4_add_unit_test(TestSelection TESTNAME libs-kritaflake-TestSelection ${TestSelection_test_SRCS})
target_link_libraries(TestSelection kritaflake Qt5::Test)
########### next target ###############
set(TestPathShape_test_SRCS TestPathShape.cpp )
kde4_add_broken_unit_test(TestPathShape TESTNAME libs-kritaflake-TestPathShape ${TestPathShape_test_SRCS})
target_link_libraries(TestPathShape kritaflake Qt5::Test)
########### next target ###############
set(TestPathTool_test_SRCS TestPathTool.cpp )
kde4_add_unit_test(TestPathTool TESTNAME libs-kritaflake-TestPathTool ${TestPathTool_test_SRCS})
target_link_libraries(TestPathTool kritaflake Qt5::Test)
########### next target ###############
set(TestControlPointMoveCommand_test_SRCS TestControlPointMoveCommand.cpp )
kde4_add_broken_unit_test(TestControlPointMoveCommand TESTNAME libs-kritaflake-TestControlPointMoveCommand ${TestControlPointMoveCommand_test_SRCS})
target_link_libraries(TestControlPointMoveCommand kritaflake Qt5::Test)
########### next target ###############
set(TestPointTypeCommand_test_SRCS TestPointTypeCommand.cpp )
kde4_add_broken_unit_test(TestPointTypeCommand TESTNAME libs-kritaflake-TestPointTypeCommand ${TestPointTypeCommand_test_SRCS})
target_link_libraries(TestPointTypeCommand kritaflake Qt5::Test)
########### next target ###############
set(TestPointRemoveCommand_test_SRCS TestPointRemoveCommand.cpp )
kde4_add_broken_unit_test(TestPointRemoveCommand TESTNAME libs-kritaflake-TestPointRemoveCommand ${TestPointRemoveCommand_test_SRCS})
target_link_libraries(TestPointRemoveCommand kritaflake Qt5::Test)
########### next target ###############
set(TestRemoveSubpathCommand_test_SRCS TestRemoveSubpathCommand.cpp )
kde4_add_broken_unit_test(TestRemoveSubpathCommand TESTNAME libs-kritaflake-TestRemoveSubpathCommand ${TestRemoveSubpathCommand_test_SRCS})
target_link_libraries(TestRemoveSubpathCommand kritaflake Qt5::Test)
########### next target ###############
set(TestShapeAt_test_SRCS TestShapeAt.cpp )
kde4_add_unit_test(TestShapeAt TESTNAME libs-kritaflake-TestShapeAt ${TestShapeAt_test_SRCS})
target_link_libraries(TestShapeAt kritaflake Qt5::Test)
########### next target ###############
set(TestShapePaint_test_SRCS TestShapePainting.cpp )
kde4_add_unit_test(TestShapePainting TESTNAME libs-kritaflake-TestShapePainting ${TestShapePaint_test_SRCS})
target_link_libraries(TestShapePainting kritaflake Qt5::Test)
########### next target ###############
set(TestKoShapeFactory_test_SRCS TestKoShapeFactory.cpp )
kde4_add_unit_test(TestKoShapeFactory TESTNAME libs-kritaflake-TestKoShapeFactory ${TestKoShapeFactory_test_SRCS})
target_link_libraries(TestKoShapeFactory kritaflake Qt5::Test)
########### next target ###############
set(TestKoShapeRegistry_test_SRCS TestKoShapeRegistry.cpp )
kde4_add_unit_test(TestKoShapeRegistry TESTNAME libs-kritaflake-TestKoShapeRegistry ${TestKoShapeRegistry_test_SRCS})
target_link_libraries(TestKoShapeRegistry kritaflake Qt5::Test)
########### end ###############
set(TestShapeContainer_test_SRCS TestShapeContainer.cpp )
kde4_add_unit_test(TestShapeContainer TESTNAME libs-kritaflake-TestShapeContainer ${TestShapeContainer_test_SRCS})
target_link_libraries(TestShapeContainer kritaflake Qt5::Test)
########### end ###############
set(TestShapeGroupCommand_test_SRCS TestShapeGroupCommand.cpp )
kde4_add_unit_test(TestShapeGroupCommand TESTNAME libs-kritaflake-TestShapeGroupCommand ${TestShapeGroupCommand_test_SRCS})
target_link_libraries(TestShapeGroupCommand kritaflake Qt5::Test)
########### end ###############
set(TestShapeReorderCommand_test_SRCS TestShapeReorderCommand.cpp )
kde4_add_unit_test(TestShapeReorderCommand TESTNAME libs-kritaflake-TestShapeReorderCommand ${TestShapeReorderCommand_test_SRCS})
target_link_libraries(TestShapeReorderCommand kritaflake Qt5::Test)
########### next target ###############
set(TestPathSegment_test_SRCS TestPathSegment.cpp )
kde4_add_broken_unit_test(TestPathSegment TESTNAME libs-kritaflake-TestPathSegment ${TestPathSegment_test_SRCS})
target_link_libraries(TestPathSegment kritaflake Qt5::Test)
########### next target ###############
set(TestImageCollection_test_SRCS TestImageCollection.cpp )
kde4_add_unit_test(TestImageCollection TESTNAME libs-kritaflake-TestImageCollection ${TestImageCollection_test_SRCS})
target_link_libraries(TestImageCollection kritaflake Qt5::Test)
########### next target ###############
set(TestCanvasResourceProvider_test_SRCS TestResourceManager.cpp )
kde4_add_unit_test(TestResourceManager TESTNAME libs-kritaflake-TestResourceManager ${TestCanvasResourceProvider_test_SRCS})
target_link_libraries(TestResourceManager kritaflake Qt5::Test)
########### end ###############
set(TestShapeBackgroundCommand_test_SRCS TestShapeBackgroundCommand.cpp )
kde4_add_unit_test(TestShapeBackgroundCommand TESTNAME libs-kritaflake-TestShapeBackgroundCommand ${TestShapeBackgroundCommand_test_SRCS})
target_link_libraries(TestShapeBackgroundCommand kritaflake Qt5::Test)
########### end ###############
set(TestShapeStrokeCommand_test_SRCS TestShapeStrokeCommand.cpp )
kde4_add_unit_test(TestShapeStrokeCommand TESTNAME libs-kritaflake-TestShapeStrokeCommand ${TestShapeStrokeCommand_test_SRCS})
target_link_libraries(TestShapeStrokeCommand kritaflake Qt5::Test)
########### end ###############
set(TestShapeShadowCommand_test_SRCS TestShapeShadowCommand.cpp )
kde4_add_unit_test(TestShapeShadowCommand TESTNAME libs-kritaflake-TestShapeShadowCommand ${TestShapeShadowCommand_test_SRCS})
target_link_libraries(TestShapeShadowCommand kritaflake Qt5::Test)
########### end ###############
set(TestSegmentTypeCommand_test_SRCS TestSegmentTypeCommand.cpp )
kde4_add_broken_unit_test(TestSegmentTypeCommand TESTNAME libs-kritaflake-TestSegmentTypeCommand ${TestSegmentTypeCommand_test_SRCS})
target_link_libraries(TestSegmentTypeCommand kritaflake Qt5::Test)
########### end ###############
set(TestPointMergeCommand_test_SRCS TestPointMergeCommand.cpp )
kde4_add_broken_unit_test(TestPointMergeCommand TESTNAME libs-kritaflake-TestPointMergeCommand ${TestPointMergeCommand_test_SRCS})
target_link_libraries(TestPointMergeCommand kritaflake Qt5::Test)
########### end ###############
set(TestInputDevice_test_SRCS TestInputDevice.cpp )
kde4_add_unit_test(TestInputDevice TESTNAME libs-kritaflake-TestInputDevice ${TestInputDevice_test_SRCS})
target_link_libraries(TestInputDevice kritaflake Qt5::Test)
########### end ###############
set(TestSnapStrategy_test_SRCS TestSnapStrategy.cpp )
kde4_add_unit_test(TestSnapStrategy TESTNAME libs-kritaflake-TestSnapStrategy ${TestSnapStrategy_test_SRCS})
target_link_libraries(TestSnapStrategy kritaflake Qt5::Test)
include(ECMAddTests)
include(KritaAddBrokenUnitTest)
macro_add_unittest_definitions()
ecm_add_tests(
TestPosition.cpp
TestSelection.cpp
TestPathTool.cpp
TestShapeAt.cpp
TestShapePainting.cpp
TestKoShapeFactory.cpp
TestKoShapeRegistry.cpp
TestShapeContainer.cpp
TestShapeGroupCommand.cpp
TestShapeReorderCommand.cpp
TestImageCollection.cpp
TestResourceManager.cpp
TestShapeBackgroundCommand.cpp
TestShapeStrokeCommand.cpp
TestShapeShadowCommand.cpp
TestInputDevice.cpp
TestSnapStrategy.cpp
NAME_PREFIX "libs-kritaflake-"
LINK_LIBRARIES kritaflake Qt5::Test)
krita_add_broken_unit_test(TestPathShape.cpp
TEST_NAME libs-kritaflake-TestPathShape
LINK_LIBRARIES kritaflake Qt5::Test)
krita_add_broken_unit_test(TestControlPointMoveCommand.cpp
TEST_NAME libs-kritaflake-TestControlPointMoveCommand
LINK_LIBRARIES kritaflake Qt5::Test)
krita_add_broken_unit_test(TestPointTypeCommand.cpp
TEST_NAME libs-kritaflake-TestPointTypeCommand
LINK_LIBRARIES kritaflake Qt5::Test)
krita_add_broken_unit_test(TestPointRemoveCommand.cpp
TEST_NAME libs-kritaflake-TestPointRemoveCommand
LINK_LIBRARIES kritaflake Qt5::Test)
krita_add_broken_unit_test(TestRemoveSubpathCommand.cpp
TEST_NAME libs-kritaflake-TestRemoveSubpathCommand
LINK_LIBRARIES kritaflake Qt5::Test)
krita_add_broken_unit_test(TestPathSegment.cpp
TEST_NAME libs-kritaflake-TestPathSegment
LINK_LIBRARIES kritaflake Qt5::Test)
krita_add_broken_unit_test(TestSegmentTypeCommand.cpp
TEST_NAME libs-kritaflake-TestSegmentTypeCommand
LINK_LIBRARIES kritaflake Qt5::Test)
krita_add_broken_unit_test(TestPointMergeCommand.cpp
TEST_NAME libs-kritaflake-TestPointMergeCommand
LINK_LIBRARIES kritaflake Qt5::Test)
......@@ -34,7 +34,7 @@
void TestImageCollection::testGetImageImage()
{
KoImageCollection collection;
QImage image(KDESRCDIR "/logo-calligra.png");
QImage image(FILES_DATA_DIR "logo-calligra.png");
KoImageData *id1 = collection.createImageData(image);
QCOMPARE(id1->hasCachedImage(), true);
......@@ -46,7 +46,7 @@ void TestImageCollection::testGetImageImage()
QCOMPARE(id3->hasCachedImage(), true);
QCOMPARE(id1->key(), id3->key());
QCOMPARE(id1->priv(), id3->priv());
QImage image2(KDESRCDIR "/logo-kpresenter.png");
QImage image2(FILES_DATA_DIR "logo-kpresenter.png");
KoImageData *id4 = collection.createImageData(image2);
QCOMPARE(id4->hasCachedImage(), true);
QVERIFY(id1->key() != id4->key());
......@@ -75,7 +75,7 @@ void TestImageCollection::testGetImageImage()
void TestImageCollection::testGetImageStore()
{
KoImageCollection collection;
KoStore *store = KoStore::createStore(KDESRCDIR "/store.zip", KoStore::Read);
KoStore *store = KoStore::createStore(FILES_DATA_DIR "store.zip", KoStore::Read);
QString image("logo-calligra.jpg");
KoImageData *id1 = collection.createImageData(image, store);
QCOMPARE(id1->suffix(), QString("jpg"));
......@@ -162,7 +162,7 @@ void TestImageCollection::testPreload1()
void TestImageCollection::testPreload3()
{
KoImageData data;
KoStore *store = KoStore::createStore(KDESRCDIR "/store.zip", KoStore::Read);
KoStore *store = KoStore::createStore(FILES_DATA_DIR "store.zip", KoStore::Read);
QString image("logo-calligra.png");
data.setImage(image, store);
......@@ -193,7 +193,7 @@ void TestImageCollection::testPreload3()
void TestImageCollection::testSameKey()
{
KoStore *store = KoStore::createStore(KDESRCDIR "/store.zip", KoStore::Read);
KoStore *store = KoStore::createStore(FILES_DATA_DIR "store.zip", KoStore::Read);
QString image("logo-calligra.png");
KoImageData data;
data.setImage(image, store);
......@@ -203,7 +203,7 @@ void TestImageCollection::testSameKey()
QCOMPARE(data.key(), data2.key());
QFile file(KDESRCDIR "/logo-calligra.png");
QFile file(FILES_DATA_DIR "logo-calligra.png");
file.open(QIODevice::ReadOnly);
QByteArray imageData = file.readAll();
KoImageData data3;
......@@ -211,16 +211,16 @@ void TestImageCollection::testSameKey()
QCOMPARE(data.key(), data3.key());
QCOMPARE(data2.key(), data3.key());
QImage qImage1(KDESRCDIR "/logo-calligra.png");
QImage qImage2(KDESRCDIR "/logo-calligra.png");
QImage qImage1(FILES_DATA_DIR "logo-calligra.png");
QImage qImage2(FILES_DATA_DIR "logo-calligra.png");
KoImageData data4;
data4.setImage(qImage1);
KoImageData data5;
data5.setImage(qImage2);
QCOMPARE(data4.key(), data5.key());
QImage qImage3(KDESRCDIR "/logo-calligra-big.png");
QImage qImage4(KDESRCDIR "/logo-calligra-big.png");
QImage qImage3(FILES_DATA_DIR "/logo-calligra-big.png");
QImage qImage4(FILES_DATA_DIR "/logo-calligra-big.png");
KoImageData data6;
data6.setImage(qImage3);
KoImageData data7;
......
This diff is collapsed.
......@@ -10,66 +10,58 @@ include_directories(SYSTEM
macro_add_unittest_definitions()
########### next target ###############
set(kis_tiled_data_manager_test_SRCS kis_tiled_data_manager_test.cpp )
kde4_add_unit_test(KisTiledDataManagerTest TESTNAME krita-image-KisTiledDataManagerTest ${kis_tiled_data_manager_test_SRCS})
target_link_libraries(KisTiledDataManagerTest kritaimage Qt5::Test)
ecm_add_tests(
kis_tiled_data_manager_test.cpp
kis_low_memory_tests.cpp
kis_lockless_stack_test.cpp
NAME_PREFIX "krita-image-tiles3-"
LINK_LIBRARIES kritaimage Qt5::Test)
########### next target ###############
set(kis_low_memory_tests_SRCS kis_low_memory_tests.cpp )
kde4_add_unit_test(KisLowMemoryTests TESTNAME krita-image-KisLowMemoryTests ${kis_low_memory_tests_SRCS})
target_link_libraries(KisLowMemoryTests kritaimage Qt5::Test)
set_tests_properties(krita-image-KisLowMemoryTests PROPERTIES TIMEOUT 180)
set_tests_properties(krita-image-tiles3-kis_low_memory_tests PROPERTIES TIMEOUT 180)
########### next target ###############
#kisdoc
#set(kis_tile_compressors_test_SRCS kis_tile_compressors_test.cpp )
#kde4_add_unit_test(KisTileCompressorsTest TESTNAME krita-image-KisTileCompressorsTest ${kis_tile_compressors_test_SRCS})
#target_link_libraries(KisTileCompressorsTest kritaodf kritaimage Qt5::Test)
#kde4_add_unit_test(KisTileCompressorsTest TEST_NAME krita-image-KisTileCompressorsTest ${kis_tile_compressors_test_SRCS})
#target_LINK_LIBRARIES(KisTileCompressorsTest kritaodf kritaimage Qt5::Test)
########### next target ###############
#kisdoc
#set(kis_compression_tests_SRCS kis_compression_tests.cpp )
#kde4_add_unit_test(KisCompressionTests TESTNAME krita-image-KisCompressionTests ${kis_compression_tests_SRCS})
#target_link_libraries(KisCompressionTests kritaimage Qt5::Test)
########### next target ###############
set(kis_lockless_stack_test_SRCS kis_lockless_stack_test.cpp )
kde4_add_unit_test(KisLocklessStackTest TESTNAME krita-image-KisLocklessStackTest ${kis_lockless_stack_test_SRCS})
target_link_libraries(KisLocklessStackTest kritaimage Qt5::Test)
#kde4_add_unit_test(KisCompressionTests TEST_NAME krita-image-KisCompressionTests ${kis_compression_tests_SRCS})
#target_LINK_LIBRARIES(KisCompressionTests kritaimage Qt5::Test)
########### next target ###############
set(kis_memory_pool_test_SRCS kis_memory_pool_test.cpp )
kde4_add_unit_test(KisMemoryPoolTest TESTNAME krita-image-KisMemoryPoolTest ${kis_memory_pool_test_SRCS})
target_link_libraries(KisMemoryPoolTest kritaglobal Qt5::Test)
ecm_add_test(
kis_memory_pool_test.cpp
TEST_NAME krita-image-KisMemoryPoolTest
LINK_LIBRARIES kritaglobal Qt5::Test)
########### next target ###############
set(kis_chunk_allocator_test_SRCS kis_chunk_allocator_test.cpp ../swap/kis_chunk_allocator.cpp)
kde4_add_unit_test(KisChunkAllocatorTest TESTNAME krita-image-KisChunkAllocatorTest ${kis_chunk_allocator_test_SRCS})
target_link_libraries(KisChunkAllocatorTest kritaglobal Qt5::Test)
ecm_add_test(
kis_chunk_allocator_test.cpp ../swap/kis_chunk_allocator.cpp
TEST_NAME krita-image-KisChunkAllocatorTest
LINK_LIBRARIES kritaglobal Qt5::Test)
########### next target ###############
set(kis_memory_window_test_SRCS kis_memory_window_test.cpp ../swap/kis_memory_window.cpp)
kde4_add_unit_test(KisMemoryWindowTest TESTNAME krita-image-KisMemoryWindowTest ${kis_memory_window_test_SRCS})
target_link_libraries(KisMemoryWindowTest kritaglobal Qt5::Test)
ecm_add_test(
kis_memory_window_test.cpp ../swap/kis_memory_window.cpp
TEST_NAME krita-image-KisMemoryWindowTest
LINK_LIBRARIES kritaglobal Qt5::Test)
########### next target ###############
set(kis_swapped_data_store_test_SRCS kis_swapped_data_store_test.cpp ../kis_tile_data.cc)
kde4_add_unit_test(KisSwappedDataStoreTest TESTNAME krita-image-KisSwappedDataStoreTest ${kis_swapped_data_store_test_SRCS})
target_link_libraries(KisSwappedDataStoreTest kritaimage Qt5::Test ${Boost_SYSTEM_LIBRARY})
krita_add_broken_unit_test(kis_swapped_data_store_test.cpp ../kis_tile_data.cc
TEST_NAME krita-image-KisSwappedDataStoreTest
LINK_LIBRARIES kritaimage Qt5::Test ${Boost_SYSTEM_LIBRARY})
########### next target ###############
set(kis_tile_data_store_test_SRCS kis_tile_data_store_test.cpp ../kis_tile_data.cc)
kde4_add_broken_unit_test(KisTileDataStoreTest TESTNAME krita-image-KisTileDataStoreTest ${kis_tile_data_store_test_SRCS})
target_link_libraries(KisTileDataStoreTest kritaimage Qt5::Test ${Boost_SYSTEM_LIBRARY})
krita_add_broken_unit_test(kis_tile_data_store_test.cpp ../kis_tile_data.cc
TEST_NAME krita-image-KisTileDataStoreTest
LINK_LIBRARIES kritaimage Qt5::Test ${Boost_SYSTEM_LIBRARY})
########### next target ###############
set(kis_store_limits_test_SRCS kis_store_limits_test.cpp ../kis_tile_data.cc )
kde4_add_broken_unit_test(KisStoreLimitsTest TESTNAME krita-image-KisStoreLimitsTest ${kis_store_limits_test_SRCS})
target_link_libraries(KisStoreLimitsTest kritaimage Qt5::Test ${Boost_SYSTEM_LIBRARY})
krita_add_broken_unit_test(kis_store_limits_test.cpp ../kis_tile_data.cc
TEST_NAME krita-image-KisStoreLimitsTest
LINK_LIBRARIES kritaimage Qt5::Test ${Boost_SYSTEM_LIBRARY})
########### next target ###############
set(kis_tile_data_pooler_test_SRCS kis_tile_data_pooler_test.cpp ../kis_tile_data.cc ../kis_tile_data_pooler.cc )
kde4_add_unit_test(KisTileDataPoolerTest TESTNAME krita-image-KisTileDataPoolerTest ${kis_tile_data_pooler_test_SRCS})
target_link_libraries(KisTileDataPoolerTest kritaimage Qt5::Test ${Boost_SYSTEM_LIBRARY})
krita_add_broken_unit_test(kis_tile_data_pooler_test.cpp ../kis_tile_data.cc ../kis_tile_data_pooler.cc
TEST_NAME krita-image-KisTileDataPoolerTest
LINK_LIBRARIES kritaimage Qt5::Test ${Boost_SYSTEM_LIBRARY})
set( EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR} )
########### next target ###############
set(TestKoGenStyles_SRCS TestKoGenStyles.cpp )
kde4_add_unit_test(TestKoGenStyles TESTNAME libs-odf-TestKoGenStyles ${TestKoGenStyles_SRCS})
target_link_libraries(TestKoGenStyles kritaodf KF5::I18n Qt5::Test)
########### next target ###############
set(TestOdfSettings_SRCS TestOdfSettings.cpp )
kde4_add_unit_test(TestOdfSettings TESTNAME libs-odf-TestOdfSettings ${TestOdfSettings_SRCS})
target_link_libraries(TestOdfSettings kritaodf KF5::I18n Qt5::Test)
########### next target ###############
set(TestKoOdfLoadingContext_SRCS TestKoOdfLoadingContext.cpp )
kde4_add_unit_test(TestKoOdfLoadingContext TESTNAME libs-odf-TestKoOdfLoadingContext ${TestKoOdfLoadingContext_SRCS})
target_link_libraries(TestKoOdfLoadingContext kritaodf KF5::I18n Qt5::Test)
########### next target ###############
set(xmlwritertest_SRCS TestXmlWriter.cpp )
kde4_add_unit_test(TestXmlWriter TESTNAME libs-odf-TestXmlWriter ${xmlwritertest_SRCS})
target_link_libraries(TestXmlWriter kritaodf Qt5::Test)
########### next target ###############
set(xmlreadertest_SRCS TestXmlReader.cpp )
kde4_add_unit_test(TestXmlReader TESTNAME libs-odf-TestXmlReader ${xmlreadertest_SRCS})
target_link_libraries(TestXmlReader kritaodf Qt5::Test)
########### next target ###############
set(xmlreadertestwithoutspaces_SRCS TestXmlReaderWithoutSpaces.cpp )
kde4_add_unit_test(TestXmlReaderWithoutSpaces TESTNAME libs-odf-TestXmlReaderWithoutSpaces ${xmlreadertestwithoutspaces_SRCS})
target_link_libraries(TestXmlReaderWithoutSpaces kritaodf Qt5::Test)
########### next target ###############
set(kodomtest_SRCS kodomtest.cpp )
kde4_add_unit_test(kodomtest TESTNAME libs-store-kodomtest ${kodomtest_SRCS})
target_link_libraries(kodomtest kritaodf Qt5::Test )
########### next target ###############
set(storageTest_SRCS TestStorage.cpp )
kde4_add_unit_test(TestStorage TESTNAME libs-store-storage ${storageTest_SRCS})
target_link_libraries(TestStorage kritaodf KF5::I18n Qt5::Test)
########### next target ###############
set(TestKoUnit_SRCS TestKoUnit.cpp)
kde4_add_unit_test(TestKoUnit TESTNAME libs-kritaodf-TestKoUnit ${TestKoUnit_SRCS})
target_link_libraries(TestKoUnit kritaodf Qt5::Test)
########### next target ###############
set(TestNumberStyle_SRCS TestNumberStyle.cpp )
kde4_add_broken_unit_test(TestNumberStyle TESTNAME libs-odf-TestNumberStyle ${TestNumberStyle_SRCS})
target_link_libraries(TestNumberStyle kritaodf Qt5::Test)
########### next target ###############
set(TestKoElementReference_SRCS TestKoElementReference.cpp)
kde4_add_unit_test(TestKoElementReference TESTNAME libs-kritaodf-TestKoElementReference ${TestKoElementReference_SRCS})
target_link_libraries(TestKoElementReference kritaodf Qt5::Test)
########### end ###############
include(ECMAddTests)
include(KritaAddBrokenUnitTest)
ecm_add_tests(
TestKoGenStyles.cpp
TestOdfSettings.cpp
TestKoOdfLoadingContext.cpp
TestStorage.cpp
NAME_PREFIX "libs-odf-"
LINK_LIBRARIES kritaodf KF5::I18n Qt5::Test)
ecm_add_tests(
TestXmlWriter.cpp
TestXmlReader.cpp
TestXmlReaderWithoutSpaces.cpp
kodomtest.cpp
TestKoUnit.cpp
TestNumberStyle.cpp
TestKoElementReference.cpp
NAME_PREFIX "libs-odf-"
LINK_LIBRARIES kritaodf Qt5::Test)
......@@ -9,103 +9,30 @@ if(MSVC OR (WIN32 AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel"))
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /NODEFAULTLIB:LIBC.LIB")
endif()
########### next target ###############
ecm_add_tests(
TestKoColorSpaceRegistry.cpp
TestKoColorSpaceAbstract.cpp
TestColorConversionSystem.cpp
TestKoColor.cpp
TestKoIntegerMaths.cpp
TestConvolutionOpImpl.cpp
KoRgbU8ColorSpaceTester.cpp
TestKoColorSpaceSanity.cpp
TestFallBackColorTransformation.cpp
TestKoChannelInfo.cpp
set(TestKoColorSpaceRegistry_test_SRCS TestKoColorSpaceRegistry.cpp )
NAME_PREFIX "libs-pigment-"
LINK_LIBRARIES kritapigment KF5::I18n Qt5::Test)
kde4_add_unit_test(TestKoColorSpaceRegistry TESTNAME libs-pigment-TestKoColorSpaceRegistry ${TestKoColorSpaceRegistry_test_SRCS})
ecm_add_tests(
TestColorConversion.cpp
TestKoColorSpaceMaths.cpp
target_link_libraries(TestKoColorSpaceRegistry kritapigment KF5::I18n Qt5::Test)
NAME_PREFIX "libs-pigment-"
LINK_LIBRARIES kritapigment Qt5::Test)
########### next target ###############
set(TestColorConversion_test_SRCS TestColorConversion.cpp )
kde4_add_unit_test(TestColorConversion TESTNAME libs-pigment-TestColorConversion ${TestColorConversion_test_SRCS})
target_link_libraries(TestColorConversion kritapigment Qt5::Test)
########### next target ###############
set(TestKoColorSpaceAbstract_test_SRCS TestKoColorSpaceAbstract.cpp )
kde4_add_unit_test(TestKoColorSpaceAbstract TESTNAME libs-pigment-TestKoColorSpaceAbstract ${TestKoColorSpaceAbstract_test_SRCS})
target_link_libraries(TestKoColorSpaceAbstract kritapigment KF5::I18n Qt5::Test)
########### next target ###############
set(TestKoColorSpaceMaths_test_SRCS TestKoColorSpaceMaths.cpp)
kde4_add_unit_test(TestKoColorSpaceMaths TESTNAME libs-pigment-TestKoColorSpaceMaths ${TestKoColorSpaceMaths_test_SRCS})
target_link_libraries(TestKoColorSpaceMaths kritapigment Qt5::Test)
########### next target ###############
set(CCSGraph_GRAPH CCSGraph.cpp)
kde4_add_executable(CCSGraph ${CCSGraph_GRAPH})
target_link_libraries(CCSGraph kritapigment KF5::I18n )
########### next target ###############
set(TestColorConversionSystem_test_SRCS TestColorConversionSystem.cpp )
kde4_add_unit_test(TestColorConversionSystem TESTNAME libs-pigment-TestColorConversionSystem ${TestColorConversionSystem_test_SRCS})
target_link_libraries(TestColorConversionSystem kritapigment KF5::I18n Qt5::Test)
########### next target ###############
set(TestKoColor_test_SRCS TestKoColor.cpp )
kde4_add_unit_test(TestKoColor TESTNAME libs-pigment-TestKoColor ${TestKoColor_test_SRCS})
target_link_libraries(TestKoColor kritapigment KF5::I18n Qt5::Test)
########### next target ###############
set(TestKoIntegerMaths_test_SRCS TestKoIntegerMaths.cpp )
kde4_add_unit_test(TestKoIntegerMaths TESTNAME libs-pigment-TestKoIntegerMaths ${TestKoIntegerMaths_test_SRCS})
target_link_libraries(TestKoIntegerMaths kritapigment KF5::I18n Qt5::Test)
########### next target ###############
set(TestConvolutionOpImpl_test_SRCS TestConvolutionOpImpl.cpp )
kde4_add_unit_test(TestConvolutionOpImpl TESTNAME libs-pigment-TestConvolutionOpImpl ${TestConvolutionOpImpl_test_SRCS})
target_link_libraries(TestConvolutionOpImpl kritapigment KF5::I18n Qt5::Test)
########### next target ###############
set(TestKoRgbU8ColorSpaceTester_test_SRCS KoRgbU8ColorSpaceTester.cpp )
kde4_add_unit_test(TestKoRgbU8ColorSpaceTester TESTNAME libs-pigment-TestKoRgbU8ColorSpaceTester ${TestKoRgbU8ColorSpaceTester_test_SRCS})
target_link_libraries(TestKoRgbU8ColorSpaceTester kritapigment KF5::I18n Qt5::Test)
########### next target ###############