diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/graph.scm | 24 | ||||
-rw-r--r-- | tests/guix-build.sh | 9 | ||||
-rw-r--r-- | tests/guix-home.sh | 2 | ||||
-rw-r--r-- | tests/guix-refresh.sh | 7 | ||||
-rw-r--r-- | tests/guix-shell.sh | 2 | ||||
-rw-r--r-- | tests/guix-time-machine.sh | 28 | ||||
-rw-r--r-- | tests/packages.scm | 5 | ||||
-rw-r--r-- | tests/store-roots.scm | 7 | ||||
-rw-r--r-- | tests/texlive.scm | 4 |
9 files changed, 65 insertions, 23 deletions
diff --git a/tests/graph.scm b/tests/graph.scm index a6186ff7e8..c8189366a1 100644 --- a/tests/graph.scm +++ b/tests/graph.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2015-2022 Ludovic Courtès <ludo@gnu.org> +;;; Copyright © 2015-2023 Ludovic Courtès <ludo@gnu.org> ;;; ;;; This file is part of GNU Guix. ;;; @@ -377,7 +377,8 @@ edges." (((labels packages _ ...) ...) packages))))))))) -(test-assert "node-transitive-edges + node-back-edges" +(test-equal "node-transitive-edges + node-back-edges" + '() (run-with-store %store (let ((packages (fold-packages cons '())) (bootstrap? (lambda (package) @@ -386,17 +387,22 @@ edges." "bootstrap.scm"))) (trivial? (lambda (package) (eq? (package-build-system package) - trivial-build-system)))) + trivial-build-system))) + (system-specific? (lambda (package) + (memq #:system (package-arguments package))))) (mlet %store-monad ((edges (node-back-edges %bag-node-type packages))) (let* ((glibc (canonical-package glibc)) (dependents (node-transitive-edges (list glibc) edges)) (diff (lset-difference eq? packages dependents))) - ;; All the packages depend on libc, except bootstrap packages and - ;; some that use TRIVIAL-BUILD-SYSTEM. - (return (null? (remove (lambda (package) - (or (trivial? package) - (bootstrap? package))) - diff)))))))) + ;; All the packages depend on libc, except bootstrap packages, some + ;; packages that use TRIVIAL-BUILD-SYSTEM, and some that target a + ;; specific system and thus may depend on a different libc package + ;; object. + (return (remove (lambda (package) + (or (trivial? package) + (bootstrap? package) + (system-specific? package))) + diff))))))) (test-assert "node-transitive-edges, no duplicates" (run-with-store %store diff --git a/tests/guix-build.sh b/tests/guix-build.sh index 317c58ac42..4eab0e38b6 100644 --- a/tests/guix-build.sh +++ b/tests/guix-build.sh @@ -1,5 +1,5 @@ # GNU Guix --- Functional package management for GNU -# Copyright © 2012-2014, 2016-2022 Ludovic Courtès <ludo@gnu.org> +# Copyright © 2012-2014, 2016-2023 Ludovic Courtès <ludo@gnu.org> # Copyright © 2020 Marius Bakke <mbakke@fastmail.com> # Copyright © 2021 Chris Marusich <cmmarusich@gmail.com> # @@ -397,6 +397,13 @@ guix build -d -m "$module_dir/manifest.scm" \ rm "$module_dir"/*.scm +if [ -n "$BASH_VERSION" ] +then + # Check whether we can load from a /dev/fd/N denoting a pipe, using this + # handy Bash-specific construct. + guix build -m <(echo '(specifications->manifest (list "guile"))') -n +fi + # Using 'GUIX_BUILD_OPTIONS'. GUIX_BUILD_OPTIONS="--dry-run --no-grafts" export GUIX_BUILD_OPTIONS diff --git a/tests/guix-home.sh b/tests/guix-home.sh index e6d16d7fab..649d811a0c 100644 --- a/tests/guix-home.sh +++ b/tests/guix-home.sh @@ -224,5 +224,5 @@ EOF # guix home search mcron | grep "^name: home-mcron" - guix home search job manager | grep "^name: home-mcron" + guix home search scheduling daemon | grep "^name: home-mcron" ) diff --git a/tests/guix-refresh.sh b/tests/guix-refresh.sh index 51d34c4b51..2ce3c592ab 100644 --- a/tests/guix-refresh.sh +++ b/tests/guix-refresh.sh @@ -109,6 +109,13 @@ case "$(guix refresh -t test guile=2.0.0 2>&1)" in *"failed to find"*"2.0.0"*) true;; *) false;; esac + +guix refresh -t test guile --target-version=2.0.0 # XXX: should return non-zero? +case "$(guix refresh -t test guile --target-version=2.0.0 2>&1)" in + *"failed to find"*"2.0.0"*) true;; + *) false;; +esac + for spec in "guile=1.6.4" "guile@3=1.6.4" do guix refresh -t test "$spec" diff --git a/tests/guix-shell.sh b/tests/guix-shell.sh index ed368515eb..2f5fd86809 100644 --- a/tests/guix-shell.sh +++ b/tests/guix-shell.sh @@ -48,7 +48,7 @@ guix shell -s armhf-linux intelmetool -n && false # opens a couple of extra FDs. initial_fd_list="$(echo /proc/$$/fd/*)" fd_list="$(guix shell --bootstrap guile-bootstrap -- \ - "$SHELL" -c 'echo /proc/$$/fd/*')" + bash -c 'echo /proc/$$/fd/*')" test "$(echo $fd_list | wc -w)" -le "$(echo $initial_fd_list | wc -w)" # Ignoring unauthorized files. diff --git a/tests/guix-time-machine.sh b/tests/guix-time-machine.sh new file mode 100644 index 0000000000..8b62ef75ea --- /dev/null +++ b/tests/guix-time-machine.sh @@ -0,0 +1,28 @@ +# GNU Guix --- Functional package management for GNU +# Copyright © 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com> +# +# 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 time-machine' command-line utility. +# + +guix time-machine --version + +# Visiting a commit older than v1.0.0 fails. +! guix time-machine --commit=v0.15.0 + +exit 0 diff --git a/tests/packages.scm b/tests/packages.scm index 2b7ab01f7d..2b4f9f8e90 100644 --- a/tests/packages.scm +++ b/tests/packages.scm @@ -1277,8 +1277,9 @@ ;; #:guile guile)))) (test-equal "package->bag" - `("foo86-hurd" #f (,(package-source gnu-make)) - (,(canonical-package glibc)) (,(canonical-package coreutils))) + (parameterize ((%current-system "foo86-hurd")) + `("foo86-hurd" #f (,(package-source gnu-make)) + (,(canonical-package glibc)) (,(canonical-package coreutils)))) (let ((bag (package->bag gnu-make "foo86-hurd"))) (list (bag-system bag) (bag-target bag) (assoc-ref (bag-build-inputs bag) "source") diff --git a/tests/store-roots.scm b/tests/store-roots.scm index 9877987a65..bf30b1dff6 100644 --- a/tests/store-roots.scm +++ b/tests/store-roots.scm @@ -30,13 +30,6 @@ (test-begin "store-roots") -(test-equal "gc-roots, initial" - (list (string-append %state-directory "/profiles")) - (begin - ;; 'gc-roots' should gracefully handle lack of that directory. - (delete-file-recursively (string-append %state-directory "/profiles")) - (gc-roots))) - ;; The 'open-connection' call below gets guix-daemon to create ;; %STATE-DIRECTORY/profiles. (set! %store (open-connection)) diff --git a/tests/texlive.scm b/tests/texlive.scm index 98461f7e51..fac9faf714 100644 --- a/tests/texlive.scm +++ b/tests/texlive.scm @@ -542,12 +542,12 @@ completely compatible with Plain TeX.") ('arguments ('list '#:builder ('gexp ('mkdir ('ungexp 'output))))) ('propagated-inputs - ('list 'texlive-collection-basic 'texlive-texworks)) + ('list 'texlive-collection-basic)) ('home-page "https://www.tug.org/texlive/") ('synopsis (? string?)) ('description (? string?)) ('license - ('license:fsf-free "https://www.tug.org/texlive/copying.html"))) + ('fsf-free "https://www.tug.org/texlive/copying.html"))) #true) (_ (begin |