[graphics/krita] /: Allow tests access to resources

Boudewijn Rempt null at kde.org
Wed Aug 5 16:32:04 BST 2020


Git commit dc7c3990980484331fec1c24fd833036ff80263c by Boudewijn Rempt.
Committed on 05/08/2020 at 15:24.
Pushed by rempt into branch 'master'.

Allow tests access to resources

There is a hierarchy of libraries built on the kritaresources library
that provide resources:

pigment: kocolorset, kosegmentgradient, kostopgradient, kopattern
  flake: koseexprscript, kogamutmask, kosvgsymbolcollection
    image: kispaintoppreset, kispsdlayerstyle
      brush: kisgbrbrush, kisimagepipebrush, kissvgbrush, kispngbrush
        ui: kiswindowloyout, kissession, kisworkspace

Depending on which library the test links again, it should use

testresources.h
testpigment.h
testflake.h
testimage.h
testbrush.h
testui.h

To get the right KISTEST_MAIN for the resources it needs access to.

This means that adding a new resource means not only adding it in
KisApplication, but also in kistest.h

CCMAIL:kimageshop at kde.org

M  +1    -1    benchmarks/kis_filter_selections_benchmark.cpp
M  +1    -1    libs/brush/tests/kis_gbr_brush_test.cpp
M  +1    -1    libs/brush/tests/kis_imagepipe_brush_test.cpp
M  +1    -1    libs/flake/tests/TestKoMarkerCollection.cpp
M  +1    -1    libs/flake/tests/TestKoShapeRegistry.cpp
M  +1    -1    libs/flake/tests/TestPointMergeCommand.cpp
M  +1    -1    libs/flake/tests/TestPointRemoveCommand.cpp
M  +1    -1    libs/flake/tests/TestShapePainting.cpp
M  +1    -1    libs/flake/tests/TestSnapStrategy.cpp
M  +1    -1    libs/image/tests/KisMaskGeneratorTest.cpp
M  +1    -1    libs/image/tests/KisWatershedWorkerTest.cpp
M  +1    -1    libs/image/tests/kis_adjustment_layer_test.cpp
M  +2    -1    libs/image/tests/kis_asl_layer_style_serializer_test.cpp
M  +2    -1    libs/image/tests/kis_asl_parser_test.cpp
M  +1    -1    libs/image/tests/kis_base_node_test.cpp
M  +1    -1    libs/image/tests/kis_cage_transform_worker_test.cpp
M  +1    -1    libs/image/tests/kis_clone_layer_test.cpp
M  +1    -1    libs/image/tests/kis_colorize_mask_test.cpp
M  +1    -1    libs/image/tests/kis_convolution_painter_test.cpp
M  +1    -1    libs/image/tests/kis_crop_processing_visitor_test.cpp
M  +2    -1    libs/image/tests/kis_cs_conversion_test.cpp
M  +1    -1    libs/image/tests/kis_fill_painter_test.cpp
M  +1    -1    libs/image/tests/kis_filter_mask_test.cpp
M  +1    -1    libs/image/tests/kis_filter_test.cpp
M  +2    -1    libs/image/tests/kis_fixed_paint_device_test.cpp
M  +1    -1    libs/image/tests/kis_gradient_painter_test.cpp
M  +1    -1    libs/image/tests/kis_group_layer_test.cpp
M  +1    -1    libs/image/tests/kis_histogram_test.cpp
M  +2    -1    libs/image/tests/kis_image_test.cpp
M  +1    -1    libs/image/tests/kis_iterator_test.cpp
M  +2    -2    libs/image/tests/kis_iterators_ng_test.cpp
M  +1    -1    libs/image/tests/kis_layer_style_filter_environment_test.cpp
M  +2    -1    libs/image/tests/kis_layer_style_projection_plane_test.cpp
M  +3    -1    libs/image/tests/kis_layer_styles_test.cpp
M  +3    -1    libs/image/tests/kis_lazy_brush_test.cpp
M  +1    -1    libs/image/tests/kis_liquify_transform_worker_test.cpp
M  +1    -1    libs/image/tests/kis_marker_painter_test.cpp
M  +1    -1    libs/image/tests/kis_mask_test.cpp
M  +1    -1    libs/image/tests/kis_node_facade_test.cpp
M  +1    -1    libs/image/tests/kis_node_graph_listener_test.cpp
M  +1    -1    libs/image/tests/kis_node_test.cpp
M  +1    -1    libs/image/tests/kis_onion_skin_compositor_test.cpp
M  +2    -2    libs/image/tests/kis_paint_device_test.cpp
M  +1    -1    libs/image/tests/kis_paint_layer_test.cpp
M  +2    -1    libs/image/tests/kis_painter_test.cpp
M  +1    -1    libs/image/tests/kis_perspective_transform_worker_test.cpp
M  +2    -1    libs/image/tests/kis_pixel_selection_test.cpp
M  +1    -1    libs/image/tests/kis_processing_applicator_test.cpp
M  +1    -1    libs/image/tests/kis_processings_test.cpp
M  +1    -1    libs/image/tests/kis_queues_progress_updater_test.cpp
M  +1    -1    libs/image/tests/kis_scanline_fill_test.cpp
M  +2    -2    libs/image/tests/kis_selection_test.cpp
M  +1    -1    libs/image/tests/kis_transform_mask_test.cpp
M  +1    -1    libs/image/tests/kis_transform_worker_test.cpp
M  +1    -1    libs/image/tests/kis_transparency_mask_test.cpp
M  +1    -1    libs/image/tests/kis_walkers_test.cpp
M  +1    -1    libs/image/tests/kis_warp_transform_worker_test.cpp
M  +1    -1    libs/libkis/tests/TestChannel.cpp
M  +1    -1    libs/libkis/tests/TestDocument.cpp
M  +1    -1    libs/libkis/tests/TestFilter.cpp
M  +3    -1    libs/libkis/tests/TestKrita.cpp
M  +3    -1    libs/libkis/tests/TestManagedColor.cpp
M  +3    -1    libs/libkis/tests/TestNode.cpp
M  +1    -1    libs/libkis/tests/TestNotifier.cpp
M  +1    -1    libs/pigment/tests/TestColorConversionSystem.cpp
M  +1    -1    libs/pigment/tests/TestKoColor.cpp
M  +1    -1    libs/pigment/tests/TestKoColorSpaceSanity.cpp
M  +1    -2    libs/resources/KisResourceTypes.h
M  +1    -2    libs/ui/KisApplication.cpp
M  +3    -1    libs/ui/KisSessionResource.h
M  +3    -1    libs/ui/KisWindowLayoutResource.h
M  +1    -1    libs/ui/tests/FreehandStrokeBenchmark.cpp
M  +1    -1    libs/ui/tests/KisDocumentReplaceTest.cpp
M  +3    -1    libs/ui/tests/KisManualUpdaterTest.cpp
M  +1    -1    libs/ui/tests/KisSpinBoxSplineUnitConverterTest.cpp
M  +1    -1    libs/ui/tests/fill_processing_visitor_test.cpp
M  +1    -1    libs/ui/tests/freehand_stroke_test.cpp
M  +1    -1    libs/ui/tests/kis_action_manager_test.cpp
M  +1    -1    libs/ui/tests/kis_animation_exporter_test.cpp
M  +2    -2    libs/ui/tests/kis_animation_importer_test.cpp
M  +1    -1    libs/ui/tests/kis_clipboard_test.cpp
M  +4    -30   libs/ui/tests/kis_derived_resources_test.cpp
M  +1    -1    libs/ui/tests/kis_doc2_test.cpp
M  +1    -1    libs/ui/tests/kis_exiv2_test.cpp
M  +1    -0    libs/ui/tests/kis_file_layer_test.cpp
M  +1    -1    libs/ui/tests/kis_multinode_property_test.cpp
M  +1    -1    libs/ui/tests/kis_node_juggler_compressed_test.h
M  +3    -0    libs/ui/tests/kis_node_manager_test.cpp
M  +2    -0    libs/ui/tests/kis_node_model_test.cpp
M  +3    -3    libs/ui/tests/kis_painting_assistants_decoration_test.cpp
M  +1    -1    libs/ui/tests/kis_selection_manager_test.cpp
M  +2    -1    libs/ui/tests/kis_shape_commands_test.cpp
M  +1    -0    libs/ui/tests/kis_shape_controller_test.cpp
M  +2    -1    libs/ui/tests/kis_shape_layer_test.cpp
M  +2    -2    libs/ui/tests/kis_shape_selection_test.cpp
M  +2    -2    libs/ui/tests/kis_zoom_and_pan_test.cpp
M  +1    -1    libs/ui/tests/node_shapes_utils.h
M  +1    -0    libs/widgetutils/tests/TestKoProgressUpdater.cpp
M  +1    -1    plugins/color/lcms2engine/tests/TestColorSpaceRegistry.cpp
M  +1    -1    plugins/color/lcms2engine/tests/TestLcmsRGBP2020PQColorSpace.cpp
M  +1    -1    plugins/dockers/animation/tests/timeline_model_test.cpp
M  +1    -1    plugins/filters/tests/kis_crash_filter_test.cpp
M  +1    -1    plugins/filters/unsharp/tests/kis_unsharp_mask_test.cpp
M  +1    -1    plugins/generators/screentone/tests/KisScreentoneGeneratorTest.cpp
M  +1    -1    plugins/generators/seexpr/tests/kis_seexpr_generator_test.cpp
M  +1    -1    plugins/impex/exr/tests/kis_exr_test.cpp
M  +1    -1    plugins/impex/heightmap/tests/kis_heightmap_test.cpp
M  +1    -1    plugins/impex/jpeg/tests/kis_jpeg_test.cpp
M  +2    -2    plugins/impex/libkra/tests/kis_kra_loader_test.cpp
M  +2    -2    plugins/impex/libkra/tests/kis_kra_saver_test.cpp
M  +1    -1    plugins/impex/png/tests/kis_png_test.cpp
M  +1    -1    plugins/impex/psd/tests/kis_psd_test.cpp
M  +1    -1    plugins/impex/svg/tests/kis_svg_test.cpp
D  +0    -0    plugins/impex/tga/tests/data/writeonlyFile.txt
M  +1    -1    plugins/impex/tiff/tests/kis_tiff_test.cpp
M  +1    -1    plugins/impex/xcf/tests/kis_xcf_test.cpp
M  +1    -1    plugins/paintops/libpaintop/tests/kis_embedded_pattern_manager_test.cpp
M  +1    -1    plugins/tools/tool_transform2/tests/test_animated_transform_parameters.cpp
A  +161  -0    sdk/tests/TestResources.h     [License: GPL (v2+)]
M  +2    -1    sdk/tests/filestest.h
M  +258  -3    sdk/tests/kistest.h
M  +1    -1    sdk/tests/qimage_based_test.h
M  +1    -1    sdk/tests/stroke_testing_utils.cpp
A  +2    -0    sdk/tests/testbrush.h  *
A  +2    -0    sdk/tests/testflake.h  *
A  +2    -0    sdk/tests/testimage.h  *
A  +2    -0    sdk/tests/testpigment.h  *
A  +2    -0    sdk/tests/testresources.h  *
A  +2    -0    sdk/tests/testui.h     [License: Trivial file]
M  +1    -1    sdk/tests/testutil.cpp
M  +0    -2    sdk/tests/testutil.h
M  +1    -1    sdk/tests/ui_manager_test.h

The files marked with a * at the end have a non valid license. Please read: https://community.kde.org/Policies/Licensing_Policy and use the headers which are listed at that page.


https://invent.kde.org/graphics/krita/commit/dc7c3990980484331fec1c24fd833036ff80263c

diff --git a/benchmarks/kis_filter_selections_benchmark.cpp b/benchmarks/kis_filter_selections_benchmark.cpp
index 6fd1e292b8..9440c77f49 100644
--- a/benchmarks/kis_filter_selections_benchmark.cpp
+++ b/benchmarks/kis_filter_selections_benchmark.cpp
@@ -21,7 +21,7 @@
 #include "kis_painter.h"
 
 #include <QTest>
-#include "testutil.h"
+#include <testutil.h>
 #include "kis_transaction.h"
 #include <KoCompositeOpRegistry.h>
 #include "kis_datamanager.h"
diff --git a/libs/brush/tests/kis_gbr_brush_test.cpp b/libs/brush/tests/kis_gbr_brush_test.cpp
index ec9ac7ba7f..ca5f209c31 100644
--- a/libs/brush/tests/kis_gbr_brush_test.cpp
+++ b/libs/brush/tests/kis_gbr_brush_test.cpp
@@ -24,7 +24,7 @@
 #include <KoColor.h>
 #include <KoColorSpace.h>
 #include <KoColorSpaceRegistry.h>
-#include "testutil.h"
+#include <testutil.h>
 #include "../kis_gbr_brush.h"
 #include "kis_types.h"
 #include "kis_paint_device.h"
diff --git a/libs/brush/tests/kis_imagepipe_brush_test.cpp b/libs/brush/tests/kis_imagepipe_brush_test.cpp
index ec6dbdaa85..f9c66693b7 100644
--- a/libs/brush/tests/kis_imagepipe_brush_test.cpp
+++ b/libs/brush/tests/kis_imagepipe_brush_test.cpp
@@ -18,7 +18,7 @@
 
 #include "kis_imagepipe_brush_test.h"
 
-#include <sdk/tests/kistest.h>
+#include <sdk/tests/testbrush.h>
 #include <QTest>
 #include <QPainter>
 
diff --git a/libs/flake/tests/TestKoMarkerCollection.cpp b/libs/flake/tests/TestKoMarkerCollection.cpp
index ac9f570151..6ae0f5243b 100644
--- a/libs/flake/tests/TestKoMarkerCollection.cpp
+++ b/libs/flake/tests/TestKoMarkerCollection.cpp
@@ -29,7 +29,7 @@
 
 #include "kis_debug.h"
 #include "../../sdk/tests/qimage_test_util.h"
-#include <sdk/tests/kistest.h>
+#include <sdk/tests/testflake.h>
 
 #include <cmath>
 
diff --git a/libs/flake/tests/TestKoShapeRegistry.cpp b/libs/flake/tests/TestKoShapeRegistry.cpp
index 316beb0037..04d1d3b6be 100644
--- a/libs/flake/tests/TestKoShapeRegistry.cpp
+++ b/libs/flake/tests/TestKoShapeRegistry.cpp
@@ -35,7 +35,7 @@
 
 #include <FlakeDebug.h>
 #include "kis_debug.h"
