commit:     c2b93cb0e3a76ea7d12824ba9b0a8d0a157f2f77
Author:     Paul Zander <negril.nx+gentoo <AT> gmail <DOT> com>
AuthorDate: Fri May 16 09:56:41 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri May 16 11:27:20 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c2b93cb0

media-libs/opencv: skip cudnn tests when CUDA is unavailable

When the build user has no write access to /dev/nvidiactl, read the user is not
in the video group, we can't use hardware-accelerated code on NVIDIA devices.
This means we must skip cuda and cudnn tests or they fail.

Signed-off-by: Paul Zander <negril.nx+gentoo <AT> gmail.com>
Part-of: https://github.com/gentoo/gentoo/pull/42091
Closes: https://github.com/gentoo/gentoo/pull/42091
Signed-off-by: Sam James <sam <AT> gentoo.org>

 media-libs/opencv/opencv-4.11.0.ebuild | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/media-libs/opencv/opencv-4.11.0.ebuild 
b/media-libs/opencv/opencv-4.11.0.ebuild
index cc40b6a24406..b8cdff13f89d 100644
--- a/media-libs/opencv/opencv-4.11.0.ebuild
+++ b/media-libs/opencv/opencv-4.11.0.ebuild
@@ -1252,11 +1252,11 @@ multilib_src_test() {
                local results=()
 
                local tests
-               readarray -t tests <<< "$(find "${BUILD_DIR}/bin" -name 
'opencv_test_*')"
+               readarray -t tests <<< "$(find "${BUILD_DIR}/bin" -name 
'opencv_test_*' | sort)"
 
                for test in "${tests[@]}" ; do
 
-                       if [[ ${TEST_CUDA} == "false" && ${test} = 
*opencv_test_cu* ]] ; then
+                       if [[ ${TEST_CUDA} == "false" ]] && [[ ${test} == 
*opencv_test_cu* || ${test} == *opencv_test_dnn* ]] ; then
                                eqawarn "Skipping test ${test}"
                                continue
                        fi

Reply via email to