From 1d4928910b504984498bd432faadc8a91471fc29 Mon Sep 17 00:00:00 2001 From: Raghav Gururajan Date: Mon, 15 Mar 2021 01:57:33 -0400 Subject: [PATCH 12/50] gnu: belr: Enable tests. * gnu/packages/linphone.scm (belr) [outputs]: New output "test". [arguments]<#:tests?>: Remove argument. <#:phases>['check]: Replace with custom phase. ['seperate-outputs]: New phase. --- gnu/packages/linphone.scm | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/gnu/packages/linphone.scm b/gnu/packages/linphone.scm index 26b2b0cbba..8767662050 100644 --- a/gnu/packages/linphone.scm +++ b/gnu/packages/linphone.scm @@ -196,10 +196,32 @@ Communications software like belle-sip, mediastreamer2 and linphone.") (sha256 (base32 "0w2canwwm0qb99whnangvaybvjzq8xg6vksqxykgr8fbx7clw03h")))) (build-system cmake-build-system) + (outputs '("out" "test")) (arguments - `(#:tests? #f ; No test target - #:configure-flags - (list "-DENABLE_STATIC=OFF"))) ; Not required + `(#:configure-flags '("-DENABLE_STATIC=OFF") + #:phases + (modify-phases %standard-phases + (replace 'check + (lambda _ + (copy-file "tester/belr_tester" "../source/tester/belr_tester") + (with-directory-excursion "../source/tester" + (invoke "./belr_tester")) + #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 ,name "_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/belr-tester") + (string-append test "/share/" test-name))) + #t))))) (inputs `(("bctoolbox" ,bctoolbox) ("libudev" ,eudev))) -- 2.31.0