From 19353c9857d1e26c6508c2fc7dd530e6ee0ef316 Mon Sep 17 00:00:00 2001 From: Alex Merry Date: Sat, 14 Mar 2015 12:44:49 +0000 Subject: Warn about icon filenames with leading characters. Through a quirk of implementation, old-style icon filenames are accepted by the new-style ecm_install_icons function. It's too late to change it now, as that would break existing projects, but we can warn about it. REVIEW: 122941 --- tests/ECMInstallIconsTest/16-apps-cmake.png | Bin 233 -> 0 bytes tests/ECMInstallIconsTest/CMakeLists.txt | 15 ++++++++------- .../hicolor/16x16/actions/old-style-name.png | Bin 0 -> 233 bytes .../ECMInstallIconsTest/hi16-actions-old-style-name.png | Bin 0 -> 233 bytes tests/ECMInstallIconsTest/subdir/16-apps-cmake.png | Bin 0 -> 233 bytes 5 files changed, 8 insertions(+), 7 deletions(-) delete mode 100644 tests/ECMInstallIconsTest/16-apps-cmake.png create mode 100644 tests/ECMInstallIconsTest/expected-tree/badly-named-files-test/hicolor/16x16/actions/old-style-name.png create mode 100644 tests/ECMInstallIconsTest/hi16-actions-old-style-name.png create mode 100644 tests/ECMInstallIconsTest/subdir/16-apps-cmake.png (limited to 'tests/ECMInstallIconsTest') diff --git a/tests/ECMInstallIconsTest/16-apps-cmake.png b/tests/ECMInstallIconsTest/16-apps-cmake.png deleted file mode 100644 index ed9a1181..00000000 Binary files a/tests/ECMInstallIconsTest/16-apps-cmake.png and /dev/null differ diff --git a/tests/ECMInstallIconsTest/CMakeLists.txt b/tests/ECMInstallIconsTest/CMakeLists.txt index 85f2d9f5..7fe4ca35 100644 --- a/tests/ECMInstallIconsTest/CMakeLists.txt +++ b/tests/ECMInstallIconsTest/CMakeLists.txt @@ -20,7 +20,7 @@ ecm_install_icons( ICONS 16-actions-computer.png 16-animations-loading.mng - 16-apps-cmake.png + subdir/16-apps-cmake.png 16-categories-system-help.mng 16-emotes-face-smile.png 16-intl-something.png @@ -36,7 +36,7 @@ ecm_install_icons( ICONS 16-actions-computer.png 16-animations-loading.mng - 16-apps-cmake.png + subdir/16-apps-cmake.png 16-categories-system-help.mng 16-emotes-face-smile.png 16-intl-something.png @@ -53,7 +53,7 @@ ecm_install_icons( ICONS 16-actions-computer.png 16-animations-loading.mng - 16-apps-cmake.png + subdir/16-apps-cmake.png 16-categories-system-help.mng 16-emotes-face-smile.png 16-intl-something.png @@ -70,7 +70,7 @@ ecm_install_icons( ICONS 16-actions-computer.png 16-animations-loading.mng - 16-apps-cmake.png + subdir/16-apps-cmake.png 16-categories-system-help.mng 16-emotes-face-smile.png 16-intl-something.png @@ -87,9 +87,10 @@ ecm_install_icons( # all these should be warned about ecm_install_icons( ICONS - aa-actions-badsize.png # ignored - badlynamedfile.png # ignored - 16-actions-badext.txt # copied + aa-actions-badsize.png # ignored + badlynamedfile.png # ignored + 16-actions-badext.txt # copied + hi16-actions-old-style-name.png # copied DESTINATION badly-named-files-test ) diff --git a/tests/ECMInstallIconsTest/expected-tree/badly-named-files-test/hicolor/16x16/actions/old-style-name.png b/tests/ECMInstallIconsTest/expected-tree/badly-named-files-test/hicolor/16x16/actions/old-style-name.png new file mode 100644 index 00000000..ed9a1181 Binary files /dev/null and b/tests/ECMInstallIconsTest/expected-tree/badly-named-files-test/hicolor/16x16/actions/old-style-name.png differ diff --git a/tests/ECMInstallIconsTest/hi16-actions-old-style-name.png b/tests/ECMInstallIconsTest/hi16-actions-old-style-name.png new file mode 100644 index 00000000..ed9a1181 Binary files /dev/null and b/tests/ECMInstallIconsTest/hi16-actions-old-style-name.png differ diff --git a/tests/ECMInstallIconsTest/subdir/16-apps-cmake.png b/tests/ECMInstallIconsTest/subdir/16-apps-cmake.png new file mode 100644 index 00000000..ed9a1181 Binary files /dev/null and b/tests/ECMInstallIconsTest/subdir/16-apps-cmake.png differ -- cgit v1.2.1 From fb7b8eea7d91772f989d5b060c86df20f2ebdb66 Mon Sep 17 00:00:00 2001 From: Alex Merry Date: Wed, 14 Oct 2015 12:10:31 +0100 Subject: Fix ECMInstallIconsTest. ECMInstallIcons now updates the theme cache if gtk-update-icon-cache is available, producing files the test hadn't been expecting.. Updating the test revealed that the old-style ecm_install_icons call only updated the hicolor cache, and not any of the other themes. REVIEW: 125631 --- tests/ECMInstallIconsTest/CMakeLists.txt | 7 +++++++ tests/ECMInstallIconsTest/check_tree.cmake.in | 7 +++++++ .../badly-named-files-test/hicolor/icon-theme.cache | Bin 0 -> 124 bytes .../expected-tree/lang-test/hicolor/icon-theme.cache | Bin 0 -> 548 bytes .../multi-file-test/hicolor/icon-theme.cache | Bin 0 -> 472 bytes .../single-file-test/hicolor/icon-theme.cache | Bin 0 -> 120 bytes .../themed-lang-test/oxygen/icon-theme.cache | Bin 0 -> 548 bytes .../themed-test/theme-name-2/icon-theme.cache | Bin 0 -> 472 bytes .../expected-tree/v1-icons/crystalsvg/icon-theme.cache | Bin 0 -> 164 bytes .../expected-tree/v1-icons/hicolor/icon-theme.cache | Bin 0 -> 452 bytes 10 files changed, 14 insertions(+) create mode 100644 tests/ECMInstallIconsTest/expected-tree/badly-named-files-test/hicolor/icon-theme.cache create mode 100644 tests/ECMInstallIconsTest/expected-tree/lang-test/hicolor/icon-theme.cache create mode 100644 tests/ECMInstallIconsTest/expected-tree/multi-file-test/hicolor/icon-theme.cache create mode 100644 tests/ECMInstallIconsTest/expected-tree/single-file-test/hicolor/icon-theme.cache create mode 100644 tests/ECMInstallIconsTest/expected-tree/themed-lang-test/oxygen/icon-theme.cache create mode 100644 tests/ECMInstallIconsTest/expected-tree/themed-test/theme-name-2/icon-theme.cache create mode 100644 tests/ECMInstallIconsTest/expected-tree/v1-icons/crystalsvg/icon-theme.cache create mode 100644 tests/ECMInstallIconsTest/expected-tree/v1-icons/hicolor/icon-theme.cache (limited to 'tests/ECMInstallIconsTest') diff --git a/tests/ECMInstallIconsTest/CMakeLists.txt b/tests/ECMInstallIconsTest/CMakeLists.txt index 7fe4ca35..738cba91 100644 --- a/tests/ECMInstallIconsTest/CMakeLists.txt +++ b/tests/ECMInstallIconsTest/CMakeLists.txt @@ -94,5 +94,12 @@ ecm_install_icons( DESTINATION badly-named-files-test ) +find_program(icon_cache_generator NAMES gtk-update-icon-cache) +if (icon_cache_generator) + set(GENERATE_ICON_CACHE TRUE) +else() + set(GENERATE_ICON_CACHE FALSE) +endif() + # this will be run by CTest configure_file(check_tree.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/check_tree.cmake" @ONLY) diff --git a/tests/ECMInstallIconsTest/check_tree.cmake.in b/tests/ECMInstallIconsTest/check_tree.cmake.in index 6d14246b..b9da1715 100644 --- a/tests/ECMInstallIconsTest/check_tree.cmake.in +++ b/tests/ECMInstallIconsTest/check_tree.cmake.in @@ -1,8 +1,15 @@ set(EXP_TREE "@CMAKE_CURRENT_SOURCE_DIR@/expected-tree") set(ACTUAL_TREE "@CMAKE_INSTALL_PREFIX@") +set(GENERATE_ICON_CACHE "@GENERATE_ICON_CACHE@") file(GLOB_RECURSE exp_files RELATIVE "${EXP_TREE}" "${EXP_TREE}/*") file(GLOB_RECURSE actual_files RELATIVE "${ACTUAL_TREE}" "${ACTUAL_TREE}/*") +if (NOT GENERATE_ICON_CACHE) + file(GLOB_RECURSE cache_files RELATIVE "${EXP_TREE}" "${EXP_TREE}/*.cache") + foreach(f ${cache_files}) + list(REMOVE_ITEM exp_files "${f}") + endforeach() +endif() list(SORT exp_files) list(SORT actual_files) diff --git a/tests/ECMInstallIconsTest/expected-tree/badly-named-files-test/hicolor/icon-theme.cache b/tests/ECMInstallIconsTest/expected-tree/badly-named-files-test/hicolor/icon-theme.cache new file mode 100644 index 00000000..50d52976 Binary files /dev/null and b/tests/ECMInstallIconsTest/expected-tree/badly-named-files-test/hicolor/icon-theme.cache differ diff --git a/tests/ECMInstallIconsTest/expected-tree/lang-test/hicolor/icon-theme.cache b/tests/ECMInstallIconsTest/expected-tree/lang-test/hicolor/icon-theme.cache new file mode 100644 index 00000000..babadff0 Binary files /dev/null and b/tests/ECMInstallIconsTest/expected-tree/lang-test/hicolor/icon-theme.cache differ diff --git a/tests/ECMInstallIconsTest/expected-tree/multi-file-test/hicolor/icon-theme.cache b/tests/ECMInstallIconsTest/expected-tree/multi-file-test/hicolor/icon-theme.cache new file mode 100644 index 00000000..60ac05d6 Binary files /dev/null and b/tests/ECMInstallIconsTest/expected-tree/multi-file-test/hicolor/icon-theme.cache differ diff --git a/tests/ECMInstallIconsTest/expected-tree/single-file-test/hicolor/icon-theme.cache b/tests/ECMInstallIconsTest/expected-tree/single-file-test/hicolor/icon-theme.cache new file mode 100644 index 00000000..f385659f Binary files /dev/null and b/tests/ECMInstallIconsTest/expected-tree/single-file-test/hicolor/icon-theme.cache differ diff --git a/tests/ECMInstallIconsTest/expected-tree/themed-lang-test/oxygen/icon-theme.cache b/tests/ECMInstallIconsTest/expected-tree/themed-lang-test/oxygen/icon-theme.cache new file mode 100644 index 00000000..babadff0 Binary files /dev/null and b/tests/ECMInstallIconsTest/expected-tree/themed-lang-test/oxygen/icon-theme.cache differ diff --git a/tests/ECMInstallIconsTest/expected-tree/themed-test/theme-name-2/icon-theme.cache b/tests/ECMInstallIconsTest/expected-tree/themed-test/theme-name-2/icon-theme.cache new file mode 100644 index 00000000..60ac05d6 Binary files /dev/null and b/tests/ECMInstallIconsTest/expected-tree/themed-test/theme-name-2/icon-theme.cache differ diff --git a/tests/ECMInstallIconsTest/expected-tree/v1-icons/crystalsvg/icon-theme.cache b/tests/ECMInstallIconsTest/expected-tree/v1-icons/crystalsvg/icon-theme.cache new file mode 100644 index 00000000..8b9c8d0c Binary files /dev/null and b/tests/ECMInstallIconsTest/expected-tree/v1-icons/crystalsvg/icon-theme.cache differ diff --git a/tests/ECMInstallIconsTest/expected-tree/v1-icons/hicolor/icon-theme.cache b/tests/ECMInstallIconsTest/expected-tree/v1-icons/hicolor/icon-theme.cache new file mode 100644 index 00000000..ab56337b Binary files /dev/null and b/tests/ECMInstallIconsTest/expected-tree/v1-icons/hicolor/icon-theme.cache differ -- cgit v1.2.1 From 21629f651a6a5d9d977be03fd9f98417c4fa27ae Mon Sep 17 00:00:00 2001 From: Alex Merry Date: Tue, 3 Nov 2015 12:00:44 +0000 Subject: Warn instead of error if ecm_install_icons finds no icons. The V1 syntax of ecm_install_icons searched for icons by globbing files with a particular naming pattern. If there were no such icons, this used to do nothing, but silently. Commit fb7b8eea7d accidentally made this an error. More sensible would be to make it a warning. BUG: 354610 REVIEW: 125931 --- tests/ECMInstallIconsTest/CMakeLists.txt | 1 + tests/ECMInstallIconsTest/v1-syntax-no-icons/CMakeLists.txt | 1 + 2 files changed, 2 insertions(+) create mode 100644 tests/ECMInstallIconsTest/v1-syntax-no-icons/CMakeLists.txt (limited to 'tests/ECMInstallIconsTest') diff --git a/tests/ECMInstallIconsTest/CMakeLists.txt b/tests/ECMInstallIconsTest/CMakeLists.txt index 738cba91..f048889e 100644 --- a/tests/ECMInstallIconsTest/CMakeLists.txt +++ b/tests/ECMInstallIconsTest/CMakeLists.txt @@ -10,6 +10,7 @@ include(ECMInstallIcons) add_subdirectory(v1-syntax) add_subdirectory(v1-syntax-l10n) +add_subdirectory(v1-syntax-no-icons) ecm_install_icons( ICONS 16-actions-computer.png diff --git a/tests/ECMInstallIconsTest/v1-syntax-no-icons/CMakeLists.txt b/tests/ECMInstallIconsTest/v1-syntax-no-icons/CMakeLists.txt new file mode 100644 index 00000000..e0cacec2 --- /dev/null +++ b/tests/ECMInstallIconsTest/v1-syntax-no-icons/CMakeLists.txt @@ -0,0 +1 @@ +ecm_install_icons(v1-icons-dummy) -- cgit v1.2.1