From 7e62a8fdd6e9c3ed685b20a443dd8e04ea00e32a Mon Sep 17 00:00:00 2001 From: Raghav Gururajan Date: Tue, 16 Mar 2021 16:56:25 -0400 Subject: [PATCH 31/50] gnu: mediastreamer2: Enable tests. * gnu/packages/linphone.scm (mediastreamer2) [arguments]<#:tests?>: Remove argument. <#:phases>['pre-check]: New phase. ['check]: Replace with custom phase. [native-inputs]: Add xorg-server-for-tests. --- gnu/packages/linphone.scm | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/gnu/packages/linphone.scm b/gnu/packages/linphone.scm index 025fd90c46..661a9ea779 100644 --- a/gnu/packages/linphone.scm +++ b/gnu/packages/linphone.scm @@ -582,12 +582,39 @@ API. It also comprises a simple HTTP/HTTPS client implementation.") (outputs '("out" "doc" "test")) (build-system cmake-build-system) (arguments - `(#:tests? #f ; No test target - #:configure-flags + `(#:configure-flags (list "-DENABLE_STATIC=NO") #:phases (modify-phases %standard-phases + (add-before 'check 'pre-check + (lambda _ + ;; Tests require a running X server. + (system "Xvfb :1 +extension GLX &") + (setenv "DISPLAY" ":1") + ;; Tests write to $HOME. + (setenv "HOME" (getenv "TEMP")) + #t)) + (replace 'check + (lambda _ + (copy-file + "tester/mediastreamer2_tester" + "../source/tester/mediastreamer2_tester") + (with-directory-excursion "../source/tester" + (for-each + (lambda (suite-name) + (invoke "./mediastreamer2_tester" "--suite" suite-name)) + (list + "Basic Audio" + ;; "Sound Card" + ;; "AdaptiveAlgorithm" + ;; "AudioStream" + ;; "VideoStream" + "H26x Tools" + "Framework" + ;; "Player" + "TextStream"))) + #t)) (add-after 'install 'separate-outputs (lambda* (#:key outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) @@ -612,7 +639,8 @@ API. It also comprises a simple HTTP/HTTPS client implementation.") (native-inputs `(("dot" ,graphviz) ("doxygen" ,doxygen) - ("python" ,python-wrapper))) + ("python" ,python-wrapper) + ("xorg-server" ,xorg-server-for-tests))) (inputs `(("alsa" ,alsa-lib) ("bcg729" ,bcg729) -- 2.31.0