~ruther/guix-local

b12d44dd5e35ac236bf3fbb5619b9c8c2f42c902 — Maxim Cournoyer 1 year, 3 months ago 1556290
gnu: libssh: Enable tests.

* gnu/packages/ssh.scm (libssh) [arguments]
<#:configure-flags>: Add "-DUNIT_TESTING=ON".
<#:phases>: New argument.
[native-inputs]: Add cmocka.

Change-Id: Ibe0f8f7b9bff969c9483dcd8c6b7635d91e62feb
1 files changed, 25 insertions(+), 11 deletions(-)

M gnu/packages/ssh.scm
M gnu/packages/ssh.scm => gnu/packages/ssh.scm +25 -11
@@ 15,7 15,7 @@
;;; Copyright © 2019, 2020 Mathieu Othacehe <m.othacehe@gmail.com>
;;; Copyright © 2020, 2023, 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
;;; Copyright © 2020 Oleg Pykhalov <go.wigust@gmail.com>
;;; Copyright © 2020, 2021, 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; Copyright © 2020, 2021, 2022, 2025 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; Copyright © 2021 Brice Waegeneire <brice@waegenei.re>
;;; Copyright © 2023 Simon Streit <simon@netpanic.org>
;;; Copyright © 2024 Zheng Junjie <873216071@qq.com>


@@ 158,16 158,30 @@ file names.
    (build-system cmake-build-system)
    (outputs '("out" "debug"))
    (arguments
     `(#:configure-flags '("-DWITH_GCRYPT=ON"
                           ,@(if (and (%current-target-system)
                                      (not (target-64bit?)))
                                 (list (string-append
                                        "-DCMAKE_C_FLAGS=-g -O2"
                                        " -Wno-incompatible-pointer-types"))
                                 '()))

       ;; TODO: Add 'CMockery' and '-DWITH_TESTING=ON' for the test suite.
       #:tests? #f))
     (list
      #:configure-flags
      #~(list "-DWITH_GCRYPT=ON"
              "-DUNIT_TESTING=ON"
              #$@(if (and (%current-target-system)
                          (not (target-64bit?)))
                     #~(list (string-append
                              "-DCMAKE_C_FLAGS=-g -O2"
                              " -Wno-incompatible-pointer-types"))
                     #~()))
      #:phases
      #~(modify-phases %standard-phases
          (add-after 'unpack 'disable-problematic-tests
            (lambda _
              ;; XXX: There is no finer-grain control on skipping tests using
              ;; cmocka, short of patching sources, which isn't trivial with
              ;; substitute*/sed.
              (substitute* "tests/unittests/CMakeLists.txt"
                ;; Some torture tests fail due to assuming the user directory
                ;; (from the passwd database) matches HOME, and other fail for
                ;; unknown reasons (see:
                ;; https://gitlab.com/libssh/libssh-mirror/-/issues/302).
                (("^    torture_(config|misc|options).*$") "")))))))
    (native-inputs (list cmocka))
    (inputs (list zlib libgcrypt mit-krb5))
    (synopsis "SSH client library")
    (description