aboutsummaryrefslogtreecommitdiff
# 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)"
: Ic487587b22495868fd2a21545a13dc9e3458299c 2024-04-14maint: Fix header.Janneke Nieuwenhuizen * build-aux/xgettext.scm: Add `Guix' parts to header. Change-Id: I4fb03b8b0588f0482bcb1a095518b6751d111031 2024-04-14maint: Use xgettext.scm wrapper to create .PO files reproducibly.Janneke Nieuwenhuizen * build-aux/xgettext.scm: New script. * po/guix/Makevars (XGETTEXT): Set it. (XGETTEXT_OPTIONS): Add --xgettext option to `real' xgettext. * po/packages/Makevars (XGETTEXT): Set it. (XGETTEXT_OPTIONS): Add --xgettext option to `real' xgettext. Change-Id: I71b6b843970090f765f46ac346b92a346560e3f0 2024-01-05build: test-driver.scm: Set mode.Tomas Volf Emacs auto-detects the build-aux/test-driver.scm as sh-mode, due to the shebang. So override the auto-detection using a local variable forcing scheme-mode. * build-aux/test-driver.scm: Set mode to scheme. Change-Id: I07f12656dba5fb7b52447b94569307a2a605ffc1 Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com> 2023-08-21maint: Add 'etc/hurd-manifest.scm'.Janneke Nieuwenhuizen * build-aux/cuirass/hurd-manifest.scm: Move to... * etc/hurd-manifest.scm: ...here. * Makefile.am (EXTRA_DIST): Update accordingly. 2023-07-25cuirass: Update hurd-manifest with newly supported packages.Janneke Nieuwenhuizen * build-aux/cuirass/hurd-manifest.scm: Include full build of python-minimal and gettext-minimal (no longer without-tests). Add grub-minimal, grub, guix-without-tests and guile-3.0 (no longer delete it from guix dependencies). 2022-05-26cuirass: Create just as many threads as needed.Ludovic Courtès * build-aux/cuirass/evaluate.scm (command-line): Change second argument to 'n-par-for-each'. 2022-05-26cuirass: Fork inferior processes before creating threads.Ludovic Courtès Works around <https://issues.guix.gnu.org/55441#12>. Start from commit bd86bbd300474204878e927f6cd3f0defa1662a5, 'open-inferior' uses 'primitive-fork' instead of 'open-pipe*'. As a result, child process could potentially hang before calling 'execl' due to undefined behavior when forking a multi-threaded process. * build-aux/cuirass/evaluate.scm <top level>: Call 'open-inferior' before 'n-par-for-each'. 2022-05-20cuirass: Close each inferior upon completion.Ludovic Courtès * build-aux/cuirass/evaluate.scm <top level>: Add 'close-inferior' call. 2021-12-22tests: Move keys into ./tests/keys/ and add a third ed25519 key.Attila Lendvai The third key will be used in an upcoming commit. Rename public keys to .pub. * guix/tests/gnupg.scm (%ed25519-3-public-key-file): New variable. (%ed25519-3-secret-key-file): New variable. (%ed25519-2-public-key-file): Renamed from %ed25519bis-public-key-file. (%ed25519-2-secret-key-file): Renamed from %ed25519bis-secret-key-file. * tests/keys/ed25519-3.key: New file. * tests/keys/ed25519-3.sec: New file. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org> 2021-11-27build-self: Help users to submit useful bug reports.Tobias Geerinckx-Rice * build-aux/build-self.scm (build): Request the ‘COMPLETE output’. 2021-10-17maint: Factorize po xref translation.Julien Lepiller This ensures we use the same method in "make" as in "guix/self.scm". * Makefile.am: Build guix/build/po.scm. * build-aux/convert-xref.scm: New file. * doc/local.mk (xref_command): Use it. * guix/self.scm (translate-cross-references): Move it... * guix/build/po.scm: Parse comments and flags separately to find fuzzy flags. (translate-cross-references): ...here. (parse-tree->assoc): Ignore fuzzy entries.