Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package kf6-extra-cmake-modules for 
openSUSE:Factory checked in at 2026-01-12 10:11:00
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/kf6-extra-cmake-modules (Old)
 and      /work/SRC/openSUSE:Factory/.kf6-extra-cmake-modules.new.1928 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "kf6-extra-cmake-modules"

Mon Jan 12 10:11:00 2026 rev:23 rq:1326401 version:6.22.0

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/kf6-extra-cmake-modules/kf6-extra-cmake-modules.changes
  2025-12-16 15:54:34.406592438 +0100
+++ 
/work/SRC/openSUSE:Factory/.kf6-extra-cmake-modules.new.1928/kf6-extra-cmake-modules.changes
        2026-01-12 10:13:50.975066823 +0100
@@ -1,0 +2,12 @@
+Sun Jan  4 14:47:04 UTC 2026 - Christophe Marin <[email protected]>
+
+- Update to 6.22.0
+  * New feature release
+  * For more details please see:
+  * https://kde.org/announcements/frameworks/6/6.22.0
+- Changes since 6.21.0:
+  * FindInotify: fix comparison
+  * ECMAddTests: add functions and variables to preset test name prefix
+  * Update version to 6.22.0
+
+-------------------------------------------------------------------

Old:
----
  extra-cmake-modules-6.21.0.tar.xz
  extra-cmake-modules-6.21.0.tar.xz.sig

New:
----
  extra-cmake-modules-6.22.0.tar.xz
  extra-cmake-modules-6.22.0.tar.xz.sig

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ kf6-extra-cmake-modules.spec ++++++
--- /var/tmp/diff_new_pack.GpBPFe/_old  2026-01-12 10:13:53.363164889 +0100
+++ /var/tmp/diff_new_pack.GpBPFe/_new  2026-01-12 10:13:53.387165874 +0100
@@ -23,12 +23,12 @@
 
 %define rname extra-cmake-modules
 
-# Full KF6 version (e.g. 6.21.0)
+# Full KF6 version (e.g. 6.22.0)
 %{!?_kf6_version: %global _kf6_version %{version}}
 %bcond_without doc
 %bcond_without released
 Name:           kf6-extra-cmake-modules%{?pkg_suffix}
-Version:        6.21.0
+Version:        6.22.0
 Release:        0
 Summary:        CMake modules
 License:        BSD-3-Clause

++++++ extra-cmake-modules-6.21.0.tar.xz -> extra-cmake-modules-6.22.0.tar.xz 
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/extra-cmake-modules-6.21.0/CMakeLists.txt 
new/extra-cmake-modules-6.22.0/CMakeLists.txt
--- old/extra-cmake-modules-6.21.0/CMakeLists.txt       2025-12-05 
14:18:18.000000000 +0100
+++ new/extra-cmake-modules-6.22.0/CMakeLists.txt       2026-01-02 
18:40:05.000000000 +0100
@@ -11,7 +11,7 @@
 # Preliminary setup
 #
 
