summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAlex Kost <alezost@gmail.com>2014-10-08 17:15:49 +0400
committerLudovic Courtès <ludo@gnu.org>2014-10-10 00:06:35 +0200
commit5d7a8584f5c6aeed720c1115b8d46aa5a8d3157b (patch)
tree1951ecb136601c8b3d8c440ed97da475eceb2334 /tests
parent12703d0854a1b16ddc73fd7c2440ef8497593a70 (diff)
ui: Move 'show-manifest-transaction' from (guix profiles).
* guix/profiles.scm: Do not use (guix ui) module. (right-arrow, manifest-show-transaction): Move and rename to... * guix/ui.scm (right-arrow, show-manifest-transaction): ... here. * tests/profiles.scm ("manifest-show-transaction"): Move to... * tests/ui.scm ("show-manifest-transaction"): ... here. (guile-1.8.8, guile-2.0.9): New variables. * emacs/guix-main.scm (process-package-actions): Rename 'manifest-show-transaction' to 'show-manifest-transaction'. * guix/scripts/package.scm (guix-package): Likewise. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/profiles.scm17
-rw-r--r--tests/ui.scm36
2 files changed, 35 insertions, 18 deletions
diff --git a/tests/profiles.scm b/tests/profiles.scm
index 99f1fd27631..61c801c351c 100644
--- a/tests/profiles.scm
+++ b/tests/profiles.scm
@@ -156,23 +156,6 @@
156 (equal? (list glibc) install) 156 (equal? (list glibc) install)
157 (equal? (list (cons guile-1.8.8 guile-2.0.9)) upgrade))))) 157 (equal? (list (cons guile-1.8.8 guile-2.0.9)) upgrade)))))
158 158
159(test-assert "manifest-show-transaction"
160 (let* ((m (manifest (list guile-1.8.8)))
161 (t (manifest-transaction (install (list guile-2.0.9)))))
162 (let-values (((remove install upgrade)
163 (manifest-transaction-effects m t)))
164 (with-store store
165 (and (string-match "guile\t1.8.8 → 2.0.9"
166 (with-fluids ((%default-port-encoding "UTF-8"))
167 (with-error-to-string
168 (lambda ()
169 (manifest-show-transaction store m t)))))
170 (string-match "guile\t1.8.8 -> 2.0.9"
171 (with-fluids ((%default-port-encoding "ISO-8859-1"))
172 (with-error-to-string
173 (lambda ()
174 (manifest-show-transaction store m t))))))))))
175
176(test-assert "profile-derivation" 159(test-assert "profile-derivation"
177 (run-with-store %store 160 (run-with-store %store
178 (mlet* %store-monad 161 (mlet* %store-monad
diff --git a/tests/ui.scm b/tests/ui.scm
index db90cdd4794..236f541be2e 100644
--- a/tests/ui.scm
+++ b/tests/ui.scm
@@ -19,11 +19,14 @@
19 19
20(define-module (test-ui) 20(define-module (test-ui)
21 #:use-module (guix ui) 21 #:use-module (guix ui)
22 #:use-module (guix profiles)
22 #:use-module (guix store) 23 #:use-module (guix store)
23 #:use-module (guix derivations) 24 #:use-module (guix derivations)
24 #:use-module (srfi srfi-1) 25 #:use-module (srfi srfi-1)
26 #:use-module (srfi srfi-11)
25 #:use-module (srfi srfi-19) 27 #:use-module (srfi srfi-19)
26 #:use-module (srfi srfi-64)) 28 #:use-module (srfi srfi-64)
29 #:use-module (ice-9 regex))
27 30
28;; Test the (guix ui) module. 31;; Test the (guix ui) module.
29 32
@@ -35,6 +38,20 @@ R6RS, Guile includes a module system, full access to POSIX system calls,
35networking support, multiple threads, dynamic linking, a foreign function call 38networking support, multiple threads, dynamic linking, a foreign function call
36interface, and powerful string processing.") 39interface, and powerful string processing.")
37 40
41(define guile-1.8.8
42 (manifest-entry
43 (name "guile")
44 (version "1.8.8")
45 (item "/gnu/store/...")
46 (output "out")))
47
48(define guile-2.0.9
49 (manifest-entry
50 (name "guile")
51 (version "2.0.9")
52 (item "/gnu/store/...")
53 (output "out")))
54
38 55
39(test-begin "ui") 56(test-begin "ui")
40 57
@@ -210,6 +227,23 @@ Second line" 24))
210 ;; This should print nothing. 227 ;; This should print nothing.
211 (show-what-to-build store (list drv))))))) 228 (show-what-to-build store (list drv)))))))
212 229
230(test-assert "show-manifest-transaction"
231 (let* ((m (manifest (list guile-1.8.8)))
232 (t (manifest-transaction (install (list guile-2.0.9)))))
233 (let-values (((remove install upgrade)
234 (manifest-transaction-effects m t)))
235 (with-store store
236 (and (string-match "guile\t1.8.8 → 2.0.9"
237 (with-fluids ((%default-port-encoding "UTF-8"))
238 (with-error-to-string
239 (lambda ()
240 (show-manifest-transaction store m t)))))
241 (string-match "guile\t1.8.8 -> 2.0.9"
242 (with-fluids ((%default-port-encoding "ISO-8859-1"))
243 (with-error-to-string
244 (lambda ()
245 (show-manifest-transaction store m t))))))))))
246
213(test-end "ui") 247(test-end "ui")
214 248
215 249