mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 05:18:07 -05:00
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.
This commit is contained in:
parent
576c47f141
commit
e3065ec117
2 changed files with 8 additions and 1 deletions
|
@ -92,6 +92,7 @@ (define-json-mapping <crate-dependency> make-crate-dependency
|
|||
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 semver<?))
|
||||
(module-autoload! (current-module)
|
||||
|
|
|
@ -317,6 +317,9 @@ (define test-leaf-bob-dependencies
|
|||
(define test-source-hash
|
||||
"")
|
||||
|
||||
(define have-guile-semver?
|
||||
(false-if-exception (resolve-interface '(semver))))
|
||||
|
||||
|
||||
(test-begin "crate")
|
||||
|
||||
|
@ -326,8 +329,9 @@ (define test-source-hash
|
|||
(dummy-package
|
||||
"rust-rustc-serialize"
|
||||
(source (dummy-origin
|
||||
(uri (crate-uri "rustc-serialize" "1.0")))))))
|
||||
(uri (crate-uri "rustc-serialize" "1.0")))))))
|
||||
|
||||
(unless have-guile-semver? (test-skip 1))
|
||||
(test-assert "crate->guix-package"
|
||||
;; Replace network resources with sample data.
|
||||
(mock ((guix http-client) http-fetch
|
||||
|
@ -380,6 +384,7 @@ (define test-source-hash
|
|||
(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 @@ (define test-doctool-dependencies
|
|||
(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)
|
||||
|
|
Loading…
Reference in a new issue