aboutsummaryrefslogtreecommitdiff
path: root/tests/guix-repl.sh
blob: d4ebb5f6c68d7cbce427eb46c10dd0da40c2c582 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# GNU Guix --- Functional package management for GNU
# Copyright © 2020 Simon Tournier <zimon.toutoune@gmail.com>
# Copyright © 2020 Konrad Hinsen <konrad.hinsen@fastmail.net>
#
# This file is part of GNU Guix.
#
# GNU Guix is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or (at
# your option) any later version.
#
# GNU Guix is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

#
# Test the `guix repl' command-line utility.
#

guix repl --version

test_directory="`mktemp -d`"
export test_directory
trap 'chmod -Rf +w "$test_directory"; rm -rf "$test_directory"' EXIT

tmpfile="$test_directory/foo.scm"
rm -f "$tmpfile"
trap 'rm -f "$tmpfile"' EXIT

module_dir="t-guix-repl-$$"
mkdir "$module_dir"
trap 'rm -rf "$module_dir"' EXIT


cat > "$tmpfile"<<EOF
(use-modules (guix packages)
             (gnu packages base))

(format #t "~a\n" (package-name coreutils))
EOF

test "`guix repl "$tmpfile"`" = "coreutils"

# Make sure that the file can also be loaded when passed as a relative file
# name.
(cd "$(dirname "$tmpfile")"; test "$(guix repl "$(basename "$tmpfile")")" = "coreutils")


cat > "$module_dir/foo.scm"<<EOF
(define-module (foo)
  #:use-module (guix packages)
  #:use-module (gnu packages base))

(define-public dummy
  (package (inherit hello)
    (name "dummy")
    (version "42")
    (synopsis "dummy package")
    (description "dummy package. Only used for testing purposes.")))
EOF

cat > "$tmpfile"<<EOF
(use-modules (guix packages)
             (foo))

(format #t "~a\n" (package-version dummy))
EOF

test "`guix repl "$tmpfile" -L "$module_dir"`" = "42"

cat > "$tmpfile"<<EOF
(format #t "~a\n" (cdr (command-line)))
EOF

test "`guix repl -- "$tmpfile" -a b --input=foo.txt`" = "(-a b --input=foo.txt)"

cat > "$tmpfile"<<EOF
#!$(type -P env) -S guix repl --
!#
(format #t "~a\n" (cdr (command-line)))
EOF
chmod 755 $tmpfile

test "`"$tmpfile" -a b --input=foo.txt`" = "(-a b --input=foo.txt)"
title='2023-05-07 19:29:35 +0300'>2023-05-07gnu: Add rust-raw-window-handle-0.5....* gnu/packages/crates-graphics.scm (rust-raw-window-handle-0.5): New variable. (rust-raw-window-handle-0.4): Inherit from rust-raw-window-handle-0.5. Efraim Flashner 2023-05-07gnu: rust-core-graphics-0.22: Update to 0.22.3....* gnu/packages/crates-graphics.scm (rust-core-graphics-0.22): Update to 0.22.3. Efraim Flashner 2023-05-07gnu: rust-wayland-sys-0.29: Update to 0.29.5....* gnu/packages/crates-io.scm (rust-wayland-sys-0.29): Update to 0.29.5. Efraim Flashner 2023-05-07gnu: Add rust-wayland-sys-0.30....* gnu/packages/crates-graphics.scm (rust-wayland-sys-0.30): New variable. (rust-wayland-sys-0.29): Inherit from rust-wayland-sys-0.30. Efraim Flashner 2023-05-07gnu: rust-wayland-server-0.29: Update to 0.29.5....* gnu/packages/crates-io.scm (rust-wayland-server-0.29): Update to 0.29.5. [cargo-inputs]: Replace rust-nix-0.22 with 0.24. Add rust-wayland-commons-0.29, rust-wayland-scanner-0.29, rust-wayland-sys-0.29. [inputs]: Replace rust-nix-0.22 with 0.24. Efraim Flashner 2023-05-07gnu: rust-wayland-scanner-0.29: Update to 0.29.5....* gnu/packages/crates-io.scm (rust-wayland-scanner-0.29): Update to 0.29.5. [cargo-inputs]: Add rust-proc-macro2, rust-quote-1, rust-xml-rs-0.8. Efraim Flashner 2023-05-07gnu: rust-wayland-protocols-0.29: Update to 0.29.5....* gnu/packages/crates-graphics.scm (rust-wayland-protocols-0.29): Update to 0.29.5. [cargo-inputs]: Replace rust-bitflags-1.2 with 1. Add rust-wayland-client-0.29, rust-wayland-commons-0.29, rust-wayland-scanner-0.29, rust-wayland-server-0.29. [inputs]: Replace rust-bitflags-1.2 with 1. Efraim Flashner 2023-05-07gnu: rust-wayland-egl-0.29: Update to 0.29.5....* gnu/packages/crates-io.scm (rust-wayland-egl-0.29): Update to 0.29.5. [cargo-inputs]: Add rust-wayland-client-0.29, rust-wayland-sys-0.29. Efraim Flashner 2023-05-07gnu: rust-wayland-cursor-0.29: Update to 0.29.5....* gnu/packages/crates-graphics.scm (rust-wayland-cursor-0.29): Update to 0.29.5. [cargo-inputs]: Replace rust-nix-0.22 with 0.24. Add rust-wayland-client-0.29. [inputs]: Replace rust-nix-0.22 with 0.24. Efraim Flashner 2023-05-07gnu: rust-wayland-commons-0.29: Update to 0.29.5....* gnu/packages/crates-graphics.scm (rust-wayland-commons-0.29): Update to 0.29.5. [cargo-inputs]: Replace rust-nix-0.22 with 0.24. [inputs]: Replace rust-nix-0.22 with 0.24. Efraim Flashner 2023-05-07gnu: rust-wayland-client-0.29: Update to 0.29.5....* gnu/packages/crates-graphics.scm (rust-wayland-client-0.29): Update to 0.29.5. [cargo-inputs]: Replace rust-nix-0.22 with 0.24. Add rust-wayland-sys-0.29. [inputs]: Replace rust-nix-0.22 with 0.24. Efraim Flashner 2023-05-07gnu: Add rust-glutin-0.30....* gnu/packages/crates-graphics.scm (rust-glutin-0.30): New variable. (rust-glutin-0.28): Inherit from rust-glutin-0.30. Efraim Flashner 2023-05-07gnu: Add rust-dav1d-0.6....* gnu/packages/crates-graphics.scm (rust-dav1d-0.6): New variable. Efraim Flashner 2023-05-07gnu: Add rust-exr-1....* gnu/packages/crates-graphics.scm (rust-exr-1): New variable. Efraim Flashner 2023-05-07gnu: Remove rust-gl-generator-0.10....* gnu/packages/crates-graphics.scm (rust-gl-generator-0.10): Delete variable. Efraim Flashner 2023-05-07gnu: Add rust-libwebp-sys-0.4....* gnu/packages/crates-graphics.scm (rust-libwebp-sys-0.4): New variable. Efraim Flashner 2023-05-07gnu: Add rust-mp4parse-0.12....* gnu/packages/crates-graphics.scm (rust-mp4parse-0.12): New variable. Efraim Flashner 2023-05-07gnu: Add rust-webp-0.2....* gnu/packages/crates-graphics.scm (rust-webp-0.2): New variable. Efraim Flashner 2023-05-07gnu: Add rust-tiff-0.8....* gnu/packages/crates-graphics.scm (rust-tiff-0.8): New variable. (rust-tiff-0.6): Inherit from rust-tiff-0.8. Efraim Flashner 2023-05-07gnu: rust-rgb-0.8: Update to 0.8.36....* gnu/packages/crates-graphics.scm (rust-rgb-0.8): Update to 0.8.36. Efraim Flashner 2023-05-07gnu: rust-png-0.17: Update to 0.17.7....* gnu/packages/crates-graphics.scm (rust-png-0.17): Update to 0.17.7. [cargo-inputs]: Replace rust-miniz-oxide-0.5 with 0.6. Efraim Flashner 2023-05-07gnu: Add rust-jpeg-decoder-0.3....* gnu/packages/crates-graphics.scm (rust-jpeg-decoder-0.3): New variable. (rust-jpeg-decoder-0.1): Inherit from rust-jpeg-decoder-0.3. Efraim Flashner 2023-05-07gnu: Add rust-image-0.24....* gnu/packages/crates-graphics.scm (rust-image-0.24): New variable. (rust-image-0.23): Inherit from rust-image-0.24. Efraim Flashner 2023-05-07gnu: Add rust-dcv-color-primitives-0.4....* gnu/packages/crates-graphics.scm (rust-dcv-color-primitives-0.4): New variable. Efraim Flashner 2023-05-07gnu: Add rust-dav1d-sys-0.7....* gnu/packages/crates-graphics.scm (rust-dav1d-sys-0.7): New variable. (rust-dav1d-sys-0.3): Inherit from rust-dav1d-sys-0.7. Efraim Flashner 2023-05-07gnu: Add rust-avif-serialize-0.7....* gnu/packages/crates-graphics.scm (rust-avif-serialize-0.7): New variable. (rust-avif-serialize-0.6): Inherit from rust-avif-serialize-0.7. Efraim Flashner 2023-05-07gnu: Add rust-ravif-0.8....* gnu/packages/crates-graphics.scm (rust-ravif-0.8): New variable. (rust-ravif-0.6): Inherit from rust-ravif-0.8. Efraim Flashner 2023-05-07gnu: Add rust-avif-parse-1....* gnu/packages/crates-graphics.scm (rust-avif-parse-1): New variable. (rust-avif-parse-0.13): Inherit from rust-avif-parse-1. Efraim Flashner 2023-05-07gnu: rust-aom-sys-0.3: Update to 0.3.2....* gnu/packages/crates-graphics.scm (rust-aom-sys-0.3): Update to 0.3.2. [cargo-inputs]: Add rust-system-deps-6. Remove rust-metadeps-1. Replace rust-bindgen-0.54 with 0.61. Efraim Flashner 2023-05-07gnu: rust-imgref-1: Update to 1.9.4....* gnu/packages/crates-graphics.scm (rust-imgref-1): Update to 1.9.4. [arguments]: Don't skip build. Efraim Flashner 2023-05-07gnu: Remove rust-gl-0.11....* gnu/packages/crates-graphics.scm (rust-gl-0.11): Delete variable. Efraim Flashner 2022-12-12Merge remote-tracking branch 'origin/master' into stagingMaxim Cournoyer 2022-12-04gnu: Remove rust-gfx-gl-0.6....* gnu/packages/crates-graphics.scm (rust-gfx-gl-0.6): Delete variable. Efraim Flashner 2022-12-02gnu: rust-x11: Update to 2.20.1....* gnu/packages/crates-graphics.scm (rust-x11-2): Update to 2.20.1. [propagated-inputs]: Add MESA. Marius Bakke 2022-12-02gnu: rust-gl: Add 0.14....* gnu/packages/crates-graphics.scm (rust-gl-0.14): New variable. (rust-gl-0.11): Inherit. Marius Bakke