-set(VERSION "6.21.0") # handled by release scripts
+set(VERSION "6.22.0") # handled by release scripts
 
 project(ECM
     VERSION "${VERSION}"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/extra-cmake-modules-6.21.0/find-modules/FindInotify.cmake 
new/extra-cmake-modules-6.22.0/find-modules/FindInotify.cmake
--- old/extra-cmake-modules-6.21.0/find-modules/FindInotify.cmake       
2025-12-05 14:18:18.000000000 +0100
+++ new/extra-cmake-modules-6.22.0/find-modules/FindInotify.cmake       
2026-01-02 18:40:05.000000000 +0100
@@ -56,7 +56,7 @@
         cmake_path(GET Inotify_INCLUDE_DIRS PARENT_PATH includes_prefix)
         cmake_path(GET Inotify_LIBRARIES PARENT_PATH lib_prefix)
         cmake_path(GET lib_prefix PARENT_PATH lib_prefix)
-        cmake_path(COMPARE includes_prefix EQUAL lib_prefix prefixes_match)
+        cmake_path(COMPARE ${includes_prefix} EQUAL ${lib_prefix} 
prefixes_match)
 
         if(NOT prefixes_match)
             set(Inotify_FOUND TRUE)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/extra-cmake-modules-6.21.0/modules/ECMAddTests.cmake 
new/extra-cmake-modules-6.22.0/modules/ECMAddTests.cmake
--- old/extra-cmake-modules-6.21.0/modules/ECMAddTests.cmake    2025-12-05 
14:18:18.000000000 +0100
+++ new/extra-cmake-modules-6.22.0/modules/ECMAddTests.cmake    2026-01-02 
18:40:05.000000000 +0100
@@ -1,5 +1,6 @@
 # SPDX-FileCopyrightText: 2013 Alexander Richardson <[email protected]>
 # SPDX-FileCopyrightText: 2015 Alex Merry <[email protected]>
+# SPDX-FileCopyrightText: 2025 Friedrich W. H. Kossebau <[email protected]>
 #
 # SPDX-License-Identifier: BSD-3-Clause
 
@@ -15,7 +16,7 @@
       [COMPILE_DEFINITIONS <definition> [<definition> [...]]] # Since 6.13.0
       [ENVIRONMENT <list>]  # Since 6.13.0
       LINK_LIBRARIES <library> [<library> [...]]
-      [NAME_PREFIX <prefix>]
+      [NAME_PREFIX <prefix> (| NO_NAME_PREFIX] # Since 6.22.0)
       [GUI]
       [TARGET_NAMES_VAR <target_names_var>]
       [TEST_NAMES_VAR <test_names_var>]
@@ -34,6 +35,9 @@
 not the target names. As a result, it will not prevent clashes between tests
 with the same name in different parts of the project, but it can be used to
 give an indication of where to look for a failing test.
+If ``NAME_PREFIX`` is not set, it will default to a value depending on the
+strategy as controlled by the variable ``ECM_TEST_NAME_PREFIX_STRATEGY``, if
+set in the current scope and ``NO_NAME_PREFIX`` is not set (since 6.22).
 
 If the flag ``GUI`` is passed the test binaries will be GUI executables, 
otherwise
 the resulting binaries will be console applications (regardless of the value
@@ -66,7 +70,7 @@
       [ENVIRONMENT <list>]  # Since 6.13.0
       LINK_LIBRARIES <library> [<library> [...]]
       [TEST_NAME <name>]
-      [NAME_PREFIX <prefix>]
+      [NAME_PREFIX <prefix> (| NO_NAME_PREFIX] # Since 6.22.0)
       [GUI]
       [TARGET_NAME_VAR <target_name_var>]
       [TEST_NAME_VAR <test_name_var>]
@@ -75,8 +79,13 @@
 
 This is a single-test form of ``ecm_add_tests`` that allows multiple source 
files
 to be used for a single test. If using multiple source files, ``TEST_NAME`` 
must
-be given; this will be used for both the target and test names (and, as with
-``ecm_add_tests()``, the ``NAME_PREFIX`` argument will be prepended to the 
test name).
+be given; this will be used for both the target and test names.
+
+As with ``ecm_add_tests()``, the ``NAME_PREFIX`` argument will be prepended to
+the test name.
+If ``NAME_PREFIX`` is not set, it will default to a value depending on the
+strategy as controlled by the variable ``ECM_TEST_NAME_PREFIX_STRATEGY``, if
+set in the current scope and ``NO_NAME_PREFIX`` is not set (since 6.22).
 
 The ``TARGET_NAME_VAR`` and ``TEST_NAME_VAR`` arguments, if given, should 
specify a
 variable name to receive the generated target and test name,
@@ -89,6 +98,95 @@
 ``${CMAKE_CURRENT_BINARY_DIR}``. The working directory can be specified using
 generator expressions. Since 5.111.
 
+::
+
+  ecm_test_set_dir_properties( # Since 6.22.0
+      [DIR <dir>]
+      [PREFIX_NAME <name>]
+      [PREFIX_NAME_IGNORE | PREFIX_NAME_NOT_IGNORE]
+      [FIRST_PREFIX_NAME]
+      [LAST_PREFIX_NAME]
+  )
+
+
+The function can be used to set properties to individual directories to
+influence the behaviour of the test functions. The properties will be set to
+the current source directory. For source directories which themselves do not
+have a CMakeLists.txt file and thus are not added by any `add_subdirectory()
+<https://cmake.org/cmake/help/latest/command/add_subdirectory.html>`_ calls,
+the ``DIR`` argument can be used to instead set the property to any such
+subdirectory ``<dir>``.
+
+``PREFIX_NAME`` can be used to override by ``<name>`` the name derived from
+the given directory.
+
+``PREFIX_NAME_IGNORE`` or ``PREFIX_NAME_NOT_IGNORE`` can be used to override
+the filtering done by ``ECM_TEST_NAME_PREFIX_IGNORE_DIRS`` for the name of the
+given directory.
+
+``FIRST_PREFIX_NAME`` and ``LAST_PREFIX_NAME`` can be used to limit the range
+of directories in the path used for deriving the prefix name.
+
+::
+
+  ecm_test_get_name_prefix( # Since 6.22.0
+      <name_prefix_var>
+  )
+
+The ``name_prefix_var`` argument should specify a variable name to receive the
+default test prefix name for the current scope, based on
+the value of ``ECM_TEST_NAME_PREFIX_STRATEGY`` and the respective further 
setup.
+
+::
+
+  ECM_TEST_NAME_PREFIX_STRATEGY # Since 6.22.0
+
+This variable is specifying the strategy to use when estimating the default
+test name prefix to use by the macros ``ecm_add_tests()`` and 
``ecm_add_test()``
+when no explicit ``NAME_PREFIX`` argument is passed. The supported values are:
+
+    * ``VARIABLE``: The default name prefix is taken from the value of the 
variable
+      ``ECM_TEST_NAME_PREFIX`` in the scope where the macros are called.
+
+    * ``PATH``: The default name prefix is derived from the relative path of 
the
+      current source directory where the macros are called, by replacing the
+      dir separators with "-".
+      See also ``ECM_TEST_NAME_PREFIX_IGNORE_DIRS`` for skipping some 
directory names.
+
+When unset, the ``VARIABLE`` strategy is used.
+
+::
+
+  ECM_TEST_NAME_PREFIX # Since 6.22.0
+
+When ``ECM_TEST_NAME_PREFIX_STRATEGY`` is set to ``VARIABLE``,
+the current value of the variable is used as default for the test name prefix.
+
+::
+
+  ECM_TEST_NAME_PREFIX_IGNORE_DIRS # Since 6.22.0
+
+When ``ECM_TEST_NAME_PREFIX_STRATEGY`` is set to ``PATH``, this variable is 
used
+to filter out directory names in the relative path of the current source 
directory
+when deriving the name prefix. By default the variable is set to
+"src", "test", "tests", "autotest", "autotests" when including the 
``ECMAddTest`` module,
+if not already defined.
+
+
+Example usage:
+
+.. code-block:: cmake
+
+  set(ECM_TEST_NAME_PREFIX_STRATEGY "PATH")
+  list(APPEND ECM_TEST_NAME_PREFIX_IGNORE_DIRS "plugins")
+
+  # Being in subdir "src/plugins/foo" this test will get
+  # the test name prefix set to "foo-", next to base name "mytest":
+  ecm_add_test(
+      mytest.cpp
+      LINK_LIBRARIES mylib
+  )
+
 Since pre-1.0.0.
 #]=======================================================================]
 
@@ -97,8 +195,160 @@
 include(ECMMarkAsTest)
 include(ECMMarkNonGuiExecutable)
 
+# set variable on the include scope, as consumers are supposed to have access 
to it
+if(NOT DEFINED ECM_TEST_NAME_PREFIX_IGNORE_DIRS)
+    set(ECM_TEST_NAME_PREFIX_IGNORE_DIRS "src" "test" "tests" "autotest" 
"autotests")
+endif()
+
+function(_ecm_test_name_prefix_from_project_path _name_prefix_varname)
+    # estimate names of chain of dirs of current source dir to main dir
+    file(RELATIVE_PATH _project_path ${CMAKE_SOURCE_DIR} 
${CMAKE_CURRENT_SOURCE_DIR})
+
+    if(_project_path MATCHES "^\\.\\./")
+        message(FATAL_ERROR "The PATH strategy can not be used with 
directories outside the root source dir.")
+    endif()
+
+    string(REPLACE "/" ";" _dirs ${_project_path})
+
+    # derive prefix names
+    set(_names)
+    set(_subpath ${CMAKE_SOURCE_DIR})
+    set(_lastcmakesubpath ${_subpath}) # path of current including 
CMakeLists.txt
+    set(_relativelastcmakesubpath)
+    get_directory_property(_cmakesubdirs DIRECTORY ${_lastcmakesubpath} 
"SUBDIRECTORIES")
+    foreach(_dir ${_dirs})
+        string(APPEND _subpath "/${_dir}")
+
+        # subdir with CMakeLists.txt?
+        if(_subpath IN_LIST _cmakesubdirs)
+            set(_lastcmakesubpath ${_subpath})
+            set(_relativelastcmakesubpath)
+            set(_property_name_suffix)
+            # prepare nexs subdir
+            get_directory_property(_cmakesubdirs DIRECTORY 
${_lastcmakesubpath} "SUBDIRECTORIES")
+        else()
+            string(APPEND _relativelastcmakesubpath "/${_dir}")
+            # keep in sync with writing the properties in 
ecm_test_set_dir_properties
+            string(SHA1 _relativelastcmakesubpath_hash 
${_relativelastcmakesubpath})
+            set(_property_name_suffix ":${_relativelastcmakesubpath_hash}")
+        endif()
+
+        get_directory_property(_substitute_name DIRECTORY ${_lastcmakesubpath} 
"ECM_TEST_NAME_PREFIX_DIR_NAME${_property_name_suffix}")
+
+        get_directory_property(_first_name DIRECTORY ${_lastcmakesubpath} 
"ECM_TEST_NAME_PREFIX_DIR_FIRST${_property_name_suffix}")
+
+        if(_first_name)
+            # drop any current names
+            set(_names)
+        endif()
+
+        if (_substitute_name)
+            list(APPEND _names ${_substitute_name})
+        else()
+            get_directory_property(_ignore_dir DIRECTORY ${_lastcmakesubpath} 
"ECM_TEST_NAME_PREFIX_DIR_IGNORE${_property_name_suffix}")
+            if (_ignore_dir STREQUAL "")
+                if(_dir IN_LIST ECM_TEST_NAME_PREFIX_IGNORE_DIRS)
+                    set(_ignore_dir TRUE)
+                else()
+                    set(_ignore_dir FALSE)
+                endif()
+            endif()
+            if(NOT _ignore_dir)
+                list(APPEND _names ${_dir})
+            endif()
+        endif()
+
+        get_directory_property(_last_name DIRECTORY ${_lastcmakesubpath} 
"ECM_TEST_NAME_PREFIX_DIR_LAST${_property_name_suffix}")
+        if(_last_name)
+            # finish estimating prefix names
+            break()
+        endif()
+    endforeach()
+
+    # create final prefix name
+    string(JOIN "-" _name_prefix ${_names})
+    if (_name_prefix)
+        string(APPEND _name_prefix "-")
+    endif()
+
+    set(${_name_prefix_varname} ${_name_prefix} PARENT_SCOPE)
+endfunction()
+
+function(ecm_test_set_dir_properties)
+    set(options PREFIX_NAME_IGNORE PREFIX_NAME_NOT_IGNORE FIRST_PREFIX_NAME 
LAST_PREFIX_NAME)
+    set(oneValueArgs PREFIX_NAME DIR)
+    set(multiValueArgs)
+    cmake_parse_arguments(ARG "${options}" "${oneValueArgs}" 
"${multiValueArgs}" ${ARGN})
+
+    if(ARG_UNPARSED_ARGUMENTS)
+        message(FATAL_ERROR "Unknown keywords given to 
ECM_TEST_SET_DIR_PROPERTIES(): \"${ARG_UNPARSED_ARGUMENTS}\"")
+    endif()
+    if(ARG_PREFIX_NAME_IGNORE AND ARG_PREFIX_NAME_NOT_IGNORE)
+        message(FATAL_ERROR "Pass either PREFIX_NAME_IGNORE or 
PREFIX_NAME_NOT_IGNORE to ECM_TEST_SET_DIR_PROPERTIES.")
+    endif()
+    set(_subdir)
+    if(ARG_DIR)
+        get_filename_component(_subdir ${ARG_DIR} REALPATH)
+        if(NOT IS_DIRECTORY "${_subdir}")
+            message(FATAL_ERROR "DIR argument passed to 
ECM_TEST_SET_DIR_PROPERTIES is not a directory: \"${ARG_DIR}\"")
+        endif()
+        if (_subdir STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
+            set(_subdir)
+        else()
+            file(RELATIVE_PATH _subdir ${CMAKE_CURRENT_SOURCE_DIR} ${_subdir})
+            if(_subdir MATCHES "^\\.\\./")
+                message(FATAL_ERROR "DIR argument passed to 
ECM_TEST_SET_DIR_PROPERTIES is not a subdirectory: \"${ARG_DIR}\"")
+          endif()
+        endif()
+    endif()
+
+    if(_subdir)
+        # map to a hash, as cmake does not specify allowed property characters
+        # keep in sync with reading the properties in 
_ecm_test_name_prefix_from_project_path
+        string(SHA1 _subdir_hash "/${_subdir}")
+        set(_property_name_suffix ":${_subdir_hash}")
+    else()
+        set(_property_name_suffix)
+    endif()
+
+    if (ARG_PREFIX_NAME)
+        set_directory_properties(PROPERTIES 
"ECM_TEST_NAME_PREFIX_DIR_NAME${_property_name_suffix}" "${ARG_PREFIX_NAME}")
+    endif()
+    if (ARG_PREFIX_NAME_IGNORE)
+        set_directory_properties(PROPERTIES 
"ECM_TEST_NAME_PREFIX_DIR_IGNORE${_property_name_suffix}" "TRUE")
+    endif()
+    if (ARG_PREFIX_NAME_NOT_IGNORE)
+        set_directory_properties(PROPERTIES 
"ECM_TEST_NAME_PREFIX_DIR_IGNORE${_property_name_suffix}" "FALSE")
+    endif()
+    if (ARG_FIRST_PREFIX_NAME)
+        set_directory_properties(PROPERTIES 
"ECM_TEST_NAME_PREFIX_DIR_FIRST${_property_name_suffix}" "TRUE")
+    endif()
+    if (ARG_LAST_PREFIX_NAME)
+        set_directory_properties(PROPERTIES 
"ECM_TEST_NAME_PREFIX_DIR_LAST${_property_name_suffix}" "TRUE")
+    endif()
+endfunction()
+
+function(ecm_test_get_name_prefix _name_prefix_varname)
+    if(NOT ECM_TEST_NAME_PREFIX_STRATEGY)
+        set(_strategy "VARIABLE")
+    else()
+        set(_strategies "VARIABLE" "PATH")
+        if (NOT ECM_TEST_NAME_PREFIX_STRATEGY IN_LIST _strategies)
+            message(FATAL_ERROR "ECM_TEST_NAME_PREFIX_STRATEGY set to unknown 
value ${ECM_TEST_NAME_PREFIX_STRATEGY}")
+        endif()
+        set(_strategy ${ECM_TEST_NAME_PREFIX_STRATEGY})
+    endif()
+
+    if (${_strategy} STREQUAL "PATH")
+        _ecm_test_name_prefix_from_project_path(_name_prefix)
+    else()
+        set(_name_prefix ${ECM_TEST_NAME_PREFIX})
+    endif()
+    set(${_name_prefix_varname} ${_name_prefix} PARENT_SCOPE)
+endfunction()
+
 function(ecm_add_test)
-  set(options GUI)
+  set(options GUI NO_NAME_PREFIX)
   set(oneValueArgs TEST_NAME NAME_PREFIX TARGET_NAME_VAR TEST_NAME_VAR 
WORKING_DIRECTORY)
   set(multiValueArgs COMPILE_DEFINITIONS ENVIRONMENT LINK_LIBRARIES)
   cmake_parse_arguments(ARG "${options}" "${oneValueArgs}" "${multiValueArgs}" 
${ARGN})
@@ -114,6 +364,15 @@
     message(FATAL_ERROR "ecm_add_test() called with multiple source files but 
without setting \"TEST_NAME\"")
   endif()
 
+  if (NOT ARG_NAME_PREFIX)
+    if(NOT ARG_NO_NAME_PREFIX)
+      ecm_test_get_name_prefix(ARG_NAME_PREFIX)
+    endif()
+  else()
+    if(ARG_NO_NAME_PREFIX)
+      message(FATAL_ERROR "ecm_add_test() called with both \"NO_NAME_PREFIX\" 
and \"NAME_PREFIX\"")
+    endif()
+  endif()
   set(_testname ${ARG_NAME_PREFIX}${_targetname})
   set(gui_args)
   if(ARG_GUI)
@@ -157,10 +416,20 @@
 endfunction()
 
 function(ecm_add_tests)
-  set(options GUI)
+  set(options GUI NO_NAME_PREFIX)
   set(oneValueArgs NAME_PREFIX TARGET_NAMES_VAR TEST_NAMES_VAR 
WORKING_DIRECTORY)
   set(multiValueArgs COMPILE_DEFINITIONS ENVIRONMENT LINK_LIBRARIES)
   cmake_parse_arguments(ARG "${options}" "${oneValueArgs}" "${multiValueArgs}" 
${ARGN})
+
+  set(_name_prefix "")
+  if(ARG_NO_NAME_PREFIX)
+    if(ARG_NAME_PREFIX)
+      message(FATAL_ERROR "ecm_add_tests() called with both \"NO_NAME_PREFIX\" 
and \"NAME_PREFIX\"")
+    endif()
+  elseif(ARG_NAME_PREFIX)
+    set(_name_prefix "NAME_PREFIX" "${ARG_NAME_PREFIX}")
+  endif()
+
   if(ARG_GUI)
     set(_exe_type GUI)
   else()
@@ -174,7 +443,7 @@
   set(target_names)
   foreach(_test_source ${ARG_UNPARSED_ARGUMENTS})
     ecm_add_test(${_test_source}
-      NAME_PREFIX ${ARG_NAME_PREFIX}
+      ${_name_prefix}
       COMPILE_DEFINITIONS ${ARG_COMPILE_DEFINITIONS}
       ENVIRONMENT ${ARG_ENVIRONMENT}
       LINK_LIBRARIES ${ARG_LINK_LIBRARIES}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/extra-cmake-modules-6.21.0/tests/ECMAddTests/CMakeLists.txt 
new/extra-cmake-modules-6.22.0/tests/ECMAddTests/CMakeLists.txt
--- old/extra-cmake-modules-6.21.0/tests/ECMAddTests/CMakeLists.txt     
2025-12-05 14:18:18.000000000 +0100
+++ new/extra-cmake-modules-6.22.0/tests/ECMAddTests/CMakeLists.txt     
2026-01-02 18:40:05.000000000 +0100
@@ -33,6 +33,26 @@
         )
 endmacro()
 
+macro(add_nameprefix_test NAME)
+    string(REPLACE "." "/" dir "${NAME}")
+    string(REGEX REPLACE "[^.]*\\." "" proj "${NAME}")
+    add_test(
+        NAME ecm_add_tests-${NAME}
+        COMMAND
+            ${CMAKE_CTEST_COMMAND}
+            --build-and-test
+            "${CMAKE_CURRENT_SOURCE_DIR}/${dir}"
+            "${CMAKE_CURRENT_BINARY_DIR}/${dir}"
+            --build-two-config
+            --build-generator ${CMAKE_GENERATOR}
+            --build-makeprogram ${CMAKE_MAKE_PROGRAM}
+            --build-project ${proj}
+            --build-options -DBUILD_TESTING:BOOL=ON
+            ${${NAME}_EXTRA_OPTIONS}
+            --test-command "${CMAKE_CTEST_COMMAND}"
+        )
+endmacro()
+
 add_check(single_tests
     test1.txt
     test2.txt
@@ -56,3 +76,5 @@
     test1011_dir/test11.txt
     )
 
+add_nameprefix_test(nameprefix_by_var_tests)
+add_nameprefix_test(nameprefix_by_path_tests)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/extra-cmake-modules-6.21.0/tests/ECMAddTests/nameprefix_by_path_tests/CMakeLists.txt
 
new/extra-cmake-modules-6.22.0/tests/ECMAddTests/nameprefix_by_path_tests/CMakeLists.txt
--- 
old/extra-cmake-modules-6.21.0/tests/ECMAddTests/nameprefix_by_path_tests/CMakeLists.txt
    1970-01-01 01:00:00.000000000 +0100
+++ 
new/extra-cmake-modules-6.22.0/tests/ECMAddTests/nameprefix_by_path_tests/CMakeLists.txt
    2026-01-02 18:40:05.000000000 +0100
@@ -0,0 +1,21 @@
+# SPDX-FileCopyrightText: None
+# SPDX-License-Identifier: CC0-1.0
+
+cmake_minimum_required(VERSION 3.16)
+
+project(ECMAddTests)
+
+set(ECM_MODULE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../modules)
+set(CMAKE_MODULE_PATH "${ECM_MODULE_DIR}")
+
+enable_testing()
+
+include(ECMAddTests)
+include(../../test_helpers.cmake)
+include(../nameprefix_test_helpers.cmake)
+
+set(main_cpp ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp)
+
+set(ECM_TEST_NAME_PREFIX_STRATEGY "PATH")
+
+add_subdirectory(dir_a)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/extra-cmake-modules-6.21.0/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/CMakeLists.txt
 
new/extra-cmake-modules-6.22.0/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/CMakeLists.txt
--- 
old/extra-cmake-modules-6.21.0/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/CMakeLists.txt
      1970-01-01 01:00:00.000000000 +0100
+++ 
new/extra-cmake-modules-6.22.0/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/CMakeLists.txt
      2026-01-02 18:40:05.000000000 +0100
@@ -0,0 +1,35 @@
+# SPDX-FileCopyrightText: None
+# SPDX-License-Identifier: CC0-1.0
+
+add_subdirectory(dir_b)
+add_subdirectory(dir_ignored)
+add_subdirectory(dir_notignored)
+add_subdirectory(dir_bypropignored)
+add_subdirectory(dir_first)
+add_subdirectory(dir_renamed)
+add_subdirectory(dir_nodirs)
+
+# default from source name., prefix preset by path-derived value
+ecm_add_test(
+    ${main_cpp}
+)
+
+# prefix preset by path-derived value
+ecm_add_test(
+    TEST_NAME "main_a2"
+    ${main_cpp}
+)
+
+# override of path-derived value by explicit arg
+ecm_add_test(
+    NAME_PREFIX "override_by_arg-"
+    TEST_NAME "main_a3"
+    ${main_cpp}
+)
+
+# check
+assert_test_name_prefix("dir_a-")
+
+assert_test_name("dir_a-" "main")
+assert_test_name("dir_a-" "main_a2")
+assert_test_name("override_by_arg-" "main_a3")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/extra-cmake-modules-6.21.0/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_b/CMakeLists.txt
 
new/extra-cmake-modules-6.22.0/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_b/CMakeLists.txt
--- 
old/extra-cmake-modules-6.21.0/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_b/CMakeLists.txt
        1970-01-01 01:00:00.000000000 +0100
+++ 
new/extra-cmake-modules-6.22.0/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_b/CMakeLists.txt
        2026-01-02 18:40:05.000000000 +0100
@@ -0,0 +1,29 @@
+# SPDX-FileCopyrightText: None
+# SPDX-License-Identifier: CC0-1.0
+
+# prefix preset by path-derived value
+ecm_add_test(
+    TEST_NAME "main_b"
+    ${main_cpp}
+)
+
+# override of path-derived value by explicit arg
+ecm_add_test(
+    NAME_PREFIX "override_by_arg-"
+    TEST_NAME "main_b2"
+    ${main_cpp}
+)
+
+# override of path-derived value by explicit NO_NAME_PREFIX
+ecm_add_test(
+    NO_NAME_PREFIX
+    TEST_NAME "main_b3"
+    ${main_cpp}
+)
+
+# check
+assert_test_name_prefix("dir_a-dir_b-")
+
+assert_test_name("dir_a-dir_b-" "main_b")
+assert_test_name("override_by_arg-" "main_b2")
+assert_test_name("" "main_b3")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/extra-cmake-modules-6.21.0/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_bypropignored/CMakeLists.txt
 
new/extra-cmake-modules-6.22.0/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_bypropignored/CMakeLists.txt
--- 
old/extra-cmake-modules-6.21.0/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_bypropignored/CMakeLists.txt
    1970-01-01 01:00:00.000000000 +0100
+++ 
new/extra-cmake-modules-6.22.0/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_bypropignored/CMakeLists.txt
    2026-01-02 18:40:05.000000000 +0100
@@ -0,0 +1,31 @@
+# SPDX-FileCopyrightText: None
+# SPDX-License-Identifier: CC0-1.0
+
+ecm_test_set_dir_properties(PREFIX_NAME_IGNORE)
+
+# prefix preset by path-derived value
+ecm_add_test(
+    TEST_NAME "main_bypropignored1"
+    ${main_cpp}
+)
+
+# override of path-derived value by explicit arg
+ecm_add_test(
+    NAME_PREFIX "override_by_arg-"
+    TEST_NAME "main_bypropignored2"
+    ${main_cpp}
+)
+
+# override of path-derived value by explicit NO_NAME_PREFIX
+ecm_add_test(
+    NO_NAME_PREFIX
+    TEST_NAME "main_bypropignored3"
+    ${main_cpp}
+)
+
+# check
+assert_test_name_prefix("dir_a-")
+
+assert_test_name("dir_a-" "main_bypropignored1")
+assert_test_name("override_by_arg-" "main_bypropignored2")
+assert_test_name("" "main_bypropignored3")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/extra-cmake-modules-6.21.0/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_first/CMakeLists.txt
 
new/extra-cmake-modules-6.22.0/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_first/CMakeLists.txt
--- 
old/extra-cmake-modules-6.21.0/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_first/CMakeLists.txt
    1970-01-01 01:00:00.000000000 +0100
+++ 
new/extra-cmake-modules-6.22.0/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_first/CMakeLists.txt
    2026-01-02 18:40:05.000000000 +0100
@@ -0,0 +1,25 @@
+# SPDX-FileCopyrightText: None
+# SPDX-License-Identifier: CC0-1.0
+
+ecm_test_set_dir_properties(FIRST_PREFIX_NAME)
+
+add_subdirectory(dir_last)
+
+# prefix preset by path-derived value
+ecm_add_test(
+    TEST_NAME "main_first"
+    ${main_cpp}
+)
+
+# override of path-derived value by explicit arg
+ecm_add_test(
+    NAME_PREFIX "override_by_arg-"
+    TEST_NAME "main_first2"
+    ${main_cpp}
+)
+
+# check
+assert_test_name_prefix("dir_first-")
+
+assert_test_name("dir_first-" "main_first")
+assert_test_name("override_by_arg-" "main_first2")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/extra-cmake-modules-6.21.0/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_first/dir_last/CMakeLists.txt
 
new/extra-cmake-modules-6.22.0/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_first/dir_last/CMakeLists.txt
--- 
old/extra-cmake-modules-6.21.0/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_first/dir_last/CMakeLists.txt
   1970-01-01 01:00:00.000000000 +0100
+++ 
new/extra-cmake-modules-6.22.0/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_first/dir_last/CMakeLists.txt
   2026-01-02 18:40:05.000000000 +0100
@@ -0,0 +1,33 @@
+# SPDX-FileCopyrightText: None
+# SPDX-License-Identifier: CC0-1.0
+
+ecm_test_set_dir_properties(LAST_PREFIX_NAME)
+
+add_subdirectory(dir_afterlast)
+
+# prefix preset by path-derived value
+ecm_add_test(
+    TEST_NAME "main_last"
+    ${main_cpp}
+)
+
+# override of path-derived value by explicit arg
+ecm_add_test(
+    NAME_PREFIX "override_by_arg-"
+    TEST_NAME "main_last2"
+    ${main_cpp}
+)
+
+# override of path-derived value by explicit NO_NAME_PREFIX
+ecm_add_test(
+    NO_NAME_PREFIX
+    TEST_NAME "main_last3"
+    ${main_cpp}
+)
+
+# check
+assert_test_name_prefix("dir_first-dir_last-")
+
+assert_test_name("dir_first-dir_last-" "main_last")
+assert_test_name("override_by_arg-" "main_last2")
+assert_test_name("" "main_last3")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/extra-cmake-modules-6.21.0/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_first/dir_last/dir_afterlast/CMakeLists.txt
 
new/extra-cmake-modules-6.22.0/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_first/dir_last/dir_afterlast/CMakeLists.txt
--- 
old/extra-cmake-modules-6.21.0/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_first/dir_last/dir_afterlast/CMakeLists.txt
     1970-01-01 01:00:00.000000000 +0100
+++ 
new/extra-cmake-modules-6.22.0/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_first/dir_last/dir_afterlast/CMakeLists.txt
     2026-01-02 18:40:05.000000000 +0100
@@ -0,0 +1,21 @@
+# SPDX-FileCopyrightText: None
+# SPDX-License-Identifier: CC0-1.0
+
+# prefix preset by path-derived value
+ecm_add_test(
+    TEST_NAME "main_afterlast"
+    ${main_cpp}
+)
+
+# override of path-derived value by explicit arg
+ecm_add_test(
+    NAME_PREFIX "override_by_arg-"
+    TEST_NAME "main_afterlast2"
+    ${main_cpp}
+)
+
+# check
+assert_test_name_prefix("dir_first-dir_last-")
+
+assert_test_name("dir_first-dir_last-" "main_afterlast")
+assert_test_name("override_by_arg-" "main_afterlast2")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/extra-cmake-modules-6.21.0/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_ignored/CMakeLists.txt
 
new/extra-cmake-modules-6.22.0/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_ignored/CMakeLists.txt
--- 
old/extra-cmake-modules-6.21.0/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_ignored/CMakeLists.txt
  1970-01-01 01:00:00.000000000 +0100
+++ 
new/extra-cmake-modules-6.22.0/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_ignored/CMakeLists.txt
  2026-01-02 18:40:05.000000000 +0100
@@ -0,0 +1,31 @@
+# SPDX-FileCopyrightText: None
+# SPDX-License-Identifier: CC0-1.0
+
+list(APPEND ECM_TEST_NAME_PREFIX_IGNORE_DIRS "dir_ignored")
+
+# prefix preset by path-derived value
+ecm_add_test(
+    TEST_NAME "main_ignored1"
+    ${main_cpp}
+)
+
+# override of path-derived value by explicit arg
+ecm_add_test(
+    NAME_PREFIX "override_by_arg-"
+    TEST_NAME "main_ignored2"
+    ${main_cpp}
+)
+
+# override of path-derived value by explicit NO_NAME_PREFIX
+ecm_add_test(
+    NO_NAME_PREFIX
+    TEST_NAME "main_ignored3"
+    ${main_cpp}
+)
+
+# check
+assert_test_name_prefix("dir_a-")
+
+assert_test_name("dir_a-" "main_ignored1")
+assert_test_name("override_by_arg-" "main_ignored2")
+assert_test_name("" "main_ignored3")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/extra-cmake-modules-6.21.0/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_nodirs/CMakeLists.txt
 
new/extra-cmake-modules-6.22.0/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_nodirs/CMakeLists.txt
--- 
old/extra-cmake-modules-6.21.0/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_nodirs/CMakeLists.txt
   1970-01-01 01:00:00.000000000 +0100
+++ 
new/extra-cmake-modules-6.22.0/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_nodirs/CMakeLists.txt
   2026-01-02 18:40:05.000000000 +0100
@@ -0,0 +1,26 @@
+# SPDX-FileCopyrightText: None
+# SPDX-License-Identifier: CC0-1.0
+
+ecm_test_set_dir_properties(
+    DIR nodir_first/nodir_ignored
+    PREFIX_NAME_IGNORE
+)
+list(APPEND ECM_TEST_NAME_PREFIX_IGNORE_DIRS "nodir_notignored")
+ecm_test_set_dir_properties(
+    DIR nodir_first/nodir_ignored/nodir_notignored
+    PREFIX_NAME_NOT_IGNORE
+)
+ecm_test_set_dir_properties(
+    DIR nodir_first/nodir_ignored/nodir_notignored/nodir_renamed
+    PREFIX_NAME "new_name"
+)
+ecm_test_set_dir_properties(
+    DIR nodir_first
+    FIRST_PREFIX_NAME
+)
+ecm_test_set_dir_properties(
+    DIR nodir_first/nodir_ignored/nodir_notignored/nodir_renamed/nodir_last
+    LAST_PREFIX_NAME
+)
+
+add_subdirectory(nodir_first/nodir_ignored/nodir_notignored/nodir_renamed/nodir_last/dir_afterlast)
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/extra-cmake-modules-6.21.0/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_nodirs/nodir_first/nodir_ignored/nodir_notignored/nodir_renamed/nodir_last/dir_afterlast/CMakeLists.txt
 
new/extra-cmake-modules-6.22.0/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_nodirs/nodir_first/nodir_ignored/nodir_notignored/nodir_renamed/nodir_last/dir_afterlast/CMakeLists.txt
--- 
old/extra-cmake-modules-6.21.0/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_nodirs/nodir_first/nodir_ignored/nodir_notignored/nodir_renamed/nodir_last/dir_afterlast/CMakeLists.txt
 1970-01-01 01:00:00.000000000 +0100
+++ 
new/extra-cmake-modules-6.22.0/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_nodirs/nodir_first/nodir_ignored/nodir_notignored/nodir_renamed/nodir_last/dir_afterlast/CMakeLists.txt
 2026-01-02 18:40:05.000000000 +0100
@@ -0,0 +1,29 @@
+# SPDX-FileCopyrightText: None
+# SPDX-License-Identifier: CC0-1.0
+
+# prefix preset by path-derived value
+ecm_add_test(
+    TEST_NAME "main_nodir"
+    ${main_cpp}
+)
+
+# override of path-derived value by explicit arg
+ecm_add_test(
+    NAME_PREFIX "override_by_arg-"
+    TEST_NAME "main_nodir2"
+    ${main_cpp}
+)
+
+# override of path-derived value by explicit NO_NAME_PREFIX
+ecm_add_test(
+    NO_NAME_PREFIX
+    TEST_NAME "main_nodir3"
+    ${main_cpp}
+)
+
+# check
+assert_test_name_prefix("nodir_first-nodir_notignored-new_name-nodir_last-")
+
+assert_test_name("nodir_first-nodir_notignored-new_name-nodir_last-" 
"main_nodir")
+assert_test_name("override_by_arg-" "main_nodir2")
+assert_test_name("" "main_nodir3")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/extra-cmake-modules-6.21.0/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_notignored/CMakeLists.txt
 
new/extra-cmake-modules-6.22.0/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_notignored/CMakeLists.txt
--- 
old/extra-cmake-modules-6.21.0/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_notignored/CMakeLists.txt
       1970-01-01 01:00:00.000000000 +0100
+++ 
new/extra-cmake-modules-6.22.0/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_notignored/CMakeLists.txt
       2026-01-02 18:40:05.000000000 +0100
@@ -0,0 +1,32 @@
+# SPDX-FileCopyrightText: None
+# SPDX-License-Identifier: CC0-1.0
+
+list(APPEND ECM_TEST_NAME_PREFIX_IGNORE_DIRS "dir_notignored")
+ecm_test_set_dir_properties(PREFIX_NAME_NOT_IGNORE)
+
+# prefix preset by path-derived value
+ecm_add_test(
+    TEST_NAME "main_notignored1"
+    ${main_cpp}
+)
+
+# override of path-derived value by explicit arg
+ecm_add_test(
+    NAME_PREFIX "override_by_arg-"
+    TEST_NAME "main_notignored2"
+    ${main_cpp}
+)
+
+# override of path-derived value by explicit NO_NAME_PREFIX
+ecm_add_test(
+    NO_NAME_PREFIX
+    TEST_NAME "main_notignored3"
+    ${main_cpp}
+)
+
+# check
+assert_test_name_prefix("dir_a-dir_notignored-")
+
+assert_test_name("dir_a-dir_notignored-" "main_notignored1")
+assert_test_name("override_by_arg-" "main_notignored2")
+assert_test_name("" "main_notignored3")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/extra-cmake-modules-6.21.0/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_renamed/CMakeLists.txt
 
new/extra-cmake-modules-6.22.0/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_renamed/CMakeLists.txt
--- 
old/extra-cmake-modules-6.21.0/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_renamed/CMakeLists.txt
  1970-01-01 01:00:00.000000000 +0100
+++ 
new/extra-cmake-modules-6.22.0/tests/ECMAddTests/nameprefix_by_path_tests/dir_a/dir_renamed/CMakeLists.txt
  2026-01-02 18:40:05.000000000 +0100
@@ -0,0 +1,31 @@
+# SPDX-FileCopyrightText: None
+# SPDX-License-Identifier: CC0-1.0
+
+ecm_test_set_dir_properties(PREFIX_NAME "new_name")
+
+# override of dir name for path-derived value
+ecm_add_test(
+    TEST_NAME "main_renamed"
+    ${main_cpp}
+)
+
+# override of path-derived value by explicit arg
+ecm_add_test(
+    NAME_PREFIX "override_by_arg-"
+    TEST_NAME "main_renamed2"
+    ${main_cpp}
+)
+
+# override of path-derived value by explicit NO_NAME_PREFIX
+ecm_add_test(
+    NO_NAME_PREFIX
+    TEST_NAME "main_renamed3"
+    ${main_cpp}
+)
+
+# check
+assert_test_name_prefix("dir_a-new_name-")
+
+assert_test_name("dir_a-new_name-" "main_renamed")
+assert_test_name("override_by_arg-" "main_renamed2")
+assert_test_name("" "main_renamed3")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/extra-cmake-modules-6.21.0/tests/ECMAddTests/nameprefix_by_path_tests/main.cpp
 
new/extra-cmake-modules-6.22.0/tests/ECMAddTests/nameprefix_by_path_tests/main.cpp
--- 
old/extra-cmake-modules-6.21.0/tests/ECMAddTests/nameprefix_by_path_tests/main.cpp
  1970-01-01 01:00:00.000000000 +0100
+++ 
new/extra-cmake-modules-6.22.0/tests/ECMAddTests/nameprefix_by_path_tests/main.cpp
  2026-01-02 18:40:05.000000000 +0100
@@ -0,0 +1,7 @@
+// SPDX-FileCopyrightText: None
+// SPDX-License-Identifier: CC0-1.0
+
+int main()
+{
+    return 0;
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/extra-cmake-modules-6.21.0/tests/ECMAddTests/nameprefix_by_var_tests/CMakeLists.txt
 
new/extra-cmake-modules-6.22.0/tests/ECMAddTests/nameprefix_by_var_tests/CMakeLists.txt
--- 
old/extra-cmake-modules-6.21.0/tests/ECMAddTests/nameprefix_by_var_tests/CMakeLists.txt
     1970-01-01 01:00:00.000000000 +0100
+++ 
new/extra-cmake-modules-6.22.0/tests/ECMAddTests/nameprefix_by_var_tests/CMakeLists.txt
     2026-01-02 18:40:05.000000000 +0100
@@ -0,0 +1,71 @@
+# SPDX-FileCopyrightText: None
+# SPDX-License-Identifier: CC0-1.0
+
+cmake_minimum_required(VERSION 3.16)
+
+project(ECMAddTests)
+
+set(ECM_MODULE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../modules)
+set(CMAKE_MODULE_PATH "${ECM_MODULE_DIR}")
+
+enable_testing()
+
+include(ECMAddTests)
+include(../../test_helpers.cmake)
+include(../nameprefix_test_helpers.cmake)
+
+set(main_cpp ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp)
+
+# default from source name
+ecm_add_test(
+    ${main_cpp}
+)
+
+# by explicit arg
+ecm_add_test(
+    NAME_PREFIX "by_arg-"
+    TEST_NAME "main2"
+    ${main_cpp}
+)
+
+# preset by scope variable
+set(ECM_TEST_NAME_PREFIX "by_var-")
+
+assert_test_name_prefix("by_var-")
+
+ecm_add_test(
+    TEST_NAME "main3"
+    ${main_cpp}
+)
+
+# override of scope variable by explicit arg
+ecm_add_test(
+    NAME_PREFIX "override_by_arg-"
+    TEST_NAME "main4"
+    ${main_cpp}
+)
+
+# override of scope variable by explicit NO_NAME_PREFIX
+ecm_add_test(
+    NO_NAME_PREFIX
+    TEST_NAME "main5"
+    ${main_cpp}
+)
+
+# preset by reset scope variable
+set(ECM_TEST_NAME_PREFIX "by_var2-")
+
+assert_test_name_prefix("by_var2-")
+
+ecm_add_test(
+    TEST_NAME "main6"
+    ${main_cpp}
+)
+
+# check
+assert_test_name("" "main")
+assert_test_name("by_arg-" "main2")
+assert_test_name("by_var-" "main3")
+assert_test_name("override_by_arg-" "main4")
+assert_test_name("" "main5")
+assert_test_name("by_var2-" "main6")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/extra-cmake-modules-6.21.0/tests/ECMAddTests/nameprefix_by_var_tests/main.cpp
 
new/extra-cmake-modules-6.22.0/tests/ECMAddTests/nameprefix_by_var_tests/main.cpp
--- 
old/extra-cmake-modules-6.21.0/tests/ECMAddTests/nameprefix_by_var_tests/main.cpp
   1970-01-01 01:00:00.000000000 +0100
+++ 
new/extra-cmake-modules-6.22.0/tests/ECMAddTests/nameprefix_by_var_tests/main.cpp
   2026-01-02 18:40:05.000000000 +0100
@@ -0,0 +1,7 @@
+// SPDX-FileCopyrightText: None
+// SPDX-License-Identifier: CC0-1.0
+
+int main()
+{
+    return 0;
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/extra-cmake-modules-6.21.0/tests/ECMAddTests/nameprefix_test_helpers.cmake 
new/extra-cmake-modules-6.22.0/tests/ECMAddTests/nameprefix_test_helpers.cmake
--- 
old/extra-cmake-modules-6.21.0/tests/ECMAddTests/nameprefix_test_helpers.cmake  
    1970-01-01 01:00:00.000000000 +0100
+++ 
new/extra-cmake-modules-6.22.0/tests/ECMAddTests/nameprefix_test_helpers.cmake  
    2026-01-02 18:40:05.000000000 +0100
@@ -0,0 +1,19 @@
+# SPDX-FileCopyrightText: None
+# SPDX-License-Identifier: CC0-1.0
+
+macro(assert_test_name expected_prefix_name expected_base_name)
+    if(NOT TARGET ${expected_base_name})
+        message(SEND_ERROR "No target defined with name 
'${expected_base_name}'.")
+    endif()
+    set(_test_name "${expected_prefix_name}${expected_base_name}")
+    if(NOT TEST ${_test_name})
+        message(SEND_ERROR "No test defined with name '${_test_name}'.")
+    endif()
+endmacro()
+
+macro(assert_test_name_prefix expected_name_prefix)
+    ecm_test_get_name_prefix(name_prefix)
+    if(NOT ${name_prefix} STREQUAL ${expected_name_prefix})
+        message(SEND_ERROR "Path-derived name prefix is '${name_prefix}', 
expecting '${expected_name_prefix}'.")
+    endif()
+endmacro()

Reply via email to