diff --git a/CMakeLists.txt b/CMakeLists.txt index 4ade416..28369b0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -182,6 +182,10 @@ add_feature_info("Foundation Build" FOUNDATION_BUILD "A Foundation build is a bi option(KRITA_ENABLE_BROKEN_TESTS "Enable tests that are marked as broken" OFF) add_feature_info("Enable Broken Tests" KRITA_ENABLE_BROKEN_TESTS "Runs broken test when \"make test\" is invoked (use -DKRITA_ENABLE_BROKEN_TESTS=ON to enable).") +option(LIMIT_LONG_TESTS "Run long running unittests in a limited quick mode" ON) +configure_file(config-limit-long-tests.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-limit-long-tests.h) +add_feature_info("Limit long tests" LIMIT_LONG_TESTS "Run long running unittests in a limited quick mode") + option(ENABLE_PYTHON_2 "Enables the compiler to look for Python 2.7 instead of Python 3. Some packaged scripts are not compatible with Python 2 and this should only be used if you really have to use 2.7." OFF) option(BUILD_KRITA_QT_DESIGNER_PLUGINS "Build Qt Designer plugins for Krita widgets" OFF) diff --git a/config-limit-long-tests.h.cmake b/config-limit-long-tests.h.cmake new file mode 100644 index 0000000..6474254 --- /dev/null +++ b/config-limit-long-tests.h.cmake @@ -0,0 +1,4 @@ +/* config-limit-long-tests.h. Generated by cmake from config-limit-long-tests.h.cmake */ + +/* Define if you want long tests to run in a limited quick mode */ +#cmakedefine LIMIT_LONG_TESTS 1 diff --git a/libs/image/tests/kis_mask_similarity_test.cpp b/libs/image/tests/kis_mask_similarity_test.cpp index 8ca97f1..0d5d463 100644 --- a/libs/image/tests/kis_mask_similarity_test.cpp +++ b/libs/image/tests/kis_mask_similarity_test.cpp @@ -29,6 +29,17 @@ #include "kis_cubic_curve.h" #include "krita_utils.h" +#include "config-limit-long-tests.h" + +#if LIMIT_LONG_TESTS +#define RATIO_STEP 50 +#define FADE_STEP 25 +#else /* LIMIT_LONG_TESTS */ +#define RATIO_STEP 20 +#define FADE_STEP 5 +#endif /* LIMIT_LONG_TESTS */ + + enum MaskType { DEFAULT, CIRC_GAUSS, CIRC_SOFT, RECT_GAUSS, RECT_SOFT, STAMP }; @@ -79,9 +90,9 @@ public: static void exahustiveTest(QRect bounds, MaskType type) { // Exahustive test - for (size_t i = 0; i <= 100; i += 5){ - for (size_t j = 0; j <= 100; j += 5){ - for (size_t k = 0; k <= 100; k += 20){ + for (size_t i = 0; i <= 100; i += FADE_STEP){ + for (size_t j = 0; j <= 100; j += FADE_STEP){ + for (size_t k = 0; k <= 100; k += RATIO_STEP){ switch (type) { case CIRC_GAUSS: