From e3065ec11742eef58ca688db240d86031941a39a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Fri, 4 Dec 2020 16:53:14 +0100 Subject: [PATCH] import: crate: Skip tests when Guile-Semver is missing. * guix/import/crate.scm: Add comment for the 'module-autoload!' calls. * tests/crate.scm (have-guile-semver?): New variable. ("crate->guix-package", "cargo-recursive-import") ("cargo-recursive-import-hoors-existing-packages"): Skip when HAVE-GUILE-SEMVER? is false. --- guix/import/crate.scm | 1 + tests/crate.scm | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/guix/import/crate.scm b/guix/import/crate.scm index 3bc261b04e..c10c0d55ea 100644 --- a/guix/import/crate.scm +++ b/guix/import/crate.scm @@ -92,6 +92,7 @@ string->symbol) (requirement crate-dependency-requirement "req")) ;string +;; Autoload Guile-Semver so we only have a soft dependency. (module-autoload! (current-module) '(semver) '(string->semver semver->string semverguix-package" ;; Replace network resources with sample data. (mock ((guix http-client) http-fetch @@ -380,6 +384,7 @@ (x (pk 'fail x #f))))) +(unless have-guile-semver? (test-skip 1)) (test-assert "cargo-recursive-import" ;; Replace network resources with sample data. (mock ((guix http-client) http-fetch @@ -614,6 +619,7 @@ (test-assert "self-test: rust-docopt 0.8.x is gone, please adjust the test case" (not (null? (find-packages-by-name "rust-docopt" "0.8")))) +(unless have-guile-semver? (test-skip 1)) (test-assert "cargo-recursive-import-hoors-existing-packages" (mock ((guix http-client) http-fetch (lambda (url . rest)