diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/guix-package.sh | 20 | ||||
| -rw-r--r-- | tests/packages.scm | 15 |
2 files changed, 34 insertions, 1 deletions
diff --git a/tests/guix-package.sh b/tests/guix-package.sh index 5f97aff026..9116f352c9 100644 --- a/tests/guix-package.sh +++ b/tests/guix-package.sh @@ -142,6 +142,17 @@ then # Make sure LIBRARY_PATH gets listed by `--search-paths'. guix package --bootstrap -p "$profile" -i guile-bootstrap -i gcc-bootstrap guix package --search-paths -p "$profile" | grep LIBRARY_PATH + + # Delete the third generation and check that it was actually deleted. + guix package -p "$profile" --delete-generations=3 + test -z "`guix package -p "$profile" -l 3`" + + # Exit with 1 when a generation does not exist. + if guix package -p "$profile" --delete-generations=42; + then false; else true; fi + + # Exit with 0 when trying to delete the zeroth generation. + guix package -p "$profile" --delete-generations=0 fi # Make sure the `:' syntax works. @@ -155,7 +166,14 @@ if guix package --bootstrap -i "guile-bootstrap:does-not-exist" -p "$profile"; then false; else true; fi # Check whether `--list-available' returns something sensible. -guix package -A 'gui.*e' | grep guile +guix package -p "$profile" -A 'gui.*e' | grep guile + +# There's no generation older than 12 months, so the following command should +# have no effect. +generation="`readlink_base "$profile"`" +if guix package -p "$profile" --delete-generations=12m; +then false; else true; fi +test "`readlink_base "$profile"`" = "$generation" # # Try with the default profile. diff --git a/tests/packages.scm b/tests/packages.scm index 706739fb70..e0cf4ee001 100644 --- a/tests/packages.scm +++ b/tests/packages.scm @@ -167,6 +167,21 @@ (equal? (call-with-input-file p get-bytevector-all) (call-with-input-file i get-bytevector-all)))))) +(test-assert "trivial with source" + (let* ((i (search-path %load-path "ice-9/boot-9.scm")) + (p (package (inherit (dummy-package "trivial-with-source")) + (build-system trivial-build-system) + (source i) + (arguments + `(#:guile ,%bootstrap-guile + #:builder (copy-file (assoc-ref %build-inputs "source") + %output))))) + (d (package-derivation %store p))) + (and (build-derivations %store (list d)) + (let ((p (derivation->output-path d))) + (equal? (call-with-input-file p get-bytevector-all) + (call-with-input-file i get-bytevector-all)))))) + (test-assert "trivial with system-dependent input" (let* ((p (package (inherit (dummy-package "trivial-system-dependent-input")) (build-system trivial-build-system) |
