From c487293d21986019a92162c43b8d9e6ff3faf5a6 Mon Sep 17 00:00:00 2001 From: Raghav Gururajan Date: Mon, 15 Mar 2021 21:30:54 -0400 Subject: [PATCH 17/53] gnu: bcg729: Enable tests. * gnu/packages/linphone.scm (bcg729) [arguments]<#:tests?>: Remove argument. <#:configure-flags>[-DENABLE_TESTS]: New flag. <#:phases>['copy-inputs]: New phase. ['check]: Replace with custom phase. [native-inputs]: Add perl, test-patterns and unzip. --- gnu/packages/linphone.scm | 55 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 52 insertions(+), 3 deletions(-) diff --git a/gnu/packages/linphone.scm b/gnu/packages/linphone.scm index 5bbf60e204..346ca30a77 100644 --- a/gnu/packages/linphone.scm +++ b/gnu/packages/linphone.scm @@ -328,9 +328,58 @@ tracks in one file. ") (base32 "1hal6b3w6f8y5r1wa0xzj8sj2jjndypaxyw62q50p63garp2h739")))) (build-system cmake-build-system) (arguments - `(#:tests? #f ; No test target - #:configure-flags - (list "-DENABLE_STATIC=NO"))) ; Not required + `(#:configure-flags + (list + "-DENABLE_STATIC=NO" + "-DENABLE_TESTS=YES") + #:phases + (modify-phases %standard-phases + (add-before 'check 'copy-inputs + (lambda* (#:key inputs #:allow-other-keys) + (let ((test-patterns (assoc-ref inputs "test-patterns")) + (dest (string-append "test/bcg729-patterns.zip"))) + (copy-recursively test-patterns dest)) + #t)) + (replace 'check + (lambda _ + (with-directory-excursion "test" + (invoke "unzip" "bcg729-patterns.zip") + (for-each + (lambda (test-name) + (invoke "./testCampaign" "-s" test-name)) + (list + "fixedCodebookSearch" + "postProcessing" + "adaptativeCodebookSearch" + "computeLP" + "computeAdaptativeCodebookGain" + "postFilter" + "decoder" + "LPSynthesisFilter" + "decodeLSP" + ;; "encoder" + ;; "LSPQuantization" + "preProcessing" + "decodeFixedCodeVector" + "CNGdecoder" + ;; "LP2LSPConversion" + "gainQuantization" + "findOpenLoopPitchDelay" + "decodeGains" + "computeWeightedSpeech" + "interpolateqLSPAndConvert2LP" + "decodeAdaptativeCodeVector"))) + #t))))) + (native-inputs + `(("perl" ,perl) + ("test-patterns" + ,(origin + (method url-fetch) + (uri (string-append "http://www.belledonne-communications.com/" + "bc-downloads/bcg729-patterns.zip")) + (sha256 + (base32 "1kivarhh3izrl9sg0szs6x6pbq2ap0y6xsraw0gbgspi4gnfihrh")))) + ("unzip" ,unzip))) (synopsis "Belledonne Communications G729 Codec") (description "BcG729 is an implementation of both encoder and decoder of the ITU G729 speech codec. The library written in C 99 is fully portable and -- 2.31.0