From 008f3a28c6ca6f689f00f11af1f195f14625a51a Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Mon, 7 Nov 2022 21:32:19 -0500 Subject: gnu: jami: Enable unit tests. * gnu/packages/patches/jami-fix-qml-imports.patch: New file. * gnu/packages/patches/jami-fix-unit-tests-build.patch: Likewise. * gnu/packages/patches/jami-libjami-headers-search.patch: Likewise. * gnu/packages/patches/jami-sip-unregister.patch: Likewise. * gnu/packages/patches/jami-xcb-link.patch: Likewise. * gnu/local.mk: Register them. * gnu/packages/jami.scm (%jami-sources): Apply new patches. (jami) [tests?]: Delete argument to run tests. [configure-flags]: Remove TESTS? argument. Enable tests with -DENABLE_TESTS=ON. Remove -DLIBJAMI_INCLUDE_DIR. [phases] {check}: New phase override. [native-inputs]: Add settings-desktop-schemas. [inputs]: Add glib and libxcb. --- gnu/packages/jami.scm | 46 +++++++++++++++++++++++++++++++++++++--------- 1 file changed, 37 insertions(+), 9 deletions(-) (limited to 'gnu/packages/jami.scm') diff --git a/gnu/packages/jami.scm b/gnu/packages/jami.scm index 7849a36e27..a9a988ca5a 100644 --- a/gnu/packages/jami.scm +++ b/gnu/packages/jami.scm @@ -95,7 +95,12 @@ (define %jami-sources (base32 "0hbsjjs61n7268lyjnjb9lzfpkkd65fmz76l1bg4awlz1f3cyywm")) (patches (search-patches "jami-disable-integration-tests.patch" - "jami-no-webengine.patch")))) + "jami-libjami-headers-search.patch" + "jami-fix-unit-tests-build.patch" + "jami-fix-qml-imports.patch" + "jami-no-webengine.patch" + "jami-sip-unregister.patch" + "jami-xcb-link.patch")))) ;; Jami maintains a set of patches for some key dependencies (currently ;; pjproject and ffmpeg) of Jami that haven't yet been integrated upstream. @@ -504,19 +509,14 @@ (define-public jami (arguments (list #:qtbase qtbase - ;; The test suite fails to build (see: - ;; https://git.jami.net/savoirfairelinux/jami-client-qt/-/issues/882). - #:tests? #f #:configure-flags - #~(list "-DENABLE_TESTS=OFF" + #~(list "-DENABLE_TESTS=ON" ;; Disable the webengine since it grows the closure size by ;; about 450 MiB and requires more resources. "-DWITH_WEBENGINE=OFF" ;; Use libwrap to link directly to libjami instead of ;; communicating via D-Bus to jamid, the Jami daemon. - "-DENABLE_LIBWRAP=ON" - (string-append "-DLIBJAMI_INCLUDE_DIR=" - #$(this-package-input "libjami") "/include/jami")) + "-DENABLE_LIBWRAP=ON") #:phases #~(modify-phases %standard-phases (add-after 'unpack 'change-directory/maybe @@ -531,7 +531,32 @@ (define-public jami (("// clang-format on.*" anchor) (string-append "const char VERSION_STRING[] = \"" #$version "\";\n" - anchor)))))))) + anchor))))) + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (setenv "QT_QPA_PLATFORM" "offscreen") + (setenv "QT_QUICK_BACKEND" "software") + ;; The tests require a writable HOME. + (setenv "HOME" "/tmp") + + (display "Running unittests...\n") + (invoke "tests/unittests" "-mutejamid") + + ;; XXX: There are currently multiple failures with the + ;; functional tests (see: + ;; https://git.jami.net/savoirfairelinux/jami-client-qt/-/issues/883), + ;; so the code below is disabled for now. + ;; + ;; (display "Running functional tests...\n") + ;; ;; This is to allow building from the source tarball or + ;; ;; directly from the git repository. + ;; (let ((tests-qml (if (file-exists? "../client-qt/tests") + ;; "../client-qt/tests/qml" + ;; "../tests/qml"))) + ;; (invoke "tests/qml_tests" "-mutejamid" + ;; "-input" tests-qml)) + )))))) (native-inputs (list googletest pkg-config @@ -539,11 +564,14 @@ (define-public jami qttools doxygen graphviz + gsettings-desktop-schemas ;for tests vulkan-headers)) (inputs (list ffmpeg-jami + glib ;for integration with GNOME libjami libnotify + libxcb libxkbcommon network-manager qrencode -- cgit v1.2.3