Subject: [PATCH v2 17/65] gnu: inkscape: Fix tests.

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

* gnu/packages/inkscape.scm (inkscape)[arguments]: Replace 'check
phase to replace the old cmake-build-system test target.

Change-Id: I95d4829b476b03becdf6c646bc3aabcfff1fba0a
---
 gnu/packages/inkscape.scm | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/inkscape.scm b/gnu/packages/inkscape.scm
index 13e1652f87..ea98a1f285 100644
--- a/gnu/packages/inkscape.scm
+++ b/gnu/packages/inkscape.scm
@@ -159,7 +159,6 @@ (define-public inkscape/stable
      (build-system cmake-build-system)
      (arguments
       (list
-       #:test-target "check"         ;otherwise some test binaries are missing
        #:disallowed-references (list imagemagick/stable)
        #:imported-modules `(,@%cmake-build-system-modules
                             (guix build glib-or-gtk-build-system))
@@ -359,10 +358,15 @@ (define-public inkscape
             #$@(if (target-x86-32?)
                    #~()            ;XXX: there are remaining failures on i686
                    #~((replace 'check
+                      ;; Test artifacts and actions are built with the 'check' target.
+                      (lambda* (#:key parallel-tests? tests? #:allow-other-keys)
                         ;; Re-instate the tests disabled in inkscape/stable, now that
                         ;; their ImageMagick requirement is satisfied.
-                        (assoc-ref %standard-phases 'check))))
-
+                        (when tests?
+                          (let ((job-count (if parallel-tests?
+                                               (number->string (parallel-job-count))
+                                               "1")))
+                            (invoke "make" "-j" job-count "check")))))))
             (replace 'wrap-program
               ;; Ensure Python is available at runtime.
               (lambda _
-- 
2.46.1