summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLiliana Marie Prikler <liliana.prikler@gmail.com>2023-12-03 07:20:53 +0100
committerLiliana Marie Prikler <liliana.prikler@gmail.com>2023-12-03 07:20:53 +0100
commit4c323c2f8308bba0e3295f3109d159c7b8f72838 (patch)
tree7064e51dfec301c660cc97d83ffa041e011baadd /tests
parent260b054aeaa0739bed1637742b6094c97dab47f2 (diff)
parent06ebc45e15f2a1bd4526a5a716eed657c902a0c1 (diff)
Merge branch 'master' into HEAD
Change-Id: I3f5d121162d98ef2ae61a62c4da3b0fd19d864e8
Diffstat (limited to 'tests')
-rw-r--r--tests/gexp.scm59
-rw-r--r--tests/pack.scm7
-rw-r--r--tests/profiles.scm4
-rw-r--r--tests/read-print.scm5
-rw-r--r--tests/syscalls.scm10
5 files changed, 47 insertions, 38 deletions
diff --git a/tests/gexp.scm b/tests/gexp.scm
index 7a90f8dcbf..0e3c446576 100644
--- a/tests/gexp.scm
+++ b/tests/gexp.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2014-2022 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2014-2023 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2021-2022 Maxime Devos <maximedevos@telenet.be>
;;;
;;; This file is part of GNU Guix.
@@ -826,38 +826,39 @@
(call-with-output-file (string-append #$output "/two")
(lambda (port)
(display "This is the second one." port))))))
- (build-drv #~(begin
- (use-modules (guix build store-copy)
- (guix build utils)
- (srfi srfi-1))
-
- (define (canonical-file? file)
- ;; Copied from (guix tests).
- (let ((st (lstat file)))
- (or (not (string-prefix? (%store-directory) file))
- (eq? 'symlink (stat:type st))
- (and (= 1 (stat:mtime st))
- (zero? (logand #o222 (stat:mode st)))))))
-
- (mkdir #$output)
- (populate-store '("graph") #$output
- #:deduplicate? #f)
-
- ;; Check whether 'populate-store' canonicalizes
- ;; permissions and timestamps.
- (unless (every canonical-file? (find-files #$output))
- (error "not canonical!" #$output)))))
+ (build-drv
+ (with-imported-modules '((guix build store-copy)
+ (guix build syscalls)
+ (guix progress)
+ (guix records)
+ (guix sets)
+ (guix build utils))
+ #~(begin
+ (use-modules (guix build store-copy)
+ (guix build utils)
+ (srfi srfi-1))
+
+ (define (canonical-file? file)
+ ;; Copied from (guix tests).
+ (let ((st (lstat file)))
+ (or (not (string-prefix? (%store-directory) file))
+ (eq? 'symlink (stat:type st))
+ (and (= 1 (stat:mtime st))
+ (zero? (logand #o222 (stat:mode st)))))))
+
+ (mkdir #$output)
+ (populate-store '("graph") #$output
+ #:deduplicate? #f)
+
+ ;; Check whether 'populate-store' canonicalizes
+ ;; permissions and timestamps.
+ (unless (every canonical-file? (find-files #$output))
+ (error "not canonical!" #$output))))))
(mlet* %store-monad ((one (gexp->derivation "one" build-one))
(two (gexp->derivation "two" (build-two one)))
(drv (gexp->derivation "store-copy" build-drv
#:references-graphs
- `(("graph" ,two))
- #:modules
- '((guix build store-copy)
- (guix progress)
- (guix records)
- (guix sets)
- (guix build utils))))
+ `(("graph" ,two))))
(ok? (built-derivations (list drv)))
(out -> (derivation->output-path drv)))
(let ((one (derivation->output-path one))
diff --git a/tests/pack.scm b/tests/pack.scm
index 8fdaed0168..ac78817a70 100644
--- a/tests/pack.scm
+++ b/tests/pack.scm
@@ -30,7 +30,7 @@
#:use-module (guix modules)
#:use-module (guix utils)
#:use-module (gnu packages)
- #:use-module ((gnu packages base) #:select (glibc-utf8-locales))
+ #:use-module ((gnu packages base) #:select (libc-utf8-locales-for-target))
#:use-module (gnu packages bootstrap)
#:use-module ((gnu packages package-management) #:select (rpm))
#:use-module ((gnu packages compression) #:select (squashfs-tools))
@@ -197,8 +197,9 @@
;; Make sure non-ASCII file names are properly
;; handled.
(setenv "GUIX_LOCPATH"
- #+(file-append glibc-utf8-locales
- "/lib/locale"))
+ #+(file-append
+ (libc-utf8-locales-for-target)
+ "/lib/locale"))
(setlocale LC_ALL "en_US.utf8")
(mkdir #$output)
diff --git a/tests/profiles.scm b/tests/profiles.scm
index 9c419ada93..ddd6d74f3b 100644
--- a/tests/profiles.scm
+++ b/tests/profiles.scm
@@ -463,7 +463,7 @@
(target -> "arm-linux-gnueabihf")
(grep (package->cross-derivation packages:grep target))
(sed (package->cross-derivation packages:sed target))
- (locales (package->derivation packages:glibc-utf8-locales))
+ (locales (package->derivation (packages:libc-utf8-locales-for-target)))
(drv (profile-derivation manifest
#:hooks '()
#:locales? #t
@@ -482,7 +482,7 @@
(derivation-file-name grep))
(string=? (find-input packages:sed)
(derivation-file-name sed))
- (string=? (find-input packages:glibc-utf8-locales)
+ (string=? (find-input (packages:libc-utf8-locales-for-target))
(derivation-file-name locales))))))
(test-assert "package->manifest-entry defaults to \"out\""
diff --git a/tests/read-print.scm b/tests/read-print.scm
index c8b8eb73fe..c1006a8a68 100644
--- a/tests/read-print.scm
+++ b/tests/read-print.scm
@@ -174,6 +174,11 @@ expressions."
(else #f))")
(test-pretty-print "\
+(parameterize ((a 1)
+ (b 2))
+ (call f g h))")
+
+(test-pretty-print "\
#~(string-append #$coreutils \"/bin/uname\")")
(test-pretty-print "\
diff --git a/tests/syscalls.scm b/tests/syscalls.scm
index eb85b358c4..340c1147de 100644
--- a/tests/syscalls.scm
+++ b/tests/syscalls.scm
@@ -583,11 +583,13 @@
(test-assert "terminal-rows"
(> (terminal-rows) 0))
-(test-assert "terminal-string-width English"
- (= (terminal-string-width "hello") 5))
+(test-equal "terminal-string-width English"
+ 5
+ (terminal-string-width "hello"))
-(test-assert "terminal-string-width Japanese"
- (= (terminal-string-width "今日は") 6))
+(test-equal "terminal-string-width Japanese"
+ 6
+ (terminal-string-width "今日は"))
(test-assert "openpty"
(let ((head inferior (openpty)))