gnu: libtorrent-rasterbar: Update to 1.2.19.

With the update, the execution of the test suite was overhauled a lot.
Parallel tests were disabled, since the do not work well.  Since faketime does
cause some tests to hang, test_ssl was moved into a separate run.

* gnu/packages/bittorrent.scm (libtorrent-rasterbar)[version]: Update to
1.2.19.
[arguments]<#:parallel-tests?>: Disable.
[arguments]<#:phases>: Move test_ssl into separate run under faketime.  Do not
run under tests under faketime.  Anchor the regex for test exclusion.  Set
timeout of 600 seconds for each test.

Change-Id: I7392cb3ce1a8815b26b3257498082761255535ee
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
Tomas Volf 2023-12-02 01:28:54 +01:00 committed by Ludovic Courtès
parent 0399d5b610
commit fb2bbb0c3e
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -417,7 +417,7 @@ (define-public mktorrent
(define-public libtorrent-rasterbar (define-public libtorrent-rasterbar
(package (package
(name "libtorrent-rasterbar") (name "libtorrent-rasterbar")
(version "1.2.18") (version "1.2.19")
(source (source
(origin (origin
(method url-fetch) (method url-fetch)
@ -426,35 +426,49 @@ (define-public libtorrent-rasterbar
"releases/download/v" version "/" "releases/download/v" version "/"
"libtorrent-rasterbar-" version ".tar.gz")) "libtorrent-rasterbar-" version ".tar.gz"))
(sha256 (sha256
(base32 "0wpsaqadcicxl4lf1nc1i93c4yzjv8hpzhhrw1hdkrp4gn0vdwpy")))) (base32 "03p4nvsll568zlyqifid0cn135sg5whbk7g48gkbapnw92ayks7f"))))
(build-system cmake-build-system) (build-system cmake-build-system)
(arguments (arguments
`(#:configure-flags '("-Dpython-bindings=ON" `(#:configure-flags '("-Dpython-bindings=ON"
"-Dbuild_tests=ON") "-Dbuild_tests=ON")
;; Tests do not reliably work when executed in parallel.
#:parallel-tests? #f
#:phases #:phases
(modify-phases %standard-phases (modify-phases %standard-phases
(add-after 'unpack 'extend-test-timeout
(lambda _
(substitute* "test/test_remove_torrent.cpp"
;; Extend the test timeout from 3 seconds to 10.
(("i > 30") "i > 100"))))
(replace 'check (replace 'check
(lambda* (#:key tests? parallel-tests? #:allow-other-keys) (lambda* (#:key tests? parallel-tests? #:allow-other-keys)
(let ((disabled-tests (let* ((disabled-tests
;; test_upnp requires a non-localhost IPv4 interface. '(
'("test_upnp"))) ;; Requires a non-localhost IPv4 interface.
"test_upnp"
;; test_ssl needs to be run separately.
"test_ssl"))
(exclude-regex (string-append "^("
(string-join disabled-tests "|")
")$"))
(timeout "600")
(jobs (if parallel-tests?
(number->string (parallel-job-count))
"1")))
(when tests? (when tests?
(invoke "ctest"
"-E" exclude-regex
"-j" jobs
"--timeout" timeout
"--output-on-failure")
;; test_ssl relies on bundled TLS certificates with a fixed ;; test_ssl relies on bundled TLS certificates with a fixed
;; expiry date. To ensure succesful builds in the future, ;; expiry date. To ensure succesful builds in the future,
;; fake the time to be roughly that of the release. ;; fake the time to be roughly that of the release.
(setenv "FAKETIME_ONLY_CMDS" "test_ssl") ;;
;; At the same time, faketime happens to cause
;; test_fast_extension, test_privacy and test_resolve_links
;; to hang, even with FAKETIME_ONLY_CMDS. Not sure why. So
;; execute only test_ssl under faketime.
(invoke "faketime" "2022-10-24" (invoke "faketime" "2022-10-24"
"ctest" "ctest"
"--exclude-regex" (string-join disabled-tests "|") "-R" "^test_ssl$"
"-j" (if parallel-tests? "-j" jobs
(number->string (parallel-job-count)) "--timeout" timeout
"1")
"--rerun-failed"
"--output-on-failure")))))))) "--output-on-failure"))))))))
(inputs (list boost openssl)) (inputs (list boost openssl))
(native-inputs (native-inputs