gnu: json-modern-cxx: Run tests in parallel.
authorMarius Bakke <marius@gnu.org>
Sun, 30 Jan 2022 16:22:32 +0000 (17:22 +0100)
committerMarius Bakke <marius@gnu.org>
Tue, 1 Feb 2022 22:46:04 +0000 (23:46 +0100)
* gnu/packages/cpp.scm (json-modern-cxx)[arguments]: Respect PARALLEL-TESTS?
in check phase.

gnu/packages/cpp.scm

index 6ee412c..a159631 100644 (file)
@@ -534,10 +534,13 @@ as ordering relation.")
                             (assoc-ref %build-inputs "json_test_data")))
        #:phases (modify-phases %standard-phases
                   (replace 'check
-                    (lambda* (#:key tests? #:allow-other-keys)
+                    (lambda* (#:key tests? parallel-tests? #:allow-other-keys)
                       (if tests?
                           ;; Some tests need git and a full checkout, skip those.
-                          (invoke "ctest" "-LE" "git_required")
+                          (invoke "ctest" "-LE" "git_required"
+                                  "-j" (if parallel-tests?
+                                           (number->string (parallel-job-count))
+                                           "1"))
                           (format #t "test suite not run~%")))))))
     (native-inputs
      `(("amalgamate" ,amalgamate)