From 17a4f88266b97931d8070575bdb7d6ae19d1b5c5 Mon Sep 17 00:00:00 2001 From: Raghav Gururajan Date: Tue, 16 Mar 2021 13:25:14 -0400 Subject: [PATCH 27/53] gnu: belle-sip: Enable tests. * gnu/packages/linphone.scm (belle-sip) [outputs]: New output "test". [arguments]<#:tests?>: Remove argument. <#:phases>['check]: Replace with custom phase. ['seperate-outputs]: New phase. --- gnu/packages/linphone.scm | 46 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git a/gnu/packages/linphone.scm b/gnu/packages/linphone.scm index cc2ab09db0..e3d8febae9 100644 --- a/gnu/packages/linphone.scm +++ b/gnu/packages/linphone.scm @@ -483,9 +483,9 @@ including both ARM and x86.") (sha256 (base32 "1kknnlczq7dpqaj1dwxvy092dzrqjy11ndkv90rqwmdryigkjk6z")))) (build-system cmake-build-system) + (outputs '("out" "test")) (arguments - `(#:tests? #f ; Requires network access - #:configure-flags + `(#:configure-flags (list "-DENABLE_STATIC=NO") ; Not required #:phases (modify-phases %standard-phases @@ -495,6 +495,48 @@ including both ARM and x86.") ;; ANTLR would use multithreaded DFA generation otherwise, ;; which would not be reproducible. (("-Xmultithreaded ") "")) + #t)) + (replace 'check + (lambda _ + (copy-file + "tester/belle_sip_tester" + "../source/tester/belle_sip_tester") + (with-directory-excursion "../source/tester" + (for-each + (lambda (suite-name) + (invoke "./belle_sip_tester" "--suite" suite-name)) + (list + "Object inheritance" + "SIP URI" + "FAST SIP URI" + "FAST SIP URI 2" + "Generic uri" + "Headers" + "Core" + "SDP" + ;; "Resolver" + "Message" + "Authentication helper" + ;; "Register" + ;; "Dialog" + "Refresher" + ;; "HTTP stack" + "Object"))) + #t)) + (add-after 'install 'seperate-outputs + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (test (assoc-ref outputs "test")) + (test-name (string-append "belle_sip" "_tester"))) + (for-each mkdir-p + `(,(string-append test "/bin") + ,(string-append test "/share"))) + (rename-file + (string-append out "/bin/" test-name) + (string-append test "/bin/" test-name)) + (rename-file + (string-append out "/share/" test-name) + (string-append test "/share/" test-name))) #t))))) (native-inputs `(("python" ,python-wrapper))) -- 2.31.0