diff options
author | Marius Bakke <mbakke@fastmail.com> | 2019-07-31 14:28:56 +0200 |
---|---|---|
committer | Marius Bakke <mbakke@fastmail.com> | 2019-07-31 14:28:56 +0200 |
commit | 6a2e54236e1b2c428c8fd478ee0f3bd8130703fa (patch) | |
tree | af70155a2f474d35d90d003f8584b2d9ee0bbaa8 /tests | |
parent | 2cf1e37c109c8d03fae75bc84f7012f3afa956e5 (diff) | |
parent | 3d88855dfdcc4c8ce11f494fdf9f0ac1d8eef530 (diff) | |
download | guix-6a2e54236e1b2c428c8fd478ee0f3bd8130703fa.tar.gz |
Merge branch 'master' into core-updates
Diffstat (limited to 'tests')
-rw-r--r-- | tests/gexp.scm | 19 | ||||
-rw-r--r-- | tests/guix-build-branch.sh | 8 | ||||
-rw-r--r-- | tests/import-utils.scm | 22 | ||||
-rw-r--r-- | tests/services.scm | 4 |
4 files changed, 48 insertions, 5 deletions
diff --git a/tests/gexp.scm b/tests/gexp.scm index 460afe7f59..5c013d838d 100644 --- a/tests/gexp.scm +++ b/tests/gexp.scm @@ -1104,6 +1104,25 @@ (return (and (zero? (close-pipe pipe)) (= 42 (string->number str))))))))) +(test-assertm "program-file #:system" + (let* ((exp (with-imported-modules '((guix build utils)) + (gexp (begin + (use-modules (guix build utils)) + (display "hi!"))))) + (system (if (string=? (%current-system) "x86_64-linux") + "armhf-linux" + "x86_64-linux")) + (file (program-file "program" exp))) + (mlet %store-monad ((drv (lower-object file system))) + (return (and (string=? (derivation-system drv) system) + (find (lambda (input) + (let ((drv (pk (derivation-input-derivation input)))) + (and (string=? (derivation-name drv) + "module-import-compiled") + (string=? (derivation-system drv) + system)))) + (derivation-inputs drv))))))) + (test-assertm "scheme-file" (let* ((text (plain-file "foo" "Hello, world!")) (scheme (scheme-file "bar" #~(list "foo" #$text)))) diff --git a/tests/guix-build-branch.sh b/tests/guix-build-branch.sh index e64782c831..3d2a7dddf5 100644 --- a/tests/guix-build-branch.sh +++ b/tests/guix-build-branch.sh @@ -1,5 +1,5 @@ # GNU Guix --- Functional package management for GNU -# Copyright © 2018 Ludovic Courtès <ludo@gnu.org> +# Copyright © 2018, 2019 Ludovic Courtès <ludo@gnu.org> # # This file is part of GNU Guix. # @@ -52,5 +52,11 @@ guix gc -R "$v0_1_0_drv" | grep guile-gcrypt-git.9e3eacd test "$v0_1_0_drv" != "$latest_drv" test "$v0_1_0_drv" != "$orig_drv" +v0_1_0_drv="`guix build guix --with-commit=guile-gcrypt=v0.1.0 -d`" +guix gc -R "$v0_1_0_drv" | grep guile-gcrypt-git.v0.1.0 +guix gc -R "$v0_1_0_drv" | grep guile-gcrypt-9e3eacd +test "$v0_1_0_drv" != "$latest_drv" +test "$v0_1_0_drv" != "$orig_drv" + if guix build guix --with-commit=guile-gcrypt=000 -d then false; else true; fi diff --git a/tests/import-utils.scm b/tests/import-utils.scm index 5c0c041360..c3ab25d788 100644 --- a/tests/import-utils.scm +++ b/tests/import-utils.scm @@ -23,6 +23,7 @@ #:use-module ((guix licenses) #:prefix license:) #:use-module (guix packages) #:use-module (guix build-system) + #:use-module (gnu packages) #:use-module (srfi srfi-64)) (test-begin "import-utils") @@ -98,4 +99,25 @@ (or (package-license (alist->package meta)) 'license-is-false))) +(test-equal "alist->package with dependencies" + `(("gettext" ,(specification->package "gettext"))) + (let* ((meta '(("name" . "hello") + ("version" . "2.10") + ("source" . (("method" . "url-fetch") + ("uri" . "mirror://gnu/hello/hello-2.10.tar.gz") + ("sha256" . + (("base32" . + "0ssi1wpaf7plaswqqjwigppsg5fyh99vdlb9kzl7c9lng89ndq1i"))))) + ("build-system" . "gnu") + ("home-page" . "https://gnu.org") + ("synopsis" . "Say hi") + ("description" . "This package says hi.") + ; + ;; Note: As with Guile-JSON 3.x, JSON arrays are represented + ;; by vectors. + ("native-inputs" . #("gettext")) + + ("license" . #f)))) + (package-native-inputs (alist->package meta)))) + (test-end "import-utils") diff --git a/tests/services.scm b/tests/services.scm index 44ad0022c6..572fe38164 100644 --- a/tests/services.scm +++ b/tests/services.scm @@ -26,10 +26,6 @@ #:use-module (srfi srfi-64) #:use-module (ice-9 match)) -(define live-service - (@@ (gnu services herd) live-service)) - - (test-begin "services") (test-equal "services, default value" |