• [gentoo-dev] [PATCH] cmake.eclass: add CMAKE_SKIP_TESTS

    From Sam James@21:1/5 to All on Sun Aug 20 07:50:02 2023
    From: Alfred Persson Forsberg <cat@catcream.org>

    Signed-off-by: Alfred Persson Forsberg <cat@catcream.org>
    Closes: https://github.com/gentoo/gentoo/pull/27052
    Signed-off-by: Sam James <sam@gentoo.org>
    ---
    eclass/cmake.eclass | 7 +++++++
    1 file changed, 7 insertions(+)

    diff --git a/eclass/cmake.eclass b/eclass/cmake.eclass
    index 16b3e300ccae0..fb3f9b6352be2 100644
    --- a/eclass/cmake.eclass
    +++ b/eclass/cmake.eclass
    @@ -125,6 +125,12 @@ fi
    # read-only. This is a user flag and should under _no circumstances_ be set in
    # the ebuild. Helps in improving QA of build systems that write to source tree.

    +# @ECLASS_VARIABLE: CMAKE_SKIP_TESTS
    +# @USER_VARIABLE
    +# @DEFAULT_UNSET
    +# @DESCRIPTION:
    +# Array of tests that should be skipped when running CTest.
    +
    [[ ${CMAKE_MIN_VERSION} ]] && die "CMAKE_MIN_VERSION is banned; if necessary, set BDEPEND=\">=dev-util/cmake-${CMAKE_MIN_VERSION}\" directly"
    [[ ${CMAKE_BUILD_DIR} ]] && die "The ebuild must be migrated to BUILD_DIR"
    [[ ${CMAKE_REMOVE_MODULES} ]] && die "CMAKE_REMOVE_MODULES is banned, set CMAKE_REMOVE_MODULES_LIST array instead"
    @@ -681,6 +687,7 @@ cmake_src_test() {
    [[ -e CTestTestfile.cmake ]] || { echo "No tests found. Skipping."