diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lint.scm | 11 | ||||
-rw-r--r-- | tests/pypi.scm | 8 | ||||
-rw-r--r-- | tests/read-print.scm | 5 | ||||
-rw-r--r-- | tests/style.scm | 22 | ||||
-rw-r--r-- | tests/transformations.scm | 13 |
5 files changed, 51 insertions, 8 deletions
diff --git a/tests/lint.scm b/tests/lint.scm index ce22e2355a..b91bd053c5 100644 --- a/tests/lint.scm +++ b/tests/lint.scm @@ -1,7 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2012, 2013 Cyril Roelandt <tipecaml@gmail.com> ;;; Copyright © 2014, 2015, 2016 Eric Bavier <bavier@member.fsf.org> -;;; Copyright © 2014-2022 Ludovic Courtès <ludo@gnu.org> +;;; Copyright © 2014-2023 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2015, 2016 Mathieu Lirzin <mthl@gnu.org> ;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com> ;;; Copyright © 2017 Alex Kost <alezost@gmail.com> @@ -43,7 +43,8 @@ #:use-module (guix lint) #:use-module (guix ui) #:use-module (guix swh) - #:use-module ((guix gexp) #:select (gexp local-file gexp?)) + #:use-module ((guix gexp) + #:select (gexp local-file computed-file gexp?)) #:use-module ((guix utils) #:select (call-with-temporary-directory)) #:use-module ((guix import hackage) #:select (%hackage-url)) #:use-module ((guix import stackage) #:select (%stackage-url)) @@ -1298,6 +1299,12 @@ '() (check-formatting (dummy-package "x"))) +(test-assert "archival: not an origin" + (warning-contains? "not an origin" + (check-archival + (dummy-package + "x" (source (computed-file "x-src" #t)))))) + (test-assert "archival: missing content" (let* ((origin (origin (method url-fetch) diff --git a/tests/pypi.scm b/tests/pypi.scm index 88bb0a3116..1ddcc542ff 100644 --- a/tests/pypi.scm +++ b/tests/pypi.scm @@ -255,7 +255,7 @@ Requires-Dist: pytest (>=3.1.0); extra == 'testing' ('sha256 ('base32 (? string? hash))))) - ('build-system 'python-build-system) + ('build-system 'pyproject-build-system) ('propagated-inputs ('list 'python-bar 'python-foo)) ('native-inputs ('list 'python-pytest)) ('home-page "http://example.com") @@ -323,7 +323,7 @@ Requires-Dist: pytest (>=3.1.0); extra == 'testing' ('sha256 ('base32 (? string? hash))))) - ('build-system 'python-build-system) + ('build-system 'pyproject-build-system) ('propagated-inputs ('list 'python-bar 'python-baz)) ('native-inputs ('list 'python-pytest)) ('home-page "http://example.com") @@ -371,7 +371,7 @@ Requires-Dist: pytest (>=3.1.0); extra == 'testing' ('sha256 ('base32 (? string? hash))))) - ('build-system 'python-build-system) + ('build-system 'pyproject-build-system) ('home-page "http://example.com") ('synopsis "summary") ('description "summary") @@ -420,7 +420,7 @@ Requires-Dist: pytest (>=3.1.0); extra == 'testing' ('base32 (? string? hash))))) ('properties ('quote (("upstream-name" . "foo-99")))) - ('build-system 'python-build-system) + ('build-system 'pyproject-build-system) ('propagated-inputs ('list 'python-bar 'python-foo)) ('native-inputs ('list 'python-pytest)) ('home-page "http://example.com") diff --git a/tests/read-print.scm b/tests/read-print.scm index c2b236b172..9e1d8038f1 100644 --- a/tests/read-print.scm +++ b/tests/read-print.scm @@ -58,6 +58,11 @@ expressions." (call-with-input-string "(a . b)" read-with-comments)) +(test-equal "read-with-comments: half dot notation" + '(lambda x x) + (call-with-input-string "(lambda (. x) x)" + read-with-comments)) + (test-equal "read-with-comments: list with blank line" `(list with ,(vertical-space 1) blank line) (call-with-input-string "\ diff --git a/tests/style.scm b/tests/style.scm index 6aab2c3785..f141a57d7f 100644 --- a/tests/style.scm +++ b/tests/style.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2021-2022 Ludovic Courtès <ludo@gnu.org> +;;; Copyright © 2021-2023 Ludovic Courtès <ludo@gnu.org> ;;; ;;; This file is part of GNU Guix. ;;; @@ -234,6 +234,26 @@ (list (package-inputs (@ (my-packages) my-coreutils)) (read-package-field (@ (my-packages) my-coreutils) 'inputs))))) +(test-equal "input labels, 'safe' policy, trivial arguments" + (list `(("gmp" ,gmp) ("mpfr" ,mpfr)) + "\ + (inputs (list gmp mpfr))\n") + (call-with-test-package '((inputs `(("GMP" ,gmp) ("Mpfr" ,mpfr))) + (arguments ;"trivial" arguments + '(#:tests? #f + #:test-target "whatever"))) + (lambda (directory) + (define file + (string-append directory "/my-packages.scm")) + + (system* "guix" "style" "-L" directory "my-coreutils" + "-S" "inputs" + "--input-simplification=safe") + + (load file) + (list (package-inputs (@ (my-packages) my-coreutils)) + (read-package-field (@ (my-packages) my-coreutils) 'inputs))))) + (test-equal "input labels, 'safe' policy, nothing changed" (list `(("GMP" ,gmp) ("ACL" ,acl)) "\ diff --git a/tests/transformations.scm b/tests/transformations.scm index 1fa2c0bba8..704818b9ed 100644 --- a/tests/transformations.scm +++ b/tests/transformations.scm @@ -33,7 +33,7 @@ #:use-module ((guix gexp) #:select (local-file? local-file-file computed-file? computed-file-gexp - gexp-input-thing)) + gexp-input-thing gexp->approximate-sexp)) #:use-module (guix ui) #:use-module (guix utils) #:use-module (guix git) @@ -408,6 +408,17 @@ (package-full-name grep)) (package-arguments (package-replacement dep0)))))))) +(test-equal "options->transformation, with-configure-flag" + '(append '() '("--flag=42")) + (let* ((p (dummy-package "foo" + (build-system gnu-build-system))) + (t (options->transformation + '((with-configure-flag . "foo=--flag=42"))))) + (let ((new (t p))) + (match (package-arguments new) + ((#:configure-flags flags) + (gexp->approximate-sexp flags)))))) + (test-assert "options->transformation, without-tests" (let* ((dep (dummy-package "dep")) (p (dummy-package "foo" |