-#include <sdk/tests/kistest.h>
+#include <sdk/tests/testflake.h>
 
 void TestKoShapeRegistry::testGetKoShapeRegistryInstance()
 {
diff --git a/libs/flake/tests/TestPointMergeCommand.cpp b/libs/flake/tests/TestPointMergeCommand.cpp
index 54d60c9c01..92f50e2354 100644
--- a/libs/flake/tests/TestPointMergeCommand.cpp
+++ b/libs/flake/tests/TestPointMergeCommand.cpp
@@ -22,7 +22,7 @@
 #include "KoPathShape.h"
 #include "KoPathPoint.h"
 #include "KoPathPointData.h"
-#include <sdk/tests/kistest.h>
+#include <sdk/tests/testflake.h>
 #include <QPainterPath>
 #include <QTest>
 #include <FlakeDebug.h>
diff --git a/libs/flake/tests/TestPointRemoveCommand.cpp b/libs/flake/tests/TestPointRemoveCommand.cpp
index 207dfd3f0e..ee7cd692d1 100644
--- a/libs/flake/tests/TestPointRemoveCommand.cpp
+++ b/libs/flake/tests/TestPointRemoveCommand.cpp
@@ -23,7 +23,7 @@
 #include "KoPathPointRemoveCommand.h"
 #include "KoShapeController.h"
 #include <MockShapes.h>
-#include <sdk/tests/kistest.h>
+#include <sdk/tests/testflake.h>
 #include <QTest>
 
 void TestPointRemoveCommand::redoUndoPointRemove()
diff --git a/libs/flake/tests/TestShapePainting.cpp b/libs/flake/tests/TestShapePainting.cpp
index 284cc2a1d4..f83adf6b19 100644
--- a/libs/flake/tests/TestShapePainting.cpp
+++ b/libs/flake/tests/TestShapePainting.cpp
@@ -24,7 +24,7 @@
 #include "KoShapeContainer.h"
 #include "KoShapeManager.h"
 #include "KoShapePaintingContext.h"
-#include <sdk/tests/kistest.h>
+#include <sdk/tests/testflake.h>
 #include <MockShapes.h>
 
 #include <QTest>
diff --git a/libs/flake/tests/TestSnapStrategy.cpp b/libs/flake/tests/TestSnapStrategy.cpp
index 70342dc9bc..a03c943ce7 100644
--- a/libs/flake/tests/TestSnapStrategy.cpp
+++ b/libs/flake/tests/TestSnapStrategy.cpp
@@ -27,7 +27,7 @@
 #include "MockShapes.h"
 #include "KoPathPoint.h"
 #include "KoViewConverter.h"
-#include <sdk/tests/kistest.h>
+#include <sdk/tests/testflake.h>
 //#include <PointProperties.h>
 #include <KoSnapData.h>
 
diff --git a/libs/image/tests/KisMaskGeneratorTest.cpp b/libs/image/tests/KisMaskGeneratorTest.cpp
index 74967ce7c5..01a883d2ab 100644
--- a/libs/image/tests/KisMaskGeneratorTest.cpp
+++ b/libs/image/tests/KisMaskGeneratorTest.cpp
@@ -30,7 +30,7 @@
 #include "kis_cubic_curve.h"
 #include "krita_utils.h"
 
-#include "testutil.h"
+#include <testutil.h>
 
 class KisMaskGeneratorTestTester
 {
diff --git a/libs/image/tests/KisWatershedWorkerTest.cpp b/libs/image/tests/KisWatershedWorkerTest.cpp
index a952a28713..2336271200 100644
--- a/libs/image/tests/KisWatershedWorkerTest.cpp
+++ b/libs/image/tests/KisWatershedWorkerTest.cpp
@@ -29,7 +29,7 @@
 #include "krita_utils.h"
 
 #include "lazybrush/kis_lazy_fill_tools.h"
-#include "testutil.h"
+#include <testutil.h>
 
 
 #include <lazybrush/KisWatershedWorker.h>
diff --git a/libs/image/tests/kis_adjustment_layer_test.cpp b/libs/image/tests/kis_adjustment_layer_test.cpp
index 92fd9eea4a..1af4eb6a3d 100644
--- a/libs/image/tests/kis_adjustment_layer_test.cpp
+++ b/libs/image/tests/kis_adjustment_layer_test.cpp
@@ -33,7 +33,7 @@
 #include "kis_types.h"
 #include "kis_datamanager.h"
 #include "kis_pixel_selection.h"
-#include "testutil.h"
+#include <testutil.h>
 #include <KisGlobalResourcesInterface.h>
 
 void KisAdjustmentLayerTest::testCreation()
diff --git a/libs/image/tests/kis_asl_layer_style_serializer_test.cpp b/libs/image/tests/kis_asl_layer_style_serializer_test.cpp
index 29ac924fb5..60102c8258 100644
--- a/libs/image/tests/kis_asl_layer_style_serializer_test.cpp
+++ b/libs/image/tests/kis_asl_layer_style_serializer_test.cpp
@@ -30,7 +30,8 @@
 
 #include "kis_global.h"
 
-#include "testutil.h"
+#include <testutil.h>
+#include <testimage.h>
 #include "kis_psd_layer_style.h"
 #include "kis_asl_layer_style_serializer.h"
 #include <asl/kis_asl_reader.h>
diff --git a/libs/image/tests/kis_asl_parser_test.cpp b/libs/image/tests/kis_asl_parser_test.cpp
index 5330172b4e..49327d8276 100644
--- a/libs/image/tests/kis_asl_parser_test.cpp
+++ b/libs/image/tests/kis_asl_parser_test.cpp
@@ -20,7 +20,8 @@
 
 #include <QTest>
 
-#include "testutil.h"
+#include <testutil.h>
+#include "testimage.h"
 
 #include <QDomDocument>
 
diff --git a/libs/image/tests/kis_base_node_test.cpp b/libs/image/tests/kis_base_node_test.cpp
index 6ee8479963..e1a8539ac5 100644
--- a/libs/image/tests/kis_base_node_test.cpp
+++ b/libs/image/tests/kis_base_node_test.cpp
@@ -23,7 +23,7 @@
 #include "kis_global.h"
 #include "kis_base_node.h"
 #include "kis_paint_device.h"
-#include "testutil.h"
+#include <testutil.h>
 #include "kis_scalar_keyframe_channel.h"
 #include "KoColor.h"
 #include "kis_image_animation_interface.h"
diff --git a/libs/image/tests/kis_cage_transform_worker_test.cpp b/libs/image/tests/kis_cage_transform_worker_test.cpp
index a00dda8c2c..97d5e9192f 100644
--- a/libs/image/tests/kis_cage_transform_worker_test.cpp
+++ b/libs/image/tests/kis_cage_transform_worker_test.cpp
@@ -23,7 +23,7 @@
 #include <KoProgressUpdater.h>
 #include <KoUpdater.h>
 
-#include "testutil.h"
+#include <testutil.h>
 
 #include <kis_cage_transform_worker.h>
 #include <algorithm>
diff --git a/libs/image/tests/kis_clone_layer_test.cpp b/libs/image/tests/kis_clone_layer_test.cpp
index cdfb4f5760..bf4be61f49 100644
--- a/libs/image/tests/kis_clone_layer_test.cpp
+++ b/libs/image/tests/kis_clone_layer_test.cpp
@@ -30,7 +30,7 @@
 #include "kis_clone_layer.h"
 #include "kis_image.h"
 
-#include "testutil.h"
+#include <testutil.h>
 
 
 void KisCloneLayerTest::testCreation()
diff --git a/libs/image/tests/kis_colorize_mask_test.cpp b/libs/image/tests/kis_colorize_mask_test.cpp
index 07f2990215..512be91fff 100644
--- a/libs/image/tests/kis_colorize_mask_test.cpp
+++ b/libs/image/tests/kis_colorize_mask_test.cpp
@@ -20,7 +20,7 @@
 
 #include <QTest>
 
-#include "testutil.h"
+#include <testutil.h>
 #include "lazybrush/kis_colorize_mask.h"
 #include "kis_paint_device_debug_utils.h"
 #include "kis_global.h"
diff --git a/libs/image/tests/kis_convolution_painter_test.cpp b/libs/image/tests/kis_convolution_painter_test.cpp
index 8570506798..67e631e2c6 100644
--- a/libs/image/tests/kis_convolution_painter_test.cpp
+++ b/libs/image/tests/kis_convolution_painter_test.cpp
@@ -34,7 +34,7 @@
 #include "kis_convolution_kernel.h"
 #include <kis_gaussian_kernel.h>
 #include <kis_mask_generator.h>
-#include "testutil.h"
+#include <testutil.h>
 
 KisPaintDeviceSP initAsymTestDevice(QRect &imageRect, int &pixelSize, QByteArray &initialData)
 {
diff --git a/libs/image/tests/kis_crop_processing_visitor_test.cpp b/libs/image/tests/kis_crop_processing_visitor_test.cpp
index c37cca58da..7421463c85 100644
--- a/libs/image/tests/kis_crop_processing_visitor_test.cpp
+++ b/libs/image/tests/kis_crop_processing_visitor_test.cpp
@@ -26,7 +26,7 @@
 #include "kis_paint_device.h"
 #include "kis_fill_painter.h"
 #include "kis_transparency_mask.h"
-#include "testutil.h"
+#include <testutil.h>
 #include "kis_surrogate_undo_adapter.h"
 #include "kis_image.h"
 #include "kis_pixel_selection.h"
diff --git a/libs/image/tests/kis_cs_conversion_test.cpp b/libs/image/tests/kis_cs_conversion_test.cpp
index 0198a3f7df..1651305c10 100644
--- a/libs/image/tests/kis_cs_conversion_test.cpp
+++ b/libs/image/tests/kis_cs_conversion_test.cpp
@@ -32,7 +32,8 @@
 #include "kis_selection.h"
 #include "kis_datamanager.h"
 #include "kis_global.h"
-#include "testutil.h"
+#include <testutil.h>
+#include "testimage.h"
 #include "kis_transaction.h"
 #include "kis_image.h"
 #include "testing_timed_default_bounds.h"
diff --git a/libs/image/tests/kis_fill_painter_test.cpp b/libs/image/tests/kis_fill_painter_test.cpp
index 577ba562aa..4280ddef91 100644
--- a/libs/image/tests/kis_fill_painter_test.cpp
+++ b/libs/image/tests/kis_fill_painter_test.cpp
@@ -18,7 +18,7 @@
 
 #include "kis_fill_painter_test.h"
 
-#include "testutil.h"
+#include <testutil.h>
 
 #include <QTest>
 #include "kis_fill_painter.h"
diff --git a/libs/image/tests/kis_filter_mask_test.cpp b/libs/image/tests/kis_filter_mask_test.cpp
index a80beb10eb..4436c86774 100644
--- a/libs/image/tests/kis_filter_mask_test.cpp
+++ b/libs/image/tests/kis_filter_mask_test.cpp
@@ -34,7 +34,7 @@
 #include <KisGlobalResourcesInterface.h>
 
 
-#include "testutil.h"
+#include <testutil.h>
 
 #define IMAGE_WIDTH 1000
 #define IMAGE_HEIGHT 1000
diff --git a/libs/image/tests/kis_filter_test.cpp b/libs/image/tests/kis_filter_test.cpp
index 001c74f05c..839a066f03 100644
--- a/libs/image/tests/kis_filter_test.cpp
+++ b/libs/image/tests/kis_filter_test.cpp
@@ -24,7 +24,7 @@
 #include "kis_selection.h"
 #include "kis_processing_information.h"
 #include "filter/kis_filter.h"
-#include "testutil.h"
+#include <testutil.h>
 #include "kis_pixel_selection.h"
 #include <KisGlobalResourcesInterface.h>
 
diff --git a/libs/image/tests/kis_fixed_paint_device_test.cpp b/libs/image/tests/kis_fixed_paint_device_test.cpp
index d6966aca79..4600a23097 100644
--- a/libs/image/tests/kis_fixed_paint_device_test.cpp
+++ b/libs/image/tests/kis_fixed_paint_device_test.cpp
@@ -34,7 +34,8 @@
 #include "kis_selection.h"
 #include "kis_datamanager.h"
 #include "kis_global.h"
-#include "testutil.h"
+#include <testutil.h>
+#include <testimage.h>
 #include "kis_transaction.h"
 #include "kis_image.h"
 
diff --git a/libs/image/tests/kis_gradient_painter_test.cpp b/libs/image/tests/kis_gradient_painter_test.cpp
index 7bf6b9a1a8..2647e505a3 100644
--- a/libs/image/tests/kis_gradient_painter_test.cpp
+++ b/libs/image/tests/kis_gradient_painter_test.cpp
@@ -32,7 +32,7 @@
 #include <resources/KoStopGradient.h>
 
 #include "krita_utils.h"
-#include "testutil.h"
+#include <testutil.h>
 
 
 void KisGradientPainterTest::testSimplifyPath()
diff --git a/libs/image/tests/kis_group_layer_test.cpp b/libs/image/tests/kis_group_layer_test.cpp
index 5c04bcac1e..94bd6ce134 100644
--- a/libs/image/tests/kis_group_layer_test.cpp
+++ b/libs/image/tests/kis_group_layer_test.cpp
@@ -19,7 +19,7 @@
 #include "kis_group_layer_test.h"
 #include <QTest>
 
-#include "testutil.h"
+#include <testutil.h>
 
 #include <KoColor.h>
 
diff --git a/libs/image/tests/kis_histogram_test.cpp b/libs/image/tests/kis_histogram_test.cpp
index e71f09d1ff..fc39912225 100644
--- a/libs/image/tests/kis_histogram_test.cpp
+++ b/libs/image/tests/kis_histogram_test.cpp
@@ -26,7 +26,7 @@
 #include "kis_histogram.h"
 #include "kis_paint_layer.h"
 #include "kis_types.h"
-#include "kistest.h"
+#include "testimage.h"
 
 void KisHistogramTest::testCreation()
 {
diff --git a/libs/image/tests/kis_image_test.cpp b/libs/image/tests/kis_image_test.cpp
index 16510eb3a1..2c126defda 100644
--- a/libs/image/tests/kis_image_test.cpp
+++ b/libs/image/tests/kis_image_test.cpp
@@ -44,6 +44,7 @@
 
 #include "kis_undo_stores.h"
 
+#include <testimage.h>
 
 #define IMAGE_WIDTH 128
 #define IMAGE_HEIGHT 128
@@ -81,7 +82,7 @@ void KisImageTest::benchmarkCreation()
     }
 }
 
-#include "testutil.h"
+#include <testutil.h>
 #include "kis_stroke_strategy.h"
 #include <functional>
 
diff --git a/libs/image/tests/kis_iterator_test.cpp b/libs/image/tests/kis_iterator_test.cpp
index 8d4dc95340..bef7622566 100644
--- a/libs/image/tests/kis_iterator_test.cpp
+++ b/libs/image/tests/kis_iterator_test.cpp
@@ -32,7 +32,7 @@
 #include "kis_paint_device.h"
 #include <kis_repeat_iterators_pixel.h>
 
-#include "sdk/tests/kistest.h"
+#include "sdk/tests/testimage.h"
 
 void KisIteratorTest::allCsApplicator(void (KisIteratorTest::* funcPtr)(const KoColorSpace*cs))
 {
diff --git a/libs/image/tests/kis_iterators_ng_test.cpp b/libs/image/tests/kis_iterators_ng_test.cpp
index 02582e304f..8464a668c9 100644
--- a/libs/image/tests/kis_iterators_ng_test.cpp
+++ b/libs/image/tests/kis_iterators_ng_test.cpp
@@ -32,8 +32,8 @@
 #include "kis_paint_device.h"
 #include <kis_iterator_ng.h>
 #include "kis_global.h"
-#include "testutil.h"
-
+#include <testutil.h>
+#include <testimage.h>
 
 void KisIteratorNGTest::allCsApplicator(void (KisIteratorNGTest::* funcPtr)(const KoColorSpace*cs))
 {
diff --git a/libs/image/tests/kis_layer_style_filter_environment_test.cpp b/libs/image/tests/kis_layer_style_filter_environment_test.cpp
index 7b19dd4624..f6ec790a24 100644
--- a/libs/image/tests/kis_layer_style_filter_environment_test.cpp
+++ b/libs/image/tests/kis_layer_style_filter_environment_test.cpp
@@ -20,7 +20,7 @@
 
 #include "layerstyles/kis_layer_style_filter_environment.h"
 #include "kis_pixel_selection.h"
-#include "testutil.h"
+#include <testutil.h>
 
 
 #include <QTest>
diff --git a/libs/image/tests/kis_layer_style_projection_plane_test.cpp b/libs/image/tests/kis_layer_style_projection_plane_test.cpp
index 8a454cf38d..26f7a831a4 100644
--- a/libs/image/tests/kis_layer_style_projection_plane_test.cpp
+++ b/libs/image/tests/kis_layer_style_projection_plane_test.cpp
@@ -20,7 +20,8 @@
 
 #include <QTest>
 
-#include "testutil.h"
+#include <testutil.h>
+#include <testimage.h>
 
 #include <KoColor.h>
 #include <KoColorSpace.h>
diff --git a/libs/image/tests/kis_layer_styles_test.cpp b/libs/image/tests/kis_layer_styles_test.cpp
index 3fa3159936..264fbf2a4c 100644
--- a/libs/image/tests/kis_layer_styles_test.cpp
+++ b/libs/image/tests/kis_layer_styles_test.cpp
@@ -21,7 +21,6 @@
 #include <QTest>
 
 #include "kis_transaction.h"
-#include "testutil.h"
 
 #include <KoColor.h>
 
@@ -33,6 +32,9 @@
 #include "layerstyles/kis_multiple_projection.h"
 #include "layerstyles/KisLayerStyleKnockoutBlower.h"
 
+#include <testutil.h>
+#include "testimage.h"
+
 
 struct TestConfig {
     TestConfig()
diff --git a/libs/image/tests/kis_lazy_brush_test.cpp b/libs/image/tests/kis_lazy_brush_test.cpp
index 96316de0e9..72ac6aa353 100644
--- a/libs/image/tests/kis_lazy_brush_test.cpp
+++ b/libs/image/tests/kis_lazy_brush_test.cpp
@@ -36,6 +36,8 @@
 
 #include "lazybrush/kis_lazy_fill_graph.h"
 
+
+
 #if 0
 
 int
@@ -962,7 +964,7 @@ void KisLazyBrushTest::testCutOnGraph()
 
 #include "lazybrush/kis_lazy_fill_capacity_map.h"
 #include <KoColorSpaceRegistry.h>
-#include "testutil.h"
+#include <testutil.h>
 #include <KoColor.h>
 
 
diff --git a/libs/image/tests/kis_liquify_transform_worker_test.cpp b/libs/image/tests/kis_liquify_transform_worker_test.cpp
index 89c7ee9110..3aa62b8258 100644
--- a/libs/image/tests/kis_liquify_transform_worker_test.cpp
+++ b/libs/image/tests/kis_liquify_transform_worker_test.cpp
@@ -24,7 +24,7 @@
 #include <KoProgressUpdater.h>
 #include <KoUpdater.h>
 
-#include "testutil.h"
+#include <testutil.h>
 #include <kis_liquify_transform_worker.h>
 #include <kis_algebra_2d.h>
 
diff --git a/libs/image/tests/kis_marker_painter_test.cpp b/libs/image/tests/kis_marker_painter_test.cpp
index 70ee711c6e..1b5e92b9d7 100644
--- a/libs/image/tests/kis_marker_painter_test.cpp
+++ b/libs/image/tests/kis_marker_painter_test.cpp
@@ -29,7 +29,7 @@
 #include "kis_marker_painter.h"
 
 #include "kis_algebra_2d.h"
-#include "testutil.h"
+#include <testutil.h>
 
 
 void KisMarkerPainterTest::testFillHalfBrushDiff()
diff --git a/libs/image/tests/kis_mask_test.cpp b/libs/image/tests/kis_mask_test.cpp
index af1065fda2..67f6737e3e 100644
--- a/libs/image/tests/kis_mask_test.cpp
+++ b/libs/image/tests/kis_mask_test.cpp
@@ -27,7 +27,7 @@
 #include "kis_selection.h"
 #include "kis_image.h"
 #include "kis_group_layer.h"
-#include "testutil.h"
+#include <testutil.h>
 
 
 class TestMask : public KisMask
diff --git a/libs/image/tests/kis_node_facade_test.cpp b/libs/image/tests/kis_node_facade_test.cpp
index c4f9351033..61cfa09f4f 100644
--- a/libs/image/tests/kis_node_facade_test.cpp
+++ b/libs/image/tests/kis_node_facade_test.cpp
@@ -24,7 +24,7 @@
 #include "kis_node_facade.h"
 #include "kis_types.h"
 #include "kis_global.h"
-#include "testutil.h"
+#include <testutil.h>
 
 void KisNodeFacadeTest::testCreation()
 {
diff --git a/libs/image/tests/kis_node_graph_listener_test.cpp b/libs/image/tests/kis_node_graph_listener_test.cpp
index 9fe442f0ca..74c2e1a736 100644
--- a/libs/image/tests/kis_node_graph_listener_test.cpp
+++ b/libs/image/tests/kis_node_graph_listener_test.cpp
@@ -21,7 +21,7 @@
 #include <QTest>
 #include "kis_node_graph_listener.h"
 #include "kis_node_facade.h"
-#include "testutil.h"
+#include <testutil.h>
 
 void KisNodeGraphListenerTest::testUpdateOfListener()
 {
diff --git a/libs/image/tests/kis_node_test.cpp b/libs/image/tests/kis_node_test.cpp
index c7e431ad74..64589e9977 100644
--- a/libs/image/tests/kis_node_test.cpp
+++ b/libs/image/tests/kis_node_test.cpp
@@ -23,7 +23,7 @@
 #include "kis_global.h"
 #include "kis_node_graph_listener.h"
 #include <KoProperties.h>
-#include "testutil.h"
+#include <testutil.h>
 
 
 void KisNodeTest::testCreation()
diff --git a/libs/image/tests/kis_onion_skin_compositor_test.cpp b/libs/image/tests/kis_onion_skin_compositor_test.cpp
index d409c0fb19..90d1b453a9 100644
--- a/libs/image/tests/kis_onion_skin_compositor_test.cpp
+++ b/libs/image/tests/kis_onion_skin_compositor_test.cpp
@@ -24,7 +24,7 @@
 #include "kis_paint_device.h"
 #include "kis_raster_keyframe_channel.h"
 #include "kis_image_animation_interface.h"
-#include "testutil.h"
+#include <testutil.h>
 #include "KoColor.h"
 #include "kis_image_config.h"
 
diff --git a/libs/image/tests/kis_paint_device_test.cpp b/libs/image/tests/kis_paint_device_test.cpp
index d27459b625..92a283c3f9 100644
--- a/libs/image/tests/kis_paint_device_test.cpp
+++ b/libs/image/tests/kis_paint_device_test.cpp
@@ -35,11 +35,11 @@
 #include "kis_selection.h"
 #include "kis_datamanager.h"
 #include "kis_global.h"
-#include "testutil.h"
+#include <testutil.h>
 #include "kis_transaction.h"
 #include "kis_image.h"
 #include "config-limit-long-tests.h"
-#include "kistest.h"
+#include "testimage.h"
 
 
 class KisFakePaintDeviceWriter : public KisPaintDeviceWriter {
diff --git a/libs/image/tests/kis_paint_layer_test.cpp b/libs/image/tests/kis_paint_layer_test.cpp
index dabbcd810f..accb1c9732 100644
--- a/libs/image/tests/kis_paint_layer_test.cpp
+++ b/libs/image/tests/kis_paint_layer_test.cpp
@@ -32,7 +32,7 @@
 #include "kis_image.h"
 #include "kis_paint_device.h"
 #include "kis_transparency_mask.h"
-#include "testutil.h"
+#include <testutil.h>
 #include "kis_selection.h"
 #include "kis_fill_painter.h"
 #include "kis_pixel_selection.h"
diff --git a/libs/image/tests/kis_painter_test.cpp b/libs/image/tests/kis_painter_test.cpp
index 28c5ebfddd..0d84159499 100644
--- a/libs/image/tests/kis_painter_test.cpp
+++ b/libs/image/tests/kis_painter_test.cpp
@@ -36,8 +36,9 @@
 #include "kis_pixel_selection.h"
 #include "kis_fill_painter.h"
 #include <kis_fixed_paint_device.h>
-#include "testutil.h"
+#include <testutil.h>
 #include <kis_iterator_ng.h>
+#include <testimage.h>
 
 void KisPainterTest::allCsApplicator(void (KisPainterTest::* funcPtr)(const KoColorSpace*cs))
 {
diff --git a/libs/image/tests/kis_perspective_transform_worker_test.cpp b/libs/image/tests/kis_perspective_transform_worker_test.cpp
index 505c98fa0d..1fba6a2fad 100644
--- a/libs/image/tests/kis_perspective_transform_worker_test.cpp
+++ b/libs/image/tests/kis_perspective_transform_worker_test.cpp
@@ -20,7 +20,7 @@
 
 #include <QTest>
 
-#include "testutil.h"
+#include <testutil.h>
 
 #define USE_DOCUMENT 0
 #include "qimage_based_test.h"
diff --git a/libs/image/tests/kis_pixel_selection_test.cpp b/libs/image/tests/kis_pixel_selection_test.cpp
index fcf0a8865d..71b5995ef1 100644
--- a/libs/image/tests/kis_pixel_selection_test.cpp
+++ b/libs/image/tests/kis_pixel_selection_test.cpp
@@ -31,7 +31,8 @@
 #include "kis_paint_device.h"
 #include "kis_fixed_paint_device.h"
 #include "kis_pixel_selection.h"
-#include "testutil.h"
+#include <testutil.h>
+#include <testimage.h>
 #include "kis_fill_painter.h"
 #include "kis_transaction.h"
 #include "kis_surrogate_undo_adapter.h"
diff --git a/libs/image/tests/kis_processing_applicator_test.cpp b/libs/image/tests/kis_processing_applicator_test.cpp
index fe312ed593..541499921b 100644
--- a/libs/image/tests/kis_processing_applicator_test.cpp
+++ b/libs/image/tests/kis_processing_applicator_test.cpp
@@ -31,7 +31,7 @@
 #include "processing/kis_crop_processing_visitor.h"
 #include "kis_image.h"
 
-#include "testutil.h"
+#include <testutil.h>
 
 /*
   +----------+
diff --git a/libs/image/tests/kis_processings_test.cpp b/libs/image/tests/kis_processings_test.cpp
index d9c9d15f1a..f7b4345cd3 100644
--- a/libs/image/tests/kis_processings_test.cpp
+++ b/libs/image/tests/kis_processings_test.cpp
@@ -24,7 +24,7 @@
 #include "kis_processing_applicator.h"
 #include "processing/kis_crop_processing_visitor.h"
 
-#include "testutil.h"
+#include <testutil.h>
 
 #define USE_DOCUMENT 0
 #include "qimage_based_test.h"
diff --git a/libs/image/tests/kis_queues_progress_updater_test.cpp b/libs/image/tests/kis_queues_progress_updater_test.cpp
index 0e949316fa..6033dcb49f 100644
--- a/libs/image/tests/kis_queues_progress_updater_test.cpp
+++ b/libs/image/tests/kis_queues_progress_updater_test.cpp
@@ -21,7 +21,7 @@
 #include <QTest>
 
 #include "kis_queues_progress_updater.h"
-#include "testutil.h"
+#include <testutil.h>
 
 
 void KisQueuesProgressUpdaterTest::testSlowProgress()
diff --git a/libs/image/tests/kis_scanline_fill_test.cpp b/libs/image/tests/kis_scanline_fill_test.cpp
index 33a3ad4ac6..45dad95bc1 100644
--- a/libs/image/tests/kis_scanline_fill_test.cpp
+++ b/libs/image/tests/kis_scanline_fill_test.cpp
@@ -18,7 +18,7 @@
 
 #include "kis_scanline_fill_test.h"
 
-#include "testutil.h"
+#include <testutil.h>
 
 #include <QTest>
 #include <floodfill/kis_scanline_fill.h>
diff --git a/libs/image/tests/kis_selection_test.cpp b/libs/image/tests/kis_selection_test.cpp
index 83f43e7214..40268c8555 100644
--- a/libs/image/tests/kis_selection_test.cpp
+++ b/libs/image/tests/kis_selection_test.cpp
@@ -34,8 +34,8 @@
 #include "kis_mask.h"
 #include "kis_image.h"
 #include "kis_transparency_mask.h"
-#include "testutil.h"
-
+#include <testutil.h>
+#include "testimage.h"
 #include <KoColorModelStandardIds.h>
 
 void KisSelectionTest::testGrayColorspaceConversion()
diff --git a/libs/image/tests/kis_transform_mask_test.cpp b/libs/image/tests/kis_transform_mask_test.cpp
index 02fb11aa55..32372a68e2 100644
--- a/libs/image/tests/kis_transform_mask_test.cpp
+++ b/libs/image/tests/kis_transform_mask_test.cpp
@@ -26,7 +26,7 @@
 #include "kis_transform_mask.h"
 #include "kis_transform_mask_params_interface.h"
 
-#include "testutil.h"
+#include <testutil.h>
 
 #include "kis_algebra_2d.h"
 #include "kis_safe_transform.h"
diff --git a/libs/image/tests/kis_transform_worker_test.cpp b/libs/image/tests/kis_transform_worker_test.cpp
index ee5c356ecf..e3db881181 100644
--- a/libs/image/tests/kis_transform_worker_test.cpp
+++ b/libs/image/tests/kis_transform_worker_test.cpp
@@ -31,7 +31,7 @@
 #include "kis_filter_strategy.h"
 #include "kis_paint_device.h"
 #include "kis_transform_worker.h"
-#include "testutil.h"
+#include <testutil.h>
 #include "kis_transaction.h"
 #include "kis_random_accessor_ng.h"
 
diff --git a/libs/image/tests/kis_transparency_mask_test.cpp b/libs/image/tests/kis_transparency_mask_test.cpp
index 2139c07e52..0a4f0879d0 100644
--- a/libs/image/tests/kis_transparency_mask_test.cpp
+++ b/libs/image/tests/kis_transparency_mask_test.cpp
@@ -23,7 +23,7 @@
 #include "kis_paint_layer.h"
 #include "kis_image.h"
 #include "kis_fill_painter.h"
-#include "testutil.h"
+#include <testutil.h>
 #include "kis_selection.h"
 #include "kis_pixel_selection.h"
 #define IMAGE_WIDTH 1000
diff --git a/libs/image/tests/kis_walkers_test.cpp b/libs/image/tests/kis_walkers_test.cpp
index 4d9f36df61..8b461976ee 100644
--- a/libs/image/tests/kis_walkers_test.cpp
+++ b/libs/image/tests/kis_walkers_test.cpp
@@ -37,7 +37,7 @@
 #include "filter/kis_filter_registry.h"
 #include "kis_filter_mask.h"
 #include "kis_transparency_mask.h"
-#include <sdk/tests/kistest.h>
+#include <sdk/tests/testimage.h>
 
 //#define DEBUG_VISITORS
 
diff --git a/libs/image/tests/kis_warp_transform_worker_test.cpp b/libs/image/tests/kis_warp_transform_worker_test.cpp
index 94a57da1e6..cec905065b 100644
--- a/libs/image/tests/kis_warp_transform_worker_test.cpp
+++ b/libs/image/tests/kis_warp_transform_worker_test.cpp
@@ -19,7 +19,7 @@
 #include "kis_warp_transform_worker_test.h"
 
 #include <QTest>
-#include "testutil.h"
+#include <testutil.h>
 
 #include "kis_warptransform_worker.h"
 
diff --git a/libs/libkis/tests/TestChannel.cpp b/libs/libkis/tests/TestChannel.cpp
index dd0d31779e..77b318dc92 100644
--- a/libs/libkis/tests/TestChannel.cpp
+++ b/libs/libkis/tests/TestChannel.cpp
@@ -33,7 +33,7 @@
 #include <kis_image.h>
 #include <kis_fill_painter.h>
 #include <kis_paint_layer.h>
-#include "sdk/tests/kistest.h"
+#include "sdk/tests/testui.h"
 
 
 void TestChannel::testPixelDataU8()
diff --git a/libs/libkis/tests/TestDocument.cpp b/libs/libkis/tests/TestDocument.cpp
index c2210aa503..772c6f87b7 100644
--- a/libs/libkis/tests/TestDocument.cpp
+++ b/libs/libkis/tests/TestDocument.cpp
@@ -37,7 +37,7 @@
 #include <kis_paint_layer.h>
 #include <KisPart.h>
 
-#include <sdk/tests/kistest.h>
+#include <sdk/tests/testui.h>
 
 void TestDocument::testSetColorSpace()
 {
diff --git a/libs/libkis/tests/TestFilter.cpp b/libs/libkis/tests/TestFilter.cpp
index 016bcf6267..97b166bcfd 100644
--- a/libs/libkis/tests/TestFilter.cpp
+++ b/libs/libkis/tests/TestFilter.cpp
@@ -37,7 +37,7 @@
 #include <kis_paint_layer.h>
 #include <KisPart.h>
 
-#include  <sdk/tests/kistest.h>
+#include  <sdk/tests/testui.h>
 
 void TestFilter::testApply()
 {
diff --git a/libs/libkis/tests/TestKrita.cpp b/libs/libkis/tests/TestKrita.cpp
index cd986c4fc4..0ddbf37b54 100644
--- a/libs/libkis/tests/TestKrita.cpp
+++ b/libs/libkis/tests/TestKrita.cpp
@@ -23,6 +23,8 @@
 #include <Window.h>
 #include <Document.h>
 
+#include <sdk/tests/testui.h>
+
 void TestKrita::initTestCase()
 {
     Krita::instance();
@@ -60,5 +62,5 @@ void TestKrita::cleanupTestCase()
 }
 
 
-QTEST_MAIN(TestKrita)
+KISTEST_MAIN(TestKrita)
 
diff --git a/libs/libkis/tests/TestManagedColor.cpp b/libs/libkis/tests/TestManagedColor.cpp
index bd2efa2705..be3c2e31a1 100644
--- a/libs/libkis/tests/TestManagedColor.cpp
+++ b/libs/libkis/tests/TestManagedColor.cpp
@@ -27,7 +27,9 @@
 #include <KoColorProfile.h>
 #include <KoColor.h>
 
-QTEST_MAIN(TestManagedColor)
+#include <sdk/tests/testui.h>
+
+KISTEST_MAIN(TestManagedColor)
 
 void TestManagedColor::testOperatorIs()
 {
diff --git a/libs/libkis/tests/TestNode.cpp b/libs/libkis/tests/TestNode.cpp
index 5b3cc06580..c16960d0ef 100644
--- a/libs/libkis/tests/TestNode.cpp
+++ b/libs/libkis/tests/TestNode.cpp
@@ -32,6 +32,8 @@
 #include <kis_fill_painter.h>
 #include <kis_paint_layer.h>
 
+#include <sdk/tests/testui.h>
+
 void TestNode::testSetColorSpace()
 {
     KisImageSP image = new KisImage(0, 100, 100, KoColorSpaceRegistry::instance()->rgb8(), "test");
@@ -159,5 +161,5 @@ void TestNode::testMergeDown()
     delete n2;
 }
 
-QTEST_MAIN(TestNode)
+KISTEST_MAIN(TestNode)
 
diff --git a/libs/libkis/tests/TestNotifier.cpp b/libs/libkis/tests/TestNotifier.cpp
index f0b3fbf04e..3c90f4f643 100644
--- a/libs/libkis/tests/TestNotifier.cpp
+++ b/libs/libkis/tests/TestNotifier.cpp
@@ -24,7 +24,7 @@
 #include <KisPart.h>
 #include <Document.h>
 
-#include  <sdk/tests/kistest.h>
+#include  <sdk/tests/testui.h>
 
 void TestNotifier::testNotifier()
 {
diff --git a/libs/pigment/tests/TestColorConversionSystem.cpp b/libs/pigment/tests/TestColorConversionSystem.cpp
index d52d8f3e0c..7efad1e71e 100644
--- a/libs/pigment/tests/TestColorConversionSystem.cpp
+++ b/libs/pigment/tests/TestColorConversionSystem.cpp
@@ -26,7 +26,7 @@
 #include <KoColorSpaceRegistry.h>
 #include <KoColorConversionSystem.h>
 #include <KoColorModelStandardIds.h>
-#include <sdk/tests/kistest.h>
+#include <sdk/tests/testpigment.h>
 
 TestColorConversionSystem::TestColorConversionSystem()
 {
diff --git a/libs/pigment/tests/TestKoColor.cpp b/libs/pigment/tests/TestKoColor.cpp
index 427b5b66df..d2f25b6285 100644
--- a/libs/pigment/tests/TestKoColor.cpp
+++ b/libs/pigment/tests/TestKoColor.cpp
@@ -30,7 +30,7 @@
 #include "KoColorSpaceRegistry.h"
 #include "DebugPigment.h"
 
-#include "sdk/tests/kistest.h"
+#include "sdk/tests/testpigment.h"
 
 bool nearEqualValue(int a, int b)
 {
diff --git a/libs/pigment/tests/TestKoColorSpaceSanity.cpp b/libs/pigment/tests/TestKoColorSpaceSanity.cpp
index 67b5e09834..1563a8c8c2 100644
--- a/libs/pigment/tests/TestKoColorSpaceSanity.cpp
+++ b/libs/pigment/tests/TestKoColorSpaceSanity.cpp
@@ -23,7 +23,7 @@
 #include <KoColorSpaceRegistry.h>
 #include <KoChannelInfo.h>
 
-#include "sdk/tests/kistest.h"
+#include "sdk/tests/testpigment.h"
 
 void TestKoColorSpaceSanity::testChannelsInfo()
 {
diff --git a/libs/resources/KisResourceTypes.h b/libs/resources/KisResourceTypes.h
index ca9ba4beec..ae2a522795 100644
--- a/libs/resources/KisResourceTypes.h
+++ b/libs/resources/KisResourceTypes.h
@@ -19,8 +19,6 @@
 #ifndef KISRESOURCETYPES_H
 #define KISRESOURCETYPES_H
 
-#include <QString>
-
 /**
  * These namespaces define the type keys and sub-type keys for resource types.
  * The type keys correspond to folders in the resource folder, the sub-type
@@ -53,4 +51,5 @@ namespace ResourceSubType {
     static const QString StopGradients {"stop_gradients"};
 }
 
+
 #endif // KISRESOURCETYPES_H
diff --git a/libs/ui/KisApplication.cpp b/libs/ui/KisApplication.cpp
index 7f3ef1d4e2..a2d5f4bf83 100644
--- a/libs/ui/KisApplication.cpp
+++ b/libs/ui/KisApplication.cpp
@@ -249,7 +249,6 @@ void KisApplication::initializeGlobals(const KisApplicationArguments &args)
 
 void KisApplication::addResourceTypes()
 {
-    //    qDebug() << "addResourceTypes();";
     // All Krita's resource types
     KoResourcePaths::addResourceType("markers", "data", "/styles/");
     KoResourcePaths::addResourceType("kis_pics", "data", "/pics/");
@@ -384,7 +383,7 @@ bool KisApplication::registerResources()
 
     KisResourceLocator::LocatorError r = KisResourceLocator::instance()->initialize(KoResourcePaths::getApplicationRoot() + "/share/krita");
     connect(KisResourceLocator::instance(), SIGNAL(progressMessage(const QString&)), this, SLOT(setSplashScreenLoadingText(const QString&)));
-    if (r != KisResourceLocator::LocatorError::Ok ) {
+    if (r != KisResourceLocator::LocatorError::Ok && qApp->inherits("KisApplication")) {
         QMessageBox::critical(0, i18nc("@title:window", "Krita: Fatal error"), KisResourceLocator::instance()->errorMessages().join('\n') + i18n("\n\nKrita will quit now."));
         //return false;
     }
diff --git a/libs/ui/KisSessionResource.h b/libs/ui/KisSessionResource.h
index 161b58b363..04d89079dc 100644
--- a/libs/ui/KisSessionResource.h
+++ b/libs/ui/KisSessionResource.h
@@ -21,7 +21,9 @@
 
 #include "KisWindowLayoutResource.h"
 
-class KisSessionResource : public KisWindowLayoutResource
+#include "kritaui_export.h"
+
+class KRITAUI_EXPORT KisSessionResource : public KisWindowLayoutResource
 {
 public:
     KisSessionResource(const QString &filename);
diff --git a/libs/ui/KisWindowLayoutResource.h b/libs/ui/KisWindowLayoutResource.h
index 45c74ca57b..4d54c5c3ae 100644
--- a/libs/ui/KisWindowLayoutResource.h
+++ b/libs/ui/KisWindowLayoutResource.h
@@ -25,7 +25,9 @@
 class KisWindowLayoutResource;
 typedef QSharedPointer<KisWindowLayoutResource> KisWindowLayoutResourceSP;
 
-class KisWindowLayoutResource : public KoResource
+#include "kritaui_export.h"
+
+class KRITAUI_EXPORT KisWindowLayoutResource : public KoResource
 {
 public:
     explicit KisWindowLayoutResource(const QString &filename);
diff --git a/libs/ui/tests/FreehandStrokeBenchmark.cpp b/libs/ui/tests/FreehandStrokeBenchmark.cpp
index fcfb9e54c9..b6f94690ac 100644
--- a/libs/ui/tests/FreehandStrokeBenchmark.cpp
+++ b/libs/ui/tests/FreehandStrokeBenchmark.cpp
@@ -19,7 +19,7 @@
 #include "FreehandStrokeBenchmark.h"
 
 #include <QTest>
-#include <sdk/tests/kistest.h>
+#include <sdk/tests/testui.h>
 #include <KoCompositeOpRegistry.h>
 #include <KoColor.h>
 #include "stroke_testing_utils.h"
diff --git a/libs/ui/tests/KisDocumentReplaceTest.cpp b/libs/ui/tests/KisDocumentReplaceTest.cpp
index 7513da616d..88075c4fb2 100644
--- a/libs/ui/tests/KisDocumentReplaceTest.cpp
+++ b/libs/ui/tests/KisDocumentReplaceTest.cpp
@@ -24,7 +24,7 @@
 #include <KisPart.h>
 #include <kis_layer_utils.h>
 #include <kis_group_layer.h>
-#include <sdk/tests/kistest.h>
+#include <sdk/tests/testui.h>
 #include <QScopedPointer>
 
 void KisDocumentReplaceTest::init()
diff --git a/libs/ui/tests/KisManualUpdaterTest.cpp b/libs/ui/tests/KisManualUpdaterTest.cpp
index aca329a258..52b9a46257 100644
--- a/libs/ui/tests/KisManualUpdaterTest.cpp
+++ b/libs/ui/tests/KisManualUpdaterTest.cpp
@@ -25,6 +25,8 @@
 #include <KisManualUpdater.h>
 #include <MockMultiFeedRssModel.h>
 
+#include <sdk/tests/testui.h>
+
 KisManualUpdaterTest::KisManualUpdaterTest(QObject *parent) : QObject(parent)
 {
 
@@ -150,4 +152,4 @@ void KisManualUpdaterTest::testCheckForUpdate_data()
             << UpdaterStatus::StatusID::UPDATE_AVAILABLE;
 }
 
-QTEST_MAIN(KisManualUpdaterTest);
+KISTEST_MAIN(KisManualUpdaterTest);
diff --git a/libs/ui/tests/KisSpinBoxSplineUnitConverterTest.cpp b/libs/ui/tests/KisSpinBoxSplineUnitConverterTest.cpp
index 6a398eb07c..290bd6b241 100644
--- a/libs/ui/tests/KisSpinBoxSplineUnitConverterTest.cpp
+++ b/libs/ui/tests/KisSpinBoxSplineUnitConverterTest.cpp
@@ -18,7 +18,7 @@
 
 #include <QTest>
 #include <testutil.h>
-#include <kistest.h>
+#include <testui.h>
 
 
 #include <KisSpinBoxSplineUnitConverterTest.h>
diff --git a/libs/ui/tests/fill_processing_visitor_test.cpp b/libs/ui/tests/fill_processing_visitor_test.cpp
index 42a8b76520..7f4dd4cf13 100644
--- a/libs/ui/tests/fill_processing_visitor_test.cpp
+++ b/libs/ui/tests/fill_processing_visitor_test.cpp
@@ -23,7 +23,7 @@
 #include "kis_undo_stores.h"
 #include "kis_processing_applicator.h"
 
-#include "testutil.h"
+#include <testutil.h>
 #include "qimage_based_test.h"
 #include "stroke_testing_utils.h"
 #include <resources/KoPattern.h>
diff --git a/libs/ui/tests/freehand_stroke_test.cpp b/libs/ui/tests/freehand_stroke_test.cpp
index 1d2de1ae68..5ca710ebba 100644
--- a/libs/ui/tests/freehand_stroke_test.cpp
+++ b/libs/ui/tests/freehand_stroke_test.cpp
@@ -30,7 +30,7 @@
 #include "kis_painter.h"
 #include <brushengine/kis_paint_information.h>
 
-#include "kistest.h"
+#include "testui.h"
 
 class FreehandStrokeTester : public utils::StrokeTester
 {
diff --git a/libs/ui/tests/kis_action_manager_test.cpp b/libs/ui/tests/kis_action_manager_test.cpp
index d68c08dfe5..7e1df1ec1a 100644
--- a/libs/ui/tests/kis_action_manager_test.cpp
+++ b/libs/ui/tests/kis_action_manager_test.cpp
@@ -31,7 +31,7 @@
 #include <KisViewManager.h>
 
 #include "kis_node_manager.h"
-#include <kistest.h>
+#include <testui.h>
 
 void KisActionManagerTest::testUpdateGUI()
 {
diff --git a/libs/ui/tests/kis_animation_exporter_test.cpp b/libs/ui/tests/kis_animation_exporter_test.cpp
index b48af75c47..9a5c241723 100644
--- a/libs/ui/tests/kis_animation_exporter_test.cpp
+++ b/libs/ui/tests/kis_animation_exporter_test.cpp
@@ -30,7 +30,7 @@
 #include <KoUpdater.h>
 #include "kis_time_range.h"
 #include "kis_keyframe_channel.h"
-#include <kistest.h>
+#include <testui.h>
 
 void KisAnimationExporterTest::testAnimationExport()
 {
diff --git a/libs/ui/tests/kis_animation_importer_test.cpp b/libs/ui/tests/kis_animation_importer_test.cpp
index b411dd8091..1f5af675bc 100644
--- a/libs/ui/tests/kis_animation_importer_test.cpp
+++ b/libs/ui/tests/kis_animation_importer_test.cpp
@@ -21,13 +21,13 @@
 #include "KisPart.h"
 #include "kis_animation_importer.h"
 #include "KisDocument.h"
-#include "testutil.h"
+#include <testutil.h>
 #include "kis_keyframe_channel.h"
 #include "kis_image_animation_interface.h"
 #include "kis_group_layer.h"
 #include <KoUpdater.h>
 
-#include "kistest.h"
+#include "testui.h"
 
 void KisAnimationImporterTest::testImport()
 {
diff --git a/libs/ui/tests/kis_clipboard_test.cpp b/libs/ui/tests/kis_clipboard_test.cpp
index 1f8a51f645..553115176c 100644
--- a/libs/ui/tests/kis_clipboard_test.cpp
+++ b/libs/ui/tests/kis_clipboard_test.cpp
@@ -27,7 +27,7 @@
 #include "kis_paint_device.h"
 #include "kis_clipboard.h"
 
-#include "testutil.h"
+#include <testutil.h>
 
 
 void KisClipboardTest::testRoundTrip()
diff --git a/libs/ui/tests/kis_derived_resources_test.cpp b/libs/ui/tests/kis_derived_resources_test.cpp
index a1cb4ad106..83504fedb2 100644
--- a/libs/ui/tests/kis_derived_resources_test.cpp
+++ b/libs/ui/tests/kis_derived_resources_test.cpp
@@ -35,45 +35,19 @@
 #include <kis_paintop_settings.h>
 #include <KoResourcePaths.h>
 #include <kis_config.h>
-#include "testutil.h"
+#include <testutil.h>
 #include "opengl/kis_opengl.h"
 #include <KisGlobalResourcesInterface.h>
 
-void addResourceTypes()
-{
-    // All Krita's resource types
-    KoResourcePaths::addResourceType("gmic_definitions", "data", "/gmic/");
-    KoResourcePaths::addResourceType("icc_profiles", "data", "/color/icc");
-    KoResourcePaths::addResourceType("icc_profiles", "data", "/profiles/");
-    KoResourcePaths::addResourceType("kis_actions", "data", "/actions");
-    KoResourcePaths::addResourceType(ResourceType::Brushes, "data", "/brushes/");
-    KoResourcePaths::addResourceType("kis_defaultpresets", "data", "/defaultpresets/");
-    KoResourcePaths::addResourceType("kis_images", "data", "/images/");
-    KoResourcePaths::addResourceType(ResourceType::PaintOpPresets, "data", "/paintoppresets/");
-    KoResourcePaths::addResourceType("kis_pics", "data", "/pics/");
-    KoResourcePaths::addResourceType("kis_resourcebundles", "data", "/bundles/");
-    KoResourcePaths::addResourceType("kis_shortcuts", "data", "/shortcuts/");
-    KoResourcePaths::addResourceType("kis_taskset", "data", "/taskset/");
-    KoResourcePaths::addResourceType("kis_taskset", "data", "/taskset/");
-    KoResourcePaths::addResourceType(ResourceType::WindowLayouts, "data", "/windowlayouts/");
-    KoResourcePaths::addResourceType(ResourceType::Workspaces, "data", "/workspaces/");
-    KoResourcePaths::addResourceType(ResourceType::FilterEffects, "data", "/effects/");
-    KoResourcePaths::addResourceType(ResourceType::Gradients, "data", "/gradients/");
-    KoResourcePaths::addResourceType(ResourceType::Palettes, "data", "/palettes/");
-    KoResourcePaths::addResourceType(ResourceType::Patterns, "data", "/patterns/");
-    KoResourcePaths::addResourceType("metadata_schema", "data", "/metadata/schemas/");
-    KoResourcePaths::addResourceType("psd_layer_style_collections", "data", "/asl");
-    KoResourcePaths::addResourceType("tags", "data", "/tags/");
+#include  <sdk/tests/testui.h>
 
+void KisDerivedResourcesTest::test()
+{
     KisOpenGL::testingInitializeDefaultSurfaceFormat();
 
     KisConfig cfg(false);
     cfg.disableOpenGL();
-}
 
-void KisDerivedResourcesTest::test()
-{
-    addResourceTypes();
 
     KisDocument* doc = createEmptyDocument();
 
diff --git a/libs/ui/tests/kis_doc2_test.cpp b/libs/ui/tests/kis_doc2_test.cpp
index f0b17fb3d4..1472edfa1c 100644
--- a/libs/ui/tests/kis_doc2_test.cpp
+++ b/libs/ui/tests/kis_doc2_test.cpp
@@ -30,7 +30,7 @@
 #include "util.h"
 #include <KisView.h>
 #include <kis_config.h>
-#include "sdk/tests/kistest.h"
+#include "sdk/tests/testui.h"
 
 void silenceReignsSupreme(QtMsgType /*type*/, const QMessageLogContext &/*context*/, const QString &/*msg*/)
 {
diff --git a/libs/ui/tests/kis_exiv2_test.cpp b/libs/ui/tests/kis_exiv2_test.cpp
index f663175863..6d33ea7bec 100644
--- a/libs/ui/tests/kis_exiv2_test.cpp
+++ b/libs/ui/tests/kis_exiv2_test.cpp
@@ -33,7 +33,7 @@
 #include <kis_meta_data_value.h>
 #include "kisexiv2/kis_exiv2.h"
 #include "filestest.h"
-#include "sdk/tests/kistest.h"
+#include "sdk/tests/testui.h"
 
 #ifndef FILES_DATA_DIR
 #error "FILES_DATA_DIR not set. A directory with the data used for testing the metadata parser in krita"
diff --git a/libs/ui/tests/kis_file_layer_test.cpp b/libs/ui/tests/kis_file_layer_test.cpp
index 4ae5a1d89b..a1ccdaa599 100644
--- a/libs/ui/tests/kis_file_layer_test.cpp
+++ b/libs/ui/tests/kis_file_layer_test.cpp
@@ -27,6 +27,7 @@
 #include <kis_transform_mask_params_interface.h>
 
 #include <testutil.h>
+#include <testui.h>
 
 #include "config-limit-long-tests.h"
 
diff --git a/libs/ui/tests/kis_multinode_property_test.cpp b/libs/ui/tests/kis_multinode_property_test.cpp
index f8c9710eb2..d4295081bd 100644
--- a/libs/ui/tests/kis_multinode_property_test.cpp
+++ b/libs/ui/tests/kis_multinode_property_test.cpp
@@ -19,7 +19,7 @@
 #include "kis_multinode_property_test.h"
 
 #include <QTest>
-#include "testutil.h"
+#include <testutil.h>
 
 #include <KoCompositeOpRegistry.h>
 
diff --git a/libs/ui/tests/kis_node_juggler_compressed_test.h b/libs/ui/tests/kis_node_juggler_compressed_test.h
index b40a1f76a2..fa8e866e2a 100644
--- a/libs/ui/tests/kis_node_juggler_compressed_test.h
+++ b/libs/ui/tests/kis_node_juggler_compressed_test.h
@@ -20,7 +20,7 @@
 #define __KIS_NODE_JUGGLER_COMPRESSED_TEST_H
 
 #include <QtTest>
-#include "testutil.h"
+#include <testutil.h>
 #include "kis_group_layer.h"
 
 class KisNodeJugglerCompressedTest : public QObject
diff --git a/libs/ui/tests/kis_node_manager_test.cpp b/libs/ui/tests/kis_node_manager_test.cpp
index 9486dfbf0e..bf95f494e6 100644
--- a/libs/ui/tests/kis_node_manager_test.cpp
+++ b/libs/ui/tests/kis_node_manager_test.cpp
@@ -20,7 +20,10 @@
 
 #include <QTest>
 #include <kis_filter_configuration.h>
+
 #include <sdk/tests/testutil.h>
+#include <sdk/tests/testui.h>
+
 #include "ui_manager_test.h"
 
 class NodeManagerTester : public TestUtil::UiManagerTest
diff --git a/libs/ui/tests/kis_node_model_test.cpp b/libs/ui/tests/kis_node_model_test.cpp
index bc99acb19f..16757235bc 100644
--- a/libs/ui/tests/kis_node_model_test.cpp
+++ b/libs/ui/tests/kis_node_model_test.cpp
@@ -29,6 +29,8 @@
 #include "flake/kis_shape_controller.h"
 
 #include <sdk/tests/testutil.h>
+#include <sdk/tests/testui.h>
+#include <sdk/tests/testui.h>
 
 #include "modeltest.h"
 
diff --git a/libs/ui/tests/kis_painting_assistants_decoration_test.cpp b/libs/ui/tests/kis_painting_assistants_decoration_test.cpp
index caab04df53..74d78d3ee3 100644
--- a/libs/ui/tests/kis_painting_assistants_decoration_test.cpp
+++ b/libs/ui/tests/kis_painting_assistants_decoration_test.cpp
@@ -6,7 +6,7 @@
  * - PerspectiveAssistant
  */
 
-#include "testutil.h"
+#include <testutil.h>
 #include "qimage_based_test.h"
 
 #include <KoCanvasResourceProvider.h>
@@ -21,9 +21,9 @@
 
 #include "kis_painting_assistants_decoration.h"
 #include "KisPart.h"
-#include "kistest.h"
+#include "testui.h"
 #include <kis_config.h>
-#include "testutil.h"
+#include <testutil.h>
 #include <KoResourcePaths.h>
 #include "opengl/kis_opengl.h"
 #include "kis_painting_assistants_decoration_test.h"
diff --git a/libs/ui/tests/kis_selection_manager_test.cpp b/libs/ui/tests/kis_selection_manager_test.cpp
index 53ecd952d3..1fd7236610 100644
--- a/libs/ui/tests/kis_selection_manager_test.cpp
+++ b/libs/ui/tests/kis_selection_manager_test.cpp
@@ -22,7 +22,7 @@
 #include <QTest>
 
 #include <sdk/tests/testutil.h>
-
+#include <sdk/tests/testui.h>
 #include "ui_manager_test.h"
 
 class SelectionManagerTester : public TestUtil::UiManagerTest
diff --git a/libs/ui/tests/kis_shape_commands_test.cpp b/libs/ui/tests/kis_shape_commands_test.cpp
index de516c57c6..43c8c4c9ad 100644
--- a/libs/ui/tests/kis_shape_commands_test.cpp
+++ b/libs/ui/tests/kis_shape_commands_test.cpp
@@ -25,7 +25,7 @@
 #include "kis_shape_layer.h"
 #include <KoPathShape.h>
 #include <KoColorBackground.h>
-#include "testutil.h"
+#include <testutil.h>
 
 #include <KisPart.h>
 #include <KisDocument.h>
@@ -34,6 +34,7 @@
 #include <KoShapeGroup.h>
 #include <KoShapeGroupCommand.h>
 #include <sdk/tests/testutil.h>
+#include <sdk/tests/testui.h>
 
 void KisShapeCommandsTest::testGrouping()
 {
diff --git a/libs/ui/tests/kis_shape_controller_test.cpp b/libs/ui/tests/kis_shape_controller_test.cpp
index 6563d983f7..c17f1eb3de 100644
--- a/libs/ui/tests/kis_shape_controller_test.cpp
+++ b/libs/ui/tests/kis_shape_controller_test.cpp
@@ -26,6 +26,7 @@
 #include "flake/kis_shape_controller.h"
 
 #include <sdk/tests/testutil.h>
+#include <sdk/tests/testui.h>
 
 KisDummiesFacadeBase* KisShapeControllerTest::dummiesFacadeFactory()
 {
diff --git a/libs/ui/tests/kis_shape_layer_test.cpp b/libs/ui/tests/kis_shape_layer_test.cpp
index 356fd9443a..f960d1543c 100644
--- a/libs/ui/tests/kis_shape_layer_test.cpp
+++ b/libs/ui/tests/kis_shape_layer_test.cpp
@@ -25,7 +25,7 @@
 #include "kis_shape_layer.h"
 #include <KoPathShape.h>
 #include <KoColorBackground.h>
-#include "testutil.h"
+#include <testutil.h>
 
 #include <KisPart.h>
 #include <KisDocument.h>
@@ -38,6 +38,7 @@
 #include "kis_layer_utils.h"
 
 #include <sdk/tests/testutil.h>
+#include <sdk/tests/testui.h>
 
 void testMergeDownImpl(bool useImageTransformations)
 {
diff --git a/libs/ui/tests/kis_shape_selection_test.cpp b/libs/ui/tests/kis_shape_selection_test.cpp
index 9e45c2dd93..d7b05bfead 100644
--- a/libs/ui/tests/kis_shape_selection_test.cpp
+++ b/libs/ui/tests/kis_shape_selection_test.cpp
@@ -30,8 +30,8 @@
 #include "kis_pixel_selection.h"
 #include "flake/kis_shape_selection.h"
 #include "kis_image.h"
-#include "testutil.h"
-#include "kistest.h"
+#include <testutil.h>
+#include "testui.h"
 #include <KisPart.h>
 #include <KisDocument.h>
 #include "kis_transaction.h"
diff --git a/libs/ui/tests/kis_zoom_and_pan_test.cpp b/libs/ui/tests/kis_zoom_and_pan_test.cpp
index 25a16bf8c6..22f607be23 100644
--- a/libs/ui/tests/kis_zoom_and_pan_test.cpp
+++ b/libs/ui/tests/kis_zoom_and_pan_test.cpp
@@ -22,7 +22,7 @@
 #include <QTest>
 
 #include <kis_filter_configuration.h>
-#include "testutil.h"
+#include <testutil.h>
 #include "qimage_based_test.h"
 
 #include <kactioncollection.h>
@@ -40,7 +40,7 @@
 #include "kis_coordinates_converter.h"
 #include "kis_filter_strategy.h"
 
-#include "kistest.h"
+#include "testui.h"
 
 class ZoomAndPanTester : public TestUtil::QImageBasedTest
 {
diff --git a/libs/ui/tests/node_shapes_utils.h b/libs/ui/tests/node_shapes_utils.h
index 8cf5edf7e9..6d08264e28 100644
--- a/libs/ui/tests/node_shapes_utils.h
+++ b/libs/ui/tests/node_shapes_utils.h
@@ -22,7 +22,7 @@
 #include "kis_node_shape.h"
 #include "kis_node_shapes_graph.h"
 #include "kis_node_dummies_graph.h"
-#include "testutil.h"
+#include <testutil.h>
 
 inline KisNodeSP nodeFromId(int id) {
     KisNodeSP node = new TestUtil::TestNode();
diff --git a/libs/widgetutils/tests/TestKoProgressUpdater.cpp b/libs/widgetutils/tests/TestKoProgressUpdater.cpp
index 35ccda2ba5..1f1b1d8c64 100644
--- a/libs/widgetutils/tests/TestKoProgressUpdater.cpp
+++ b/libs/widgetutils/tests/TestKoProgressUpdater.cpp
@@ -1,3 +1,4 @@
+
 /*
  *  Copyright (c) 2017 Dmitry Kazakov <dimula73 at gmail.com>
  *
diff --git a/plugins/color/lcms2engine/tests/TestColorSpaceRegistry.cpp b/plugins/color/lcms2engine/tests/TestColorSpaceRegistry.cpp
index 34186eca8a..60c8307a96 100644
--- a/plugins/color/lcms2engine/tests/TestColorSpaceRegistry.cpp
+++ b/plugins/color/lcms2engine/tests/TestColorSpaceRegistry.cpp
@@ -9,7 +9,7 @@
 #include "RgbU16ColorSpace.h"
 #include "LabColorSpace.h"
 
-#include "sdk/tests/kistest.h"
+#include "sdk/tests/testpigment.h"
 
 void TestColorSpaceRegistry::testConstruction()
 {
diff --git a/plugins/color/lcms2engine/tests/TestLcmsRGBP2020PQColorSpace.cpp b/plugins/color/lcms2engine/tests/TestLcmsRGBP2020PQColorSpace.cpp
index fd1f8aaf1c..b386dd3588 100644
--- a/plugins/color/lcms2engine/tests/TestLcmsRGBP2020PQColorSpace.cpp
+++ b/plugins/color/lcms2engine/tests/TestLcmsRGBP2020PQColorSpace.cpp
@@ -19,7 +19,7 @@
 #include "TestLcmsRGBP2020PQColorSpace.h"
 
 #include <QTest>
-#include "sdk/tests/kistest.h"
+#include "sdk/tests/testpigment.h"
 
 #include "kis_debug.h"
 
diff --git a/plugins/dockers/animation/tests/timeline_model_test.cpp b/plugins/dockers/animation/tests/timeline_model_test.cpp
index 242608a773..3abe1ecde1 100644
--- a/plugins/dockers/animation/tests/timeline_model_test.cpp
+++ b/plugins/dockers/animation/tests/timeline_model_test.cpp
@@ -46,8 +46,8 @@
 #include "kis_double_parse_spin_box.h"
 #include "kis_int_parse_spin_box.h"
 
-#include  <sdk/tests/kistest.h>
 #include <sdk/tests/testutil.h>
+#include <sdk/tests/testui.h>
 
 void TimelineModelTest::init()
 {
diff --git a/plugins/filters/tests/kis_crash_filter_test.cpp b/plugins/filters/tests/kis_crash_filter_test.cpp
index 845ecb54ee..4f4605136b 100644
--- a/plugins/filters/tests/kis_crash_filter_test.cpp
+++ b/plugins/filters/tests/kis_crash_filter_test.cpp
@@ -115,5 +115,5 @@ void KisCrashFilterTest::testCrashFilters()
     }
 }
 
-#include <sdk/tests/kistest.h>
+#include <sdk/tests/testimage.h>
 KISTEST_MAIN(KisCrashFilterTest)
diff --git a/plugins/filters/unsharp/tests/kis_unsharp_mask_test.cpp b/plugins/filters/unsharp/tests/kis_unsharp_mask_test.cpp
index f19815967c..4ddd7d22ff 100644
--- a/plugins/filters/unsharp/tests/kis_unsharp_mask_test.cpp
+++ b/plugins/filters/unsharp/tests/kis_unsharp_mask_test.cpp
@@ -24,7 +24,7 @@
 #include "filter/kis_filter.h"
 #include "filter/kis_filter_configuration.h"
 #include "filter/kis_filter_registry.h"
-#include "testutil.h"
+#include <testutil.h>
 #include <KisGlobalResourcesInterface.h>
 
 void KisUnsharpMaskTest::testUnsharpWithTransparency()
diff --git a/plugins/generators/screentone/tests/KisScreentoneGeneratorTest.cpp b/plugins/generators/screentone/tests/KisScreentoneGeneratorTest.cpp
index b58cfec3ea..53c8edd143 100644
--- a/plugins/generators/screentone/tests/KisScreentoneGeneratorTest.cpp
+++ b/plugins/generators/screentone/tests/KisScreentoneGeneratorTest.cpp
@@ -28,7 +28,7 @@
 #include <KoUpdater.h>
 #include <KisGlobalResourcesInterface.h>
 #include <QTest>
-#include <sdk/tests/kistest.h>
+#include <sdk/tests/testimage.h>
 #include <testutil.h>
 
 #include "KisScreentoneGeneratorTest.h"
diff --git a/plugins/generators/seexpr/tests/kis_seexpr_generator_test.cpp b/plugins/generators/seexpr/tests/kis_seexpr_generator_test.cpp
index 41e31a5fb1..bc52e7d0b0 100644
--- a/plugins/generators/seexpr/tests/kis_seexpr_generator_test.cpp
+++ b/plugins/generators/seexpr/tests/kis_seexpr_generator_test.cpp
@@ -30,7 +30,7 @@
 #include <kis_processing_information.h>
 #include <kis_selection.h>
 #include <resources/KisSeExprScript.h>
-#include <sdk/tests/kistest.h>
+#include <sdk/tests/testimage.h>
 #include <testutil.h>
 
 #include "kis_seexpr_generator_test.h"
diff --git a/plugins/impex/exr/tests/kis_exr_test.cpp b/plugins/impex/exr/tests/kis_exr_test.cpp
index 0a649b6db7..8382dea5f8 100644
--- a/plugins/impex/exr/tests/kis_exr_test.cpp
+++ b/plugins/impex/exr/tests/kis_exr_test.cpp
@@ -21,7 +21,7 @@
 #include <QTest>
 #include <QCoreApplication>
 
-#include  <sdk/tests/kistest.h>
+#include  <sdk/tests/testui.h>
 
 #include <half.h>
 #include <KisMimeDatabase.h>
diff --git a/plugins/impex/heightmap/tests/kis_heightmap_test.cpp b/plugins/impex/heightmap/tests/kis_heightmap_test.cpp
index 82c5d7d3ad..a398842048 100644
--- a/plugins/impex/heightmap/tests/kis_heightmap_test.cpp
+++ b/plugins/impex/heightmap/tests/kis_heightmap_test.cpp
@@ -21,7 +21,7 @@
 #include <QTest>
 #include <QCoreApplication>
 
-#include  <sdk/tests/kistest.h>
+#include  <sdk/tests/testui.h>
 
 #include "filestest.h"
 
diff --git a/plugins/impex/jpeg/tests/kis_jpeg_test.cpp b/plugins/impex/jpeg/tests/kis_jpeg_test.cpp
index 7d84ef5cdc..49645de5cd 100644
--- a/plugins/impex/jpeg/tests/kis_jpeg_test.cpp
+++ b/plugins/impex/jpeg/tests/kis_jpeg_test.cpp
@@ -24,7 +24,7 @@
 #include "kisexiv2/kis_exiv2.h"
 #include "filestest.h"
 #include "jpeglib.h"
-#include  <sdk/tests/kistest.h>
+#include  <sdk/tests/testui.h>
 
 #ifndef FILES_DATA_DIR
 #error "FILES_DATA_DIR not set. A directory with the data used for testing the importing of files in krita"
diff --git a/plugins/impex/libkra/tests/kis_kra_loader_test.cpp b/plugins/impex/libkra/tests/kis_kra_loader_test.cpp
index 43e43369d3..8ab077776c 100644
--- a/plugins/impex/libkra/tests/kis_kra_loader_test.cpp
+++ b/plugins/impex/libkra/tests/kis_kra_loader_test.cpp
@@ -27,7 +27,7 @@
 #include <KoColor.h>
 
 #include "kis_image.h"
-#include "testutil.h"
+#include <testutil.h>
 #include "KisPart.h"
 
 #include <filter/kis_filter_registry.h>
@@ -39,7 +39,7 @@
 
 #include <filestest.h>
 
-#include  <sdk/tests/kistest.h>
+#include  <sdk/tests/testui.h>
 
 
 const QString KraMimetype = "application/x-krita";
diff --git a/plugins/impex/libkra/tests/kis_kra_saver_test.cpp b/plugins/impex/libkra/tests/kis_kra_saver_test.cpp
index 46f4793ca6..8db2f4eb77 100644
--- a/plugins/impex/libkra/tests/kis_kra_saver_test.cpp
+++ b/plugins/impex/libkra/tests/kis_kra_saver_test.cpp
@@ -44,7 +44,7 @@
 #include "kis_fill_painter.h"
 #include "kis_shape_selection.h"
 #include "util.h"
-#include "testutil.h"
+#include <testutil.h>
 #include "kis_keyframe_channel.h"
 #include "kis_image_animation_interface.h"
 #include "kis_layer_properties_icons.h"
@@ -55,7 +55,7 @@
 #include <generator/kis_generator_registry.h>
 
 #include <KoResourcePaths.h>
-#include  <sdk/tests/kistest.h>
+#include  <sdk/tests/testui.h>
 #include <filestest.h>
 
 const QString KraMimetype = "application/x-krita";
diff --git a/plugins/impex/png/tests/kis_png_test.cpp b/plugins/impex/png/tests/kis_png_test.cpp
index 912286acc7..0170464ba9 100644
--- a/plugins/impex/png/tests/kis_png_test.cpp
+++ b/plugins/impex/png/tests/kis_png_test.cpp
@@ -24,7 +24,7 @@
 
 #include "filestest.h"
 
-#include  <sdk/tests/kistest.h>
+#include  <sdk/tests/testui.h>
 
 #ifndef FILES_DATA_DIR
 #error "FILES_DATA_DIR not set. A directory with the data used for testing the importing of files in krita"
diff --git a/plugins/impex/psd/tests/kis_psd_test.cpp b/plugins/impex/psd/tests/kis_psd_test.cpp
index 93d9edc841..2cb5eeb2d5 100644
--- a/plugins/impex/psd/tests/kis_psd_test.cpp
+++ b/plugins/impex/psd/tests/kis_psd_test.cpp
@@ -22,7 +22,7 @@
 #include <QTest>
 #include <QCoreApplication>
 
-#include  <sdk/tests/kistest.h>
+#include  <sdk/tests/testui.h>
 
 #include "filestest.h"
 
diff --git a/plugins/impex/svg/tests/kis_svg_test.cpp b/plugins/impex/svg/tests/kis_svg_test.cpp
index b407b77a44..6dac17e0a3 100644
--- a/plugins/impex/svg/tests/kis_svg_test.cpp
+++ b/plugins/impex/svg/tests/kis_svg_test.cpp
@@ -22,7 +22,7 @@
 #include <QTest>
 #include <QCoreApplication>
 
-#include  <sdk/tests/kistest.h>
+#include  <sdk/tests/testui.h>
 
 #include "filestest.h"
 
diff --git a/plugins/impex/tga/tests/data/writeonlyFile.txt b/plugins/impex/tga/tests/data/writeonlyFile.txt
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/plugins/impex/tiff/tests/kis_tiff_test.cpp b/plugins/impex/tiff/tests/kis_tiff_test.cpp
index b32692d6f9..e1ea228035 100644
--- a/plugins/impex/tiff/tests/kis_tiff_test.cpp
+++ b/plugins/impex/tiff/tests/kis_tiff_test.cpp
@@ -28,7 +28,7 @@
 #include <KoColor.h>
 
 #include "kisexiv2/kis_exiv2.h"
-#include  <sdk/tests/kistest.h>
+#include  <sdk/tests/testui.h>
 #include <KoColorModelStandardIdsUtils.h>
 
 #ifndef FILES_DATA_DIR
diff --git a/plugins/impex/xcf/tests/kis_xcf_test.cpp b/plugins/impex/xcf/tests/kis_xcf_test.cpp
index 51546a467a..ac8a7cb68a 100644
--- a/plugins/impex/xcf/tests/kis_xcf_test.cpp
+++ b/plugins/impex/xcf/tests/kis_xcf_test.cpp
@@ -22,7 +22,7 @@
 #include <QTest>
 #include <QCoreApplication>
 
-#include  <sdk/tests/kistest.h>
+#include  <sdk/tests/testui.h>
 
 #include "filestest.h"
 
diff --git a/plugins/paintops/libpaintop/tests/kis_embedded_pattern_manager_test.cpp b/plugins/paintops/libpaintop/tests/kis_embedded_pattern_manager_test.cpp
index 006824438b..181e88d7cd 100644
--- a/plugins/paintops/libpaintop/tests/kis_embedded_pattern_manager_test.cpp
+++ b/plugins/paintops/libpaintop/tests/kis_embedded_pattern_manager_test.cpp
@@ -30,7 +30,7 @@
 #include <KisResourceServerProvider.h>
 #include <KisGlobalResourcesInterface.h>
 
-#include "sdk/tests/kistest.h"
+#include "sdk/tests/testresources.h"
 
 KoPatternSP KisEmbeddedPatternManagerTest::createPattern()
 {
diff --git a/plugins/tools/tool_transform2/tests/test_animated_transform_parameters.cpp b/plugins/tools/tool_transform2/tests/test_animated_transform_parameters.cpp
index 20f8ff4134..00cc9a13ad 100644
--- a/plugins/tools/tool_transform2/tests/test_animated_transform_parameters.cpp
+++ b/plugins/tools/tool_transform2/tests/test_animated_transform_parameters.cpp
@@ -19,7 +19,7 @@
 #include "test_animated_transform_parameters.h"
 
 #include "kis_transform_mask.h"
-#include "testutil.h"
+#include <testutil.h>
 #include "tool_transform_args.h"
 #include "kis_modify_transform_mask_command.h"
 #include "kis_image_animation_interface.h"
diff --git a/sdk/tests/TestResources.h b/sdk/tests/TestResources.h
new file mode 100644
index 0000000000..6fdd2743fb
--- /dev/null
+++ b/sdk/tests/TestResources.h
@@ -0,0 +1,161 @@
+/*
+ *  Copyright (c) 2020 Boudewijn Rempt <boud at valdyas.org>
+ *
+ *  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, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef TESTRESOURCES_H
+#define TESTRESOURCES_H
+
+#include <KoConfig.h>
+#include <QApplication>
+#include <QTest>
+#include <QLoggingCategory>
+#include <QtTest/qtestsystem.h>
+#include <set>
+
+#if defined(QT_NETWORK_LIB)
+#  include <QtTest/qtest_network.h>
+#endif
+#include <QtTest/qtest_widgets.h>
+
+#ifdef QT_KEYPAD_NAVIGATION
+#  define QTEST_DISABLE_KEYPAD_NAVIGATION QApplication::setNavigationMode(Qt::NavigationModeNone);
+#else
+#  define QTEST_DISABLE_KEYPAD_NAVIGATION
+#endif
+
+#if defined (TESTRESOURCES) || defined(TESTPIGMENT) || defined (TESTFLAKE) || defined(TESTBRUSH) || || defined(TESTIMAGE) || defined(TESTUI)
+#include <KisResourceLoaderRegistry.h>
+#include <QImageReader>
+#include <QList>
+#include <QByteArray>
+#include <QStringList>
+#include <KisMimeDatabase.h>
+#include <KisResourceLoader.h>
+#include <KoPattern>
+#endif
+
+#if defined(TESTPIGMENT) || defined (TESTFLAKE) || defined(TESTBRUSH) || || defined(TESTIMAGE) || defined(TESTUI)
+#include <KoSegmentGradient.h>
+#include <KoStopGradient.h>
+#include <KoColorSet.h>
+#endif
+
+#if defined (TESTFLAKE) || defined(TESTBRUSH) || defined(TESTIMAGE) || defined(TESTUI)
+#if defined HAVE_SEEXPR
+#include <KisSeExprScript.h>
+#endif
+#include <KoGamutMask.h>
+#include <KoSvgSymbolCollectionResource.h>
+#endif
+
+#if defined(TESTBRUSH) || defined(TESTIMAGE) || defined(TESTUI)
+#include <kis_gbr_brush.h>
+#include <kis_imagepipe_brush.h>
+#include <kis_svg_brush.h>
+#include <kis_png_brush.h>
+#endif
+
+#if defined(TESTIMAGE) || defined(TESTUI)
+#include <kis_paintop_preset.h>
+#include <kis_psd_layer_style.h>
+#endif
+
+#if defined(TESTUI)
+#include <KisWindowLayoutResource.h>
+#include <kis_workspace_resource.h>
+#include <KisSessionResource.h>
+#endif
+
+void registerResources()
+{
+
+#if defined (TESTRESOURCES) || defined(TESTPIGMENT) || defined (TESTFLAKE) || defined(TESTBRUSH) || || defined(TESTIMAGE) || defined(TESTUI)
+
+    KisResourceLoaderRegistry *reg = KisResourceLoaderRegistry::instance();
+
+    QList<QByteArray> src = QImageReader::supportedMimeTypes();
+    QStringList allImageMimes;
+    Q_FOREACH(const QByteArray ba, src) {
+        if (QImageWriter::supportedMimeTypes().contains(ba)) {
+            allImageMimes << QString::fromUtf8(ba);
+        }
+    }
+    allImageMimes << KisMimeDatabase::mimeTypeForSuffix("pat");
+
+    reg->add(new KisResourceLoader<KoPattern>(ResourceType::Patterns, ResourceType::Patterns, i18n("Patterns"), allImageMimes));
+#endif
+
+#if defined(TESTPIGMENT) || defined (TESTFLAKE) || defined(TESTBRUSH) || || defined(TESTIMAGE) || defined(TESTUI)
+
+    reg->add(new KisResourceLoader<KoSegmentGradient>(ResourceSubType::SegmentedGradients, ResourceType::Gradients, i18n("Gradients"), QStringList() << "application/x-gimp-gradient"));
+    reg->add(new KisResourceLoader<KoStopGradient>(ResourceSubType::StopGradients, ResourceType::Gradients, i18n("Gradients"), QStringList() << "application/x-karbon-gradient" << "image/svg+xml"));
+
+    reg->add(new KisResourceLoader<KoColorSet>(ResourceType::Palettes, ResourceType::Palettes, i18n("Palettes"),
+                                     QStringList() << KisMimeDatabase::mimeTypeForSuffix("kpl")
+                                               << KisMimeDatabase::mimeTypeForSuffix("gpl")
+                                               << KisMimeDatabase::mimeTypeForSuffix("pal")
+                                               << KisMimeDatabase::mimeTypeForSuffix("act")
+                                               << KisMimeDatabase::mimeTypeForSuffix("aco")
+                                               << KisMimeDatabase::mimeTypeForSuffix("css")
+                                               << KisMimeDatabase::mimeTypeForSuffix("colors")
+                                               << KisMimeDatabase::mimeTypeForSuffix("xml")
+                                               << KisMimeDatabase::mimeTypeForSuffix("sbz")));
+#endif
+
+#if defined (TESTFLAKE) || defined(TESTBRUSH) || defined(TESTIMAGE) || defined(TESTUI)
+#if defined HAVE_SEEXPR
+    reg->add(new KisResourceLoader<KisSeExprScript>(ResourceType::SeExprScripts, ResourceType::SeExprScripts, i18n("SeExpr Scripts"), QStringList() << "application/x-krita-seexpr-script"));
+#endif
+    reg->add(new KisResourceLoader<KoGamutMask>(ResourceType::GamutMasks, ResourceType::GamutMasks, i18n("Gamut masks"), QStringList() << "application/x-krita-gamutmasks"));
+    reg->add(new KisResourceLoader<KoSvgSymbolCollectionResource>(ResourceType::Symbols, ResourceType::Symbols, i18n("SVG symbol libraries"), QStringList() << "image/svg+xml"));
+#endif
+
+#if defined(TESTBRUSH) || defined(TESTIMAGE) || defined(TESTUI)
+
+    reg->add(new KisResourceLoader<KisGbrBrush>(ResourceSubType::GbrBrushes, ResourceType::Brushes, i18n("Brush tips"), QStringList() << "image/x-gimp-brush"));
+    reg->add(new KisResourceLoader<KisImagePipeBrush>(ResourceSubType::GihBrushes, ResourceType::Brushes, i18n("Brush tips"), QStringList() << "image/x-gimp-brush-animated"));
+    reg->add(new KisResourceLoader<KisSvgBrush>(ResourceSubType::SvgBrushes, ResourceType::Brushes, i18n("Brush tips"), QStringList() << "image/svg+xml"));
+    reg->add(new KisResourceLoader<KisPngBrush>(ResourceSubType::PngBrushes, ResourceType::Brushes, i18n("Brush tips"), QStringList() << "image/png"));
+
+#endif
+
+#if defined(TESTIMAGE) || defined(TESTUI)
+     reg->add(new KisResourceLoader<KisPaintOpPreset>(ResourceType::PaintOpPresets, ResourceType::PaintOpPresets, i18n("Brush presets"), QStringList() << "application/x-krita-paintoppreset"));
+     reg->add(new KisResourceLoader<KisPSDLayerStyle>(ResourceType::LayerStyles,
+                                                     ResourceType::LayerStyles,
+                                                     ResourceType::LayerStyles,
+                                                     QStringList() << "application/x-photoshop-style"));
+#endif
+
+
+#if defined(TESTUI)
+    reg->add(new KisResourceLoader<KisWindowLayoutResource>(ResourceType::WindowLayouts, ResourceType::WindowLayouts, i18n("Window layouts"), QStringList() << "application/x-krita-windowlayout"));
+    reg->add(new KisResourceLoader<KisSessionResource>(ResourceType::Sessions, ResourceType::Sessions, i18n("Sessions"), QStringList() << "application/x-krita-session"));
+    reg->add(new KisResourceLoader<KisWorkspaceResource>(ResourceType::Workspaces, ResourceType::Workspaces, i18n("Workspaces"), QStringList() << "application/x-krita-workspace"));
+#endif
+
+#if defined (TESTRESOURCES) || defined(TESTPIGMENT) || defined (TESTFLAKE) || defined(TESTBRUSH) || defined(TESTIMAGE) || defined(TESTUI)
+    if (!KisResourceCacheDb::initialize(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation))) {
+        qFatal("Could not initialize the resource cachedb");
+    }
+
+    KisResourceLocator::LocatorError r = KisResourceLocator::instance()->initialize(KoResourcePaths::getApplicationRoot() + "/share/krita");
+#endif
+
+}
+
+#endif // TESTRESOURCES_H
diff --git a/sdk/tests/filestest.h b/sdk/tests/filestest.h
index 0b8babccd6..efcfd863fe 100644
--- a/sdk/tests/filestest.h
+++ b/sdk/tests/filestest.h
@@ -18,7 +18,8 @@
 #ifndef FILESTEST
 #define FILESTEST
 
-#include "testutil.h"
+#include <testutil.h>
+#include "testui.h"
 
 #include <QDir>
 
diff --git a/sdk/tests/kistest.h b/sdk/tests/kistest.h
index 4627427f19..5cb3f81bf7 100644
--- a/sdk/tests/kistest.h
+++ b/sdk/tests/kistest.h
@@ -26,6 +26,33 @@
 #include <QtTest/qtestsystem.h>
 #include <set>
 
+/**
+ * There is a hierarchy of libraries built on the kritaresources library
+ * that provide resources:
+ *
+ * pigment: kocolorset, kosegmentgradient, kostopgradient, kopattern
+ *   flake: koseexprscript, kogamutmask, kosvgsymbolcollection
+ *     image: kispaintoppreset, kispsdlayerstyle
+ *       brush: kisgbrbrush, kisimagepipebrush, kissvgbrush, kispngbrush
+ *         ui: kiswindowloyout, kissession, kisworkspace
+ *
+ * Depending on which library the test links again, it should use
+ *
+ *  testresources.h
+ *  testpigment.h
+ *  testflake.h
+ *  testimage.h
+ *  testbrush.h
+ *  testui.h
+ *
+ * To get the right KISTEST_MAIN for the resources it needs access to.
+ *
+ * This means that adding a new resource means not only adding it in
+ * KisApplication, but also this file.
+ */
+
+
+
 #if defined(QT_NETWORK_LIB)
 #  include <QtTest/qtest_network.h>
 #endif
@@ -37,22 +64,250 @@
 #  define QTEST_DISABLE_KEYPAD_NAVIGATION
 #endif
 
+#if defined(TESTRESOURCES) || defined(TESTPIGMENT) || defined (TESTFLAKE) || defined(TESTBRUSH) || defined(TESTIMAGE) || defined(TESTUI)
+#include <QImageReader>
+#include <QList>
+#include <QByteArray>
+#include <QStringList>
+#include <QStandardPaths>
+#include <QString>
+#include <QDir>
+#include <QStandardPaths>
+#include <QImageWriter>
+
+#include <KisResourceTypes.h>
+#include <KisResourceLoaderRegistry.h>
+#include <KisMimeDatabase.h>
+#include <KisResourceLoader.h>
+#include <KisResourceCacheDb.h>
+#include <KisResourceLocator.h>
+#include <KoResourcePaths.h>
+
+
+
+#if defined(TESTRESOURCES) || defined(TESTPIGMENT) || defined (TESTFLAKE) || defined(TESTIMAGE) || defined(TESTBRUSH) || defined(TESTUI)
+#include <resources/KoSegmentGradient.h>
+#include <resources/KoStopGradient.h>
+#include <resources/KoColorSet.h>
+#include <resources/KoPattern.h>
+#endif
+
+#if defined (TESTFLAKE) || defined(TESTIMAGE) || defined(TESTBRUSH) || defined(TESTUI)
+#if defined HAVE_SEEXPR
+#include <KisSeExprScript.h>
+#endif
+#include <resources/KoGamutMask.h>
+#include <resources/KoSvgSymbolCollectionResource.h>
+#endif
+
+#if defined(TESTIMAGE) || defined(TESTBRUSH) || defined(TESTUI)
+#include <kis_paintop_preset.h>
+#include <kis_psd_layer_style.h>
+#endif
+
+#if defined(TESTBRUSH) || defined(TESTUI)
+#include <kis_gbr_brush.h>
+#include <kis_imagepipe_brush.h>
+#include <kis_svg_brush.h>
+#include <kis_png_brush.h>
+#endif
+
+#if defined(TESTUI)
+#include <KisWindowLayoutResource.h>
+#include <kis_workspace_resource.h>
+#include <KisSessionResource.h>
+#endif
+
+namespace {
+
+void addResourceTypes()
+{
+#if defined(TESTRESOURCES) || defined(TESTPIGMENT) || defined (TESTFLAKE) || defined(TESTIMAGE) || defined(TESTBRUSH) || defined(TESTUI)
+    // All Krita's resource types
+    KoResourcePaths::addResourceType("markers", "data", "/styles/");
+    KoResourcePaths::addResourceType("kis_pics", "data", "/pics/");
+    KoResourcePaths::addResourceType("kis_images", "data", "/images/");
+    KoResourcePaths::addResourceType("metadata_schema", "data", "/metadata/schemas/");
+    KoResourcePaths::addResourceType(ResourceType::Brushes, "data", "/brushes/");
+    KoResourcePaths::addResourceType("kis_taskset", "data", "/taskset/");
+    KoResourcePaths::addResourceType("kis_taskset", "data", "/taskset/");
+    KoResourcePaths::addResourceType("gmic_definitions", "data", "/gmic/");
+    KoResourcePaths::addResourceType("kis_resourcebundles", "data", "/bundles/");
+    KoResourcePaths::addResourceType("kis_defaultpresets", "data", "/defaultpresets/");
+    KoResourcePaths::addResourceType(ResourceType::PaintOpPresets, "data", "/paintoppresets/");
+    KoResourcePaths::addResourceType(ResourceType::Workspaces, "data", "/workspaces/");
+    KoResourcePaths::addResourceType(ResourceType::WindowLayouts, "data", "/windowlayouts/");
+    KoResourcePaths::addResourceType(ResourceType::Sessions, "data", "/sessions/");
+    KoResourcePaths::addResourceType("psd_layer_style_collections", "data", "/asl");
+    KoResourcePaths::addResourceType(ResourceType::Patterns, "data", "/patterns/", true);
+    KoResourcePaths::addResourceType(ResourceType::Gradients, "data", "/gradients/");
+    KoResourcePaths::addResourceType(ResourceType::Gradients, "data", "/gradients/", true);
+    KoResourcePaths::addResourceType(ResourceType::Palettes, "data", "/palettes/", true);
+    KoResourcePaths::addResourceType("kis_shortcuts", "data", "/shortcuts/");
+    KoResourcePaths::addResourceType("kis_actions", "data", "/actions");
+    KoResourcePaths::addResourceType("kis_actions", "data", "/pykrita");
+    KoResourcePaths::addResourceType("icc_profiles", "data", "/color/icc");
+    KoResourcePaths::addResourceType("icc_profiles", "data", "/profiles/");
+    KoResourcePaths::addResourceType(ResourceType::FilterEffects, "data", "/effects/");
+    KoResourcePaths::addResourceType("tags", "data", "/tags/");
+    KoResourcePaths::addResourceType("templates", "data", "/templates");
+    KoResourcePaths::addResourceType("pythonscripts", "data", "/pykrita");
+    KoResourcePaths::addResourceType(ResourceType::Symbols, "data", "/symbols");
+    KoResourcePaths::addResourceType("preset_icons", "data", "/preset_icons");
+    KoResourcePaths::addResourceType(ResourceType::GamutMasks, "data", "/gamutmasks/", true);
+#if defined HAVE_SEEXPR
+    KoResourcePaths::addResourceType(ResourceType::SeExprScripts, "data", "/seexpr_scripts/", true);
+#endif
+
+    //    // Extra directories to look for create resources. (Does anyone actually use that anymore?)
+    //    KoResourcePaths::addResourceDir(ResourceType::Gradients, "/usr/share/create/gradients/gimp");
+    //    KoResourcePaths::addResourceDir(ResourceType::Gradients, QDir::homePath() + QString("/.create/gradients/gimp"));
+    //    KoResourcePaths::addResourceDir(ResourceType::Patterns, "/usr/share/create/patterns/gimp");
+    //    KoResourcePaths::addResourceDir(ResourceType::Patterns, QDir::homePath() + QString("/.create/patterns/gimp"));
+    //    KoResourcePaths::addResourceDir(ResourceType::Brushes, "/usr/share/create/brushes/gimp");
+    //    KoResourcePaths::addResourceDir(ResourceType::Brushes, QDir::homePath() + QString("/.create/brushes/gimp"));
+    //    KoResourcePaths::addResourceDir(ResourceType::Palettes, "/usr/share/create/swatches");
+    //    KoResourcePaths::addResourceDir(ResourceType::Palettes, QDir::homePath() + QString("/.create/swatches"));
+
+    // Make directories for all resources we can save, and tags
+    QDir d;
+    d.mkpath(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/tags/");
+    d.mkpath(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/asl/");
+    d.mkpath(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/bundles/");
+    d.mkpath(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/brushes/");
+    d.mkpath(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/gradients/");
+    d.mkpath(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/paintoppresets/");
+    d.mkpath(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/palettes/");
+    d.mkpath(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/patterns/");
+    // between 4.2.x and 4.3.0 there was a change from 'taskset' to 'tasksets'
+    // so to make older resource folders compatible with the new version, let's rename the folder
+    // so no tasksets are lost.
+    if (d.exists(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/taskset/")) {
+        d.rename(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/taskset/",
+                 QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/tasksets/");
+    }
+    d.mkpath(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/tasksets/");
+    d.mkpath(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/workspaces/");
+    d.mkpath(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/input/");
+    d.mkpath(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/pykrita/");
+    d.mkpath(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/symbols/");
+    d.mkpath(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/color-schemes/");
+    d.mkpath(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/preset_icons/");
+    d.mkpath(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/preset_icons/tool_icons/");
+    d.mkpath(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/preset_icons/emblem_icons/");
+    d.mkpath(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/gamutmasks/");
+#if defined HAVE_SEEXPR
+    d.mkpath(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/seexpr_scripts/");
+#endif
+#endif
+
+}
+
+void registerResources()
+{
+
+#if defined(TESTRESOURCES) || defined(TESTPIGMENT) || defined (TESTFLAKE) || defined(TESTIMAGE) || defined(TESTBRUSH) || defined(TESTUI)
+
+    addResourceTypes();
+
+    KisResourceLoaderRegistry *reg = KisResourceLoaderRegistry::instance();
+
+    QList<QByteArray> src = QImageReader::supportedMimeTypes();
+    QStringList allImageMimes;
+    Q_FOREACH(const QByteArray ba, src) {
+        if (QImageWriter::supportedMimeTypes().contains(ba)) {
+            allImageMimes << QString::fromUtf8(ba);
+        }
+    }
+    allImageMimes << KisMimeDatabase::mimeTypeForSuffix("pat");
+
+    reg->add(new KisResourceLoader<KoPattern>(ResourceType::Patterns, ResourceType::Patterns, i18n("Patterns"), allImageMimes));
+    reg->add(new KisResourceLoader<KoSegmentGradient>(ResourceSubType::SegmentedGradients, ResourceType::Gradients, i18n("Gradients"), QStringList() << "application/x-gimp-gradient"));
+    reg->add(new KisResourceLoader<KoStopGradient>(ResourceSubType::StopGradients, ResourceType::Gradients, i18n("Gradients"), QStringList() << "application/x-karbon-gradient" << "image/svg+xml"));
+
+    reg->add(new KisResourceLoader<KoColorSet>(ResourceType::Palettes, ResourceType::Palettes, i18n("Palettes"),
+                                     QStringList() << KisMimeDatabase::mimeTypeForSuffix("kpl")
+                                               << KisMimeDatabase::mimeTypeForSuffix("gpl")
+                                               << KisMimeDatabase::mimeTypeForSuffix("pal")
+                                               << KisMimeDatabase::mimeTypeForSuffix("act")
+                                               << KisMimeDatabase::mimeTypeForSuffix("aco")
+                                               << KisMimeDatabase::mimeTypeForSuffix("css")
+                                               << KisMimeDatabase::mimeTypeForSuffix("colors")
+                                               << KisMimeDatabase::mimeTypeForSuffix("xml")
+                                               << KisMimeDatabase::mimeTypeForSuffix("sbz")));
+#endif
+
+#if defined (TESTFLAKE) || defined(TESTIMAGE) || defined(TESTBRUSH) || defined(TESTUI)
+#if defined HAVE_SEEXPR
+    reg->add(new KisResourceLoader<KisSeExprScript>(ResourceType::SeExprScripts, ResourceType::SeExprScripts, i18n("SeExpr Scripts"), QStringList() << "application/x-krita-seexpr-script"));
+#endif
+    reg->add(new KisResourceLoader<KoGamutMask>(ResourceType::GamutMasks, ResourceType::GamutMasks, i18n("Gamut masks"), QStringList() << "application/x-krita-gamutmasks"));
+    reg->add(new KisResourceLoader<KoSvgSymbolCollectionResource>(ResourceType::Symbols, ResourceType::Symbols, i18n("SVG symbol libraries"), QStringList() << "image/svg+xml"));
+#endif
+
+
+#if defined(TESTIMAGE) || defined(TESTBRUSH) || defined(TESTUI)
+     reg->add(new KisResourceLoader<KisPaintOpPreset>(ResourceType::PaintOpPresets, ResourceType::PaintOpPresets, i18n("Brush presets"), QStringList() << "application/x-krita-paintoppreset"));
+     reg->add(new KisResourceLoader<KisPSDLayerStyle>(ResourceType::LayerStyles,
+                                                     ResourceType::LayerStyles,
+                                                     ResourceType::LayerStyles,
+                                                     QStringList() << "application/x-photoshop-style"));
+#endif
+
+#if defined(TESTBRUSH) || defined(TESTUI)
+
+    reg->add(new KisResourceLoader<KisGbrBrush>(ResourceSubType::GbrBrushes, ResourceType::Brushes, i18n("Brush tips"), QStringList() << "image/x-gimp-brush"));
+    reg->add(new KisResourceLoader<KisImagePipeBrush>(ResourceSubType::GihBrushes, ResourceType::Brushes, i18n("Brush tips"), QStringList() << "image/x-gimp-brush-animated"));
+    reg->add(new KisResourceLoader<KisSvgBrush>(ResourceSubType::SvgBrushes, ResourceType::Brushes, i18n("Brush tips"), QStringList() << "image/svg+xml"));
+    reg->add(new KisResourceLoader<KisPngBrush>(ResourceSubType::PngBrushes, ResourceType::Brushes, i18n("Brush tips"), QStringList() << "image/png"));
+
+#endif
+
+#if defined(TESTUI)
+    reg->add(new KisResourceLoader<KisWindowLayoutResource>(ResourceType::WindowLayouts, ResourceType::WindowLayouts, i18n("Window layouts"), QStringList() << "application/x-krita-windowlayout"));
+    reg->add(new KisResourceLoader<KisSessionResource>(ResourceType::Sessions, ResourceType::Sessions, i18n("Sessions"), QStringList() << "application/x-krita-session"));
+    reg->add(new KisResourceLoader<KisWorkspaceResource>(ResourceType::Workspaces, ResourceType::Workspaces, i18n("Workspaces"), QStringList() << "application/x-krita-workspace"));
+#endif
+
+#if defined(TESTRESOURCES) || defined(TESTPIGMENT) || defined (TESTFLAKE) || defined(TESTBRUSH) || defined(TESTIMAGE) || defined(TESTUI)
+    if (!KisResourceCacheDb::initialize(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation))) {
+        qFatal("Could not initialize the resource cachedb");
+    }
+
+    KisResourceLocator::instance()->initialize(KoResourcePaths::getApplicationRoot() + "/share/krita");
+#endif
+
+}
+
 #define KISTEST_MAIN(TestObject) \
 int main(int argc, char *argv[]) \
 { \
     qputenv("QT_LOGGING_RULES", ""); \
-    QLoggingCategory::setFilterRules(QStringLiteral("krita.*.debug=false"));\
     qputenv("EXTRA_RESOURCE_DIRS", QByteArray(KRITA_EXTRA_RESOURCE_DIRS)); \
     QApplication app(argc, argv); \
     app.setAttribute(Qt::AA_Use96Dpi, true); \
     QTEST_DISABLE_KEYPAD_NAVIGATION \
+    registerResources(); \
     TestObject tc; \
     QTEST_SET_MAIN_SOURCE_PATH \
     return QTest::qExec(&tc, argc, argv); \
 }
 
-
-
+}
+#else
+#define KISTEST_MAIN(TestObject) \
+int main(int argc, char *argv[]) \
+{ \
+    qputenv("QT_LOGGING_RULES", ""); \
+    qputenv("EXTRA_RESOURCE_DIRS", QByteArray(KRITA_EXTRA_RESOURCE_DIRS)); \
+    QApplication app(argc, argv); \
+    app.setAttribute(Qt::AA_Use96Dpi, true); \
+    QTEST_DISABLE_KEYPAD_NAVIGATION \
+    TestObject tc; \
+    QTEST_SET_MAIN_SOURCE_PATH \
+    return QTest::qExec(&tc, argc, argv); \
+}
+#endif
 
 
 #endif
diff --git a/sdk/tests/qimage_based_test.h b/sdk/tests/qimage_based_test.h
index feef461cb3..725e0a2095 100644
--- a/sdk/tests/qimage_based_test.h
+++ b/sdk/tests/qimage_based_test.h
@@ -23,7 +23,7 @@
 #define USE_DOCUMENT 1
 #endif /* USE_DOCUMENT */
 
-#include "testutil.h"
+#include <testutil.h>
 
 
 #include <KoColorSpace.h>
diff --git a/sdk/tests/stroke_testing_utils.cpp b/sdk/tests/stroke_testing_utils.cpp
index 144512301f..01e97195f5 100644
--- a/sdk/tests/stroke_testing_utils.cpp
+++ b/sdk/tests/stroke_testing_utils.cpp
@@ -34,7 +34,7 @@
 #include "kis_group_layer.h"
 #include <KisViewManager.h>
 
-#include "testutil.h"
+#include <testutil.h>
 #include <KisGlobalResourcesInterface.h>
 
 
diff --git a/sdk/tests/testbrush.h b/sdk/tests/testbrush.h
new file mode 100644
index 0000000000..48ab0f6eaa
--- /dev/null
+++ b/sdk/tests/testbrush.h
@@ -0,0 +1,2 @@
+#define TESTBRUSH
+#include <sdk/tests/kistest.h>
diff --git a/sdk/tests/testflake.h b/sdk/tests/testflake.h
new file mode 100644
index 0000000000..7266c249a5
--- /dev/null
+++ b/sdk/tests/testflake.h
@@ -0,0 +1,2 @@
+#define TESTFLAKE
+#include <sdk/tests/kistest.h>
diff --git a/sdk/tests/testimage.h b/sdk/tests/testimage.h
new file mode 100644
index 0000000000..24b2d4fd73
--- /dev/null
+++ b/sdk/tests/testimage.h
@@ -0,0 +1,2 @@
+#define TESTIMAGE
+#include <sdk/tests/kistest.h>
diff --git a/sdk/tests/testpigment.h b/sdk/tests/testpigment.h
new file mode 100644
index 0000000000..41707e9306
--- /dev/null
+++ b/sdk/tests/testpigment.h
@@ -0,0 +1,2 @@
+#define TESTPIGMENT
+#include <sdk/tests/kistest.h>
diff --git a/sdk/tests/testresources.h b/sdk/tests/testresources.h
new file mode 100644
index 0000000000..f7e85c5068
--- /dev/null
+++ b/sdk/tests/testresources.h
@@ -0,0 +1,2 @@
+#define TESTRESOURCES
+#include <sdk/tests/kistest.h>
diff --git a/sdk/tests/testui.h b/sdk/tests/testui.h
new file mode 100644
index 0000000000..e905b0f257
--- /dev/null
+++ b/sdk/tests/testui.h
@@ -0,0 +1,2 @@
+#define TESTUI
+#include "sdk/tests/kistest.h"
diff --git a/sdk/tests/testutil.cpp b/sdk/tests/testutil.cpp
index f1255cb1df..930cad88e6 100644
--- a/sdk/tests/testutil.cpp
+++ b/sdk/tests/testutil.cpp
@@ -17,7 +17,7 @@
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  */
 
-#include "testutil.h"
+#include <testutil.h>
 
 namespace TestUtil
 {
diff --git a/sdk/tests/testutil.h b/sdk/tests/testutil.h
index f3a8e9b48e..e71a1f4150 100644
--- a/sdk/tests/testutil.h
+++ b/sdk/tests/testutil.h
@@ -38,8 +38,6 @@
 #include "kis_image.h"
 #include "testing_nodes.h"
 
-#include "kistest.h"
-
 #ifndef FILES_DATA_DIR
 #define FILES_DATA_DIR "."
 #endif
diff --git a/sdk/tests/ui_manager_test.h b/sdk/tests/ui_manager_test.h
index 63224f510d..ab91d21734 100644
--- a/sdk/tests/ui_manager_test.h
+++ b/sdk/tests/ui_manager_test.h
@@ -19,7 +19,7 @@
 #ifndef __UI_MANAGER_TEST_H
 #define __UI_MANAGER_TEST_H
 
-#include "testutil.h"
+#include <testutil.h>
 #include "qimage_based_test.h"
 #include "ksharedconfig.h"
 #include <kis_filter_configuration.h>


More information about the kimageshop mailing list