Subject: [bug#70031] [PATCH v2 09/65] build-system/cmake: Add test exclusion.

From: Greg Hogan <[email-masked]>
Date: Tue, 22 Oct 2024 18:08:59 +0000

* guix/build/cmake-build-system.scm (check): Pass test exclusion regex
to ctest.

Change-Id: I11160f5b43a67006616057d19f863fdbc9337bf6
---
 guix/build/cmake-build-system.scm | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/guix/build/cmake-build-system.scm b/guix/build/cmake-build-system.scm
index 250ef96540..b90a0c14a9 100644
--- a/guix/build/cmake-build-system.scm
+++ b/guix/build/cmake-build-system.scm
@@ -95,7 +95,8 @@ (define %test-suite-log-regexp
   ;; Name of test suite log files as commonly found in CMake.
   "^LastTest\\.log$")
 
-(define* (check #:key (tests? #t) (parallel-tests? #t)
+(define* (check #:key (tests? #t) (test-exclude "")
+                (parallel-tests? #t)
                 (test-suite-log-regexp %test-suite-log-regexp)
                 #:allow-other-keys)
   (if tests?
@@ -106,7 +107,10 @@ (define* (check #:key (tests? #t) (parallel-tests? #t)
                  (gnu:dump-file-contents "." test-suite-log-regexp)
                  (raise c)))
         (apply invoke "ctest" "--output-on-failure"
-               `(,@(if parallel-tests?
+               `(,@(if (string-null? test-exclude)
+                       '()
+                       `("--exclude-regex" ,test-exclude))
+                 ,@(if parallel-tests?
                        `("-j" ,(number->string (parallel-job-count)))
                        ;; When unset CMake defers to the build system.
                        '("-j" "1")))))
-- 
2.46.1