diff options
author | Mark H Weaver <mhw@netris.org> | 2015-04-17 22:06:05 -0400 |
---|---|---|
committer | Mark H Weaver <mhw@netris.org> | 2015-04-17 22:06:05 -0400 |
commit | 334345d9db53326fa062298e2372d6c33123949a (patch) | |
tree | 50774c171f1a348bd7de8e9a447bad2a14a9dffb /tests | |
parent | 8d7dc5d9dbf009009d33e21598f92c4685965cd5 (diff) | |
parent | 09dd019490e4a269b0a2d9512a07688f8ee657d3 (diff) | |
download | guix-334345d9db53326fa062298e2372d6c33123949a.tar guix-334345d9db53326fa062298e2372d6c33123949a.tar.gz |
Merge branch 'core-updates'
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lint.scm | 27 | ||||
-rw-r--r-- | tests/packages.scm | 46 |
2 files changed, 59 insertions, 14 deletions
diff --git a/tests/lint.scm b/tests/lint.scm index 2312b80934..2807eba1cc 100644 --- a/tests/lint.scm +++ b/tests/lint.scm @@ -301,9 +301,34 @@ requests." (uri "someurl") (sha256 "somesha") (patches (list "/path/to/y.patch"))))))) - (check-patches pkg))) + (check-patch-file-names pkg))) "file names of patches should start with the package name"))) +(test-assert "patches: not found" + (->bool + (string-contains + (with-warnings + (let ((pkg (dummy-package "x" + (source + (origin + (method url-fetch) + (uri "someurl") + (sha256 "somesha") + (patches + (list (search-patch "this-patch-does-not-exist!")))))))) + (check-patch-file-names pkg))) + "patch not found"))) + +(test-assert "derivation: invalid arguments" + (->bool + (string-contains + (with-warnings + (let ((pkg (dummy-package "x" + (arguments + '(#:imported-modules (invalid-module)))))) + (check-derivation pkg))) + "failed to create derivation"))) + (test-assert "home-page: wrong home-page" (->bool (string-contains diff --git a/tests/packages.scm b/tests/packages.scm index d7c169a585..3007b50b92 100644 --- a/tests/packages.scm +++ b/tests/packages.scm @@ -128,21 +128,44 @@ ("y") ;c ("y") ;d ("y")) ;e - (let* ((a (dummy-package "a" (supported-systems '("x" "y" "z")))) - (b (dummy-package "b" (supported-systems '("x" "y")) - (inputs `(("a" ,a))))) - (c (dummy-package "c" (supported-systems '("y" "z")) - (inputs `(("b" ,b))))) - (d (dummy-package "d" (supported-systems '("x" "y" "z")) - (inputs `(("b" ,b) ("c" ,c))))) - (e (dummy-package "e" (supported-systems '("x" "y" "z")) - (inputs `(("d" ,d)))))) + ;; Use TRIVIAL-BUILD-SYSTEM because it doesn't add implicit inputs and thus + ;; doesn't restrict the set of supported systems. + (let* ((a (dummy-package "a" + (build-system trivial-build-system) + (supported-systems '("x" "y" "z")))) + (b (dummy-package "b" + (build-system trivial-build-system) + (supported-systems '("x" "y")) + (inputs `(("a" ,a))))) + (c (dummy-package "c" + (build-system trivial-build-system) + (supported-systems '("y" "z")) + (inputs `(("b" ,b))))) + (d (dummy-package "d" + (build-system trivial-build-system) + (supported-systems '("x" "y" "z")) + (inputs `(("b" ,b) ("c" ,c))))) + (e (dummy-package "e" + (build-system trivial-build-system) + (supported-systems '("x" "y" "z")) + (inputs `(("d" ,d)))))) (list (package-transitive-supported-systems a) (package-transitive-supported-systems b) (package-transitive-supported-systems c) (package-transitive-supported-systems d) (package-transitive-supported-systems e)))) +(test-equal "package-transitive-supported-systems, implicit inputs" + %supported-systems + + ;; Here GNU-BUILD-SYSTEM adds implicit inputs that build only on + ;; %SUPPORTED-SYSTEMS. Thus the others must be ignored. + (let ((p (dummy-package "foo" + (build-system gnu-build-system) + (supported-systems + `("does-not-exist" "foobar" ,@%supported-systems))))) + (package-transitive-supported-systems p))) + (test-skip (if (not %store) 8 0)) (test-assert "package-source-derivation, file" @@ -205,10 +228,7 @@ (chmod "." #o777) (symlink "guile" "guile-rocks") (copy-recursively "../share/guile/2.0/scripts" - "scripts") - - ;; These variables must exist. - (pk %build-inputs %outputs)))))) + "scripts")))))) (package (package (inherit (dummy-package "with-snippet")) (source source) (build-system trivial-build-system